mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-21 04:18:46 +00:00
feat: add recovery codes to user repository (#11702)
# Which Problems Are Solved Adds a repository implementation to add/remove recovery codes to the users relational table. # How the Problems Are Solved This is achieved by: * adding the following columns to the users table: `recovery_codes`, `recovery_code_last_successful_check`, `recovery_code_failed_attempts` * adding the `RecoveryCodes` field to the `HumanUser` domain with fields to set recovery `codes`, `lastSuccessfullyCheckedAt` timestamp, and `failedAttempts` * setting `recoveryCodes` in the `Get` user query statement to return a json object with details related to the recovery codes * adding the repository-layer implementation to add/remove recovery codes and set fields related to recovery code checks. * adding projection reducers to handle the following events: `HumanRecoveryCodesAddedEvent`, `HumanRecoveryCodesRemovedEvent`, `HumanRecoveryCodeCheckSucceededEvent`, and `HumanRecoveryCodeCheckFailedEvent` * adding unit tests # Additional Changes * fix the error message when the recovery is empty in `internal/command/user_human_recovery_codes.go` * add a new error message for empty recovery code during checks in `en.yaml` # Additional Context - Closes https://github.com/zitadel/zitadel/issues/11212 - Follow-up: integration tests for the reducers will be added in a different PR after this [PR](https://github.com/zitadel/zitadel/pull/11478) is merged
This commit is contained in:
@@ -180,6 +180,7 @@ Errors:
|
||||
Passwordless:
|
||||
NotExisting: "Passkey does not exist"
|
||||
RecoveryCodes:
|
||||
Empty: "Recovery code is empty"
|
||||
InvalidCode: "Invalid recovery code provided"
|
||||
MaxCountExceeded: "Maximum number of recovery codes exceeded"
|
||||
NotReady: "Recovery codes are not ready for use"
|
||||
@@ -196,10 +197,6 @@ Errors:
|
||||
RefreshToken:
|
||||
Invalid: "Refresh Token is invalid"
|
||||
NotFound: "Refresh Token not found"
|
||||
Instance:
|
||||
NotFound: "Instance not found"
|
||||
AlreadyExists: "Instance already exists"
|
||||
NotChanged: "Instance not changed"
|
||||
Org:
|
||||
AlreadyExists: "Organisation's name or id already taken"
|
||||
Invalid: "Organisation is invalid"
|
||||
@@ -346,6 +343,8 @@ Errors:
|
||||
NotActive: "Project Grant is not active"
|
||||
NotInactive: "Project Grant is not inactive"
|
||||
Instance:
|
||||
AlreadyExists: "Instance already exists"
|
||||
NotChanged: "Instance not changed"
|
||||
NotFound: "Instance not found. Make sure you got the domain right. Check out https://zitadel.com/docs/apis/introduction#domains"
|
||||
Member:
|
||||
RolesNotChanged: "Roles have not been changed"
|
||||
|
||||
Reference in New Issue
Block a user