Skip to content

Commit

Permalink
Merge branch 'main' into feature/error-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Oct 23, 2024
2 parents a7bdab9 + 8976b63 commit adfc48a
Show file tree
Hide file tree
Showing 14 changed files with 217 additions and 271 deletions.
40 changes: 40 additions & 0 deletions .changeset/chilled-suits-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
"@open-pioneer/authentication-keycloak": minor
"@open-pioneer/authentication": minor
---

Replace change events for auth state wiht signals from Reactivity API

watch for updates of the auth state

```typescript
const myAuthService = ...
watch(
() => [myAuthService.getAuthState()],
([state]) => {
console.log(state);
},
{
immediate: true
}
);
```

The Auth Service forwards the auth state from the underlying AuthPlugin.
Therefore, the plugin implementation must use reactive signals when its auth state changes in order to signal changes to the service.

```typescript
class DummyPlugin implements AuthPlugin {
#state = reactive<AuthState>({
kind: "not-authenticated"
});

getAuthState(): AuthState {
return this.#state.value;
}

$setAuthState(newState: AuthState) {
this.#state.value = newState;
}
}
```
36 changes: 12 additions & 24 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
// Can be removed once https://github.com/jsx-eslint/eslint-plugin-react/issues/3602 is closed
"suppressDeprecatedPropertyWarnings": true
},
"plugins": ["@typescript-eslint", "import", "unused-imports", "header", "react", "react-hooks"],
"env": {
"node": true,
Expand Down Expand Up @@ -67,37 +71,21 @@
{
"vars": "all",
"varsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],

// Allow {} again
"@typescript-eslint/ban-types": [
// Allow {} as type
"@typescript-eslint/no-empty-object-type": "off",

"@typescript-eslint/no-unused-expressions": [
"error",
{
"extendDefaults": false,
"types": {
"String": {
"message": "Use string instead",
"fixWith": "string"
},
"Boolean": {
"message": "Use boolean instead",
"fixWith": "boolean"
},
"Number": {
"message": "Use number instead",
"fixWith": "number"
},
"Symbol": {
"message": "Use symbol instead",
"fixWith": "symbol"
},
"Function": {
"message": "Use typed function signatures instead"
}
}
"allowShortCircuit": true,
"allowTernary": true
}
],

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"ignoreCves": []
},
"patchedDependencies": {
"@changesets/assemble-release-plan": "patches/@changesets__assemble-release-plan.patch"
"@changesets/assemble-release-plan@6.0.4": "patches/@changesets__assemble-release-plan.patch"
},
"peerDependencyRules": {
"allowedVersions": {
Expand Down
Loading

0 comments on commit adfc48a

Please sign in to comment.