Skip to content
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

Merged
merged 17 commits into from
Dec 10, 2024
Merged

Feat extend user import #1992

merged 17 commits into from
Dec 10, 2024

Conversation

FreddyDevelop
Copy link
Contributor

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.

Copy link
Contributor

@bjoern-m bjoern-m left a 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.

users.json

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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.
@FreddyDevelop FreddyDevelop merged commit 312ebc8 into main Dec 10, 2024
8 checks passed
@FreddyDevelop FreddyDevelop deleted the feat-extend-user-import branch December 10, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Recently closed
Development

Successfully merging this pull request may close these issues.

2 participants