From 1e0b810dca507da344441d2398e823f3c0a68547 Mon Sep 17 00:00:00 2001 From: Livio Spring <9405495+livio-a@users.noreply.github.com> Date: Wed, 1 Jul 2026 06:53:16 +0200 Subject: [PATCH] feat: allow managing invite code in secret generators (#12109) # Which Problems Are Solved Zitadel exposes the secrets generator configuration through its admin api. This allows instance admins to manage them on their own and they can create overwrite the system / runtime defaults (incl. expiration). This very much needed in multi-instance scenarios such as zitadel.cloud. Currently the invite code configuration was not manageable through the API, but only runtime config. # How the Problems Are Solved - added the `invite_code` type to the API allowing it to be set and retrieved. - added the type to console's management list - added the type to be stored on instance setup - change the `GetSecretGenerator` endpoint to fall back to the runtime config if no config is stored on the instance itself - ensure the `length` and at least one charset is enabled, return an error otherwise - expiry is not enforced, so 0 allows codes with no expiry (current state) # Additional Changes None # Additional Context - closes https://github.com/zitadel/zitadel/issues/10474 --- TERMINOLOGY.md | 1 + .../manage/console/default-settings.mdx | 1 + backend/v3/domain/settings.go | 5 + .../events_testing/settings_instance_test.go | 8 ++ .../storage/database/repository/settings.go | 7 ++ .../database/repository/settings_test.go | 32 ++++++ cmd/defaults.yaml | 12 +- cmd/mirror/projections.go | 1 + cmd/setup/setup.go | 1 + cmd/start/start.go | 1 + .../secret-generator.component.ts | 1 + console/src/assets/i18n/ar.json | 3 +- console/src/assets/i18n/bg.json | 3 +- console/src/assets/i18n/cs.json | 3 +- console/src/assets/i18n/de.json | 3 +- console/src/assets/i18n/en.json | 3 +- console/src/assets/i18n/es.json | 3 +- console/src/assets/i18n/fr.json | 3 +- console/src/assets/i18n/hu.json | 3 +- console/src/assets/i18n/id.json | 3 +- console/src/assets/i18n/it.json | 3 +- console/src/assets/i18n/ja.json | 3 +- console/src/assets/i18n/ko.json | 3 +- console/src/assets/i18n/mk.json | 3 +- console/src/assets/i18n/nl.json | 3 +- console/src/assets/i18n/pl.json | 3 +- console/src/assets/i18n/pt.json | 3 +- console/src/assets/i18n/ro.json | 3 +- console/src/assets/i18n/ru.json | 3 +- console/src/assets/i18n/sv.json | 3 +- console/src/assets/i18n/tr.json | 3 +- console/src/assets/i18n/uk.json | 3 +- console/src/assets/i18n/zh.json | 3 +- .../api/grpc/admin/iam_settings_converter.go | 4 + internal/command/instance.go | 17 +++ internal/command/instance_settings.go | 9 +- internal/command/instance_settings_test.go | 90 ++++++++++----- internal/command/instance_test.go | 3 + internal/crypto/code.go | 10 ++ .../query/projection/settings_relational.go | 8 +- internal/query/query.go | 3 + internal/query/secret_generator_test.go | 107 ++++++++++++++++++ internal/query/secret_generators.go | 25 +++- proto/zitadel/settings.proto | 1 + 44 files changed, 351 insertions(+), 62 deletions(-) diff --git a/TERMINOLOGY.md b/TERMINOLOGY.md index 25760925e..23422aa7e 100644 --- a/TERMINOLOGY.md +++ b/TERMINOLOGY.md @@ -73,6 +73,7 @@ All user-facing wording in docs, UI, and API descriptions must follow this table | Password changed | Past-tense wording for password change notification | Password change | Password changed | replace | UI notifications | | Object descriptions | All resource descriptions must use end-user language | internal / technical wording | clear end-user language | replace | UI + Docs | | Complement Token | Flow type for actions executed during token creation. In UI use "Complement Token"; in API use `flowType = 2` (CustomiseToken). Docs must not show PreUserinfoCreation=3 for this type. | Compliment Token, CustomiseToken, CustomizeToken | Complement Token | replace | Everywhere | +| Invite Code | One-time code used to invite a user to set up authentication (secret generator and user-invite flows) | Invitation Code, Invitation code | Invite Code | replace | UI + Docs | ## Governance diff --git a/apps/docs/content/guides/manage/console/default-settings.mdx b/apps/docs/content/guides/manage/console/default-settings.mdx index afeb1c887..10de697e9 100644 --- a/apps/docs/content/guides/manage/console/default-settings.mdx +++ b/apps/docs/content/guides/manage/console/default-settings.mdx @@ -387,6 +387,7 @@ The following secrets can be specified: - Application secrets - One Time Password (OTP) - SMS - One Time Password (OTP) - Email +- Invite Code