Skip to content

[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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

foxriver76
Copy link
Collaborator

Link the feature issue which is closed by this PR

closes #1286

Implementation details

Added externalAuthentication optional property to UserCommon. It is Record<string, unknown> to allow for different external auths by name and the structure needs to be defined per implementation.

Tests

  • I have added tests to test this feature
  • It is not possible to test this feature

Documentation

  • I have documented the new feature

Documenting it on the type level should be enough IMO, specific implementations should document the further structure then, like ioBroker/webserver#7

@GermanBluefox
Copy link
Contributor

@foxriver76 do you have an example, how to use this?

@GermanBluefox GermanBluefox requested a review from Copilot May 19, 2025 06:18
Copy link
Contributor

@Copilot Copilot AI left a 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';

@foxriver76
Copy link
Collaborator Author

@foxriver76 do you have an example, how to use this?

Sure, as mentioned in the initial comment ioBroker/webserver#7 and the corresponding admin PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

think about a standardized property for different auth mechanisms in user objects
2 participants