-
-
Notifications
You must be signed in to change notification settings - Fork 60
[feature]: added external authentication to types for UserCommon #3058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@foxriver76 do you have an example, how to use this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds an optional externalAuthentication property to the UserCommon type to support various external authentication schemas. Key changes include:
- Updating the type definition to include externalAuthentication of type Record<string, unknown>.
- Adding tests to verify behavior when externalAuthentication is present.
- Updating CONTRIBUTING.md to use "npm ci" for dependency installation.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/types-public/index.test-d.ts | Added a test case for externalAuthentication behavior. |
CONTRIBUTING.md | Updated installation instructions to use "npm ci". |
Comments suppressed due to low confidence (1)
packages/types-public/index.test-d.ts:87
- Consider replacing the no-op equality check with an actual assertion (e.g., using an assertion library) to validate that oidc.sub has the expected value.
oidc.sub === 'foo';
Sure, as mentioned in the initial comment ioBroker/webserver#7 and the corresponding admin PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Link the feature issue which is closed by this PR
closes #1286
Implementation details
Added
externalAuthentication
optional property toUserCommon
. It is Record<string, unknown> to allow for different external auths by name and the structure needs to be defined per implementation.Tests
Documentation
Documenting it on the type level should be enough IMO, specific implementations should document the further structure then, like ioBroker/webserver#7