-
Notifications
You must be signed in to change notification settings - Fork 938
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
Feat extend user import #1992
Feat extend user import #1992
Conversation
Add custom user ID to a user. This custom user ID is only used for verifying assertions from imported passkeys.
Change the DB schema to restrict a user handle to only one user.
Co-authored-by: bjoern-m <[email protected]>
Co-authored-by: bjoern-m <[email protected]>
Apply unique constraint to the column handle in table webauthn_credential_user_handles.
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.
I tried to import the following file, that contains a user having two WebAuthn credentials with the same user handle. I think this should be working, but the importer tries to insert the user handle twice causing a unique key constraint violation.
backend/cmd/user/format.go
Outdated
@@ -26,16 +26,76 @@ func (ImportOrExportEmail) JSONSchemaExtend(schema *jsonschema.Schema) { | |||
// Emails Array of email addresses | |||
type Emails []ImportOrExportEmail | |||
|
|||
type ImportWebauthnCredential struct { | |||
// ID of the webauthn credential. |
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.
// ID of the webauthn credential. | |
// ID of the WebAuthn credential. |
There are multiple occurrences across this PR.
Fix user import with multiple credential and the same user handle. Check if the user handle already exists and associate the credential with it otherwise create a new user handle in the database.
Description
Extend the user import to import existing passwords, webauthn credentials, ...
Implementation
Extended the already existing import command to include more information.
Tests
Create a json file with users to import, then use the import command to import the users.