From 21b28b56acfa3506ecf69382a423aa8e4c2de882 Mon Sep 17 00:00:00 2001 From: Livio Spring <9405495+livio-a@users.noreply.github.com> Date: Mon, 30 Mar 2026 17:59:57 +0200 Subject: [PATCH] fix: revert feature key for configs back to ConsoleUseV2UserApi (#11928) # Which Problems Are Solved https://github.com/zitadel/zitadel/pull/11390 renamed "Console" to "Management Console". While https://github.com/zitadel/zitadel/pull/11706 already reverted an unintended rename of the feature key to enable the management console to use the V2 API for user creation. It was now also discovered that the rename of the feature itself also broke existing (default) configurations. # How the Problems Are Solved Added a `mapstructure` tag on the instance feature to handle existing configs. # Additional Changes Removed unused `TokenExchange` from the default configuration. # Additional Context - relates to #11390 - relates to #11706 - requires backport to v4.x --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Marco A. --- cmd/defaults.yaml | 1 - cmd/setup/config_test.go | 6 ++++-- cmd/start/config_test.go | 6 ++++-- internal/command/instance_features.go | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmd/defaults.yaml b/cmd/defaults.yaml index ae1103908..de89d7f45 100644 --- a/cmd/defaults.yaml +++ b/cmd/defaults.yaml @@ -1320,7 +1320,6 @@ DefaultInstance: Features: LoginDefaultOrg: true # ZITADEL_DEFAULTINSTANCE_FEATURES_LOGINDEFAULTORG UserSchema: # ZITADEL_DEFAULTINSTANCE_FEATURES_USERSCHEMA - TokenExchange: # ZITADEL_DEFAULTINSTANCE_FEATURES_TOKENEXCHANGE ImprovedPerformance: # ZITADEL_DEFAULTINSTANCE_FEATURES_IMPROVEDPERFORMANCE # https://github.com/zitadel/zitadel/blob/main/internal/feature/feature.go#L64-L68 # - 1 # OrgByID diff --git a/cmd/setup/config_test.go b/cmd/setup/config_test.go index c14bd6f05..182b73435 100644 --- a/cmd/setup/config_test.go +++ b/cmd/setup/config_test.go @@ -40,6 +40,7 @@ DefaultInstance: Features: LoginDefaultOrg: true UserSchema: true + ConsoleUseV2UserApi: true LoginV2: Required: true BaseURI: 'http://zitadel:8080' @@ -51,8 +52,9 @@ Actions: `}, want: func(t *testing.T, config *Config) { assert.Equal(t, config.DefaultInstance.Features, &command.InstanceFeatures{ - LoginDefaultOrg: gu.Ptr(true), - UserSchema: gu.Ptr(true), + LoginDefaultOrg: gu.Ptr(true), + UserSchema: gu.Ptr(true), + ManagementConsoleUseV2UserApi: gu.Ptr(true), LoginV2: &feature.LoginV2{ Required: true, BaseURI: &url.URL{Scheme: "http", Host: "zitadel:8080"}, diff --git a/cmd/start/config_test.go b/cmd/start/config_test.go index 36ac50571..e2988299b 100644 --- a/cmd/start/config_test.go +++ b/cmd/start/config_test.go @@ -76,6 +76,7 @@ DefaultInstance: Features: LoginDefaultOrg: true UserSchema: true + ConsoleUseV2UserApi: true LoginV2: Required: true BaseURI: 'http://zitadel:8080' @@ -87,8 +88,9 @@ Actions: `}, want: func(t *testing.T, config *Config) { assert.Equal(t, config.DefaultInstance.Features, &command.InstanceFeatures{ - LoginDefaultOrg: gu.Ptr(true), - UserSchema: gu.Ptr(true), + LoginDefaultOrg: gu.Ptr(true), + UserSchema: gu.Ptr(true), + ManagementConsoleUseV2UserApi: gu.Ptr(true), LoginV2: &feature.LoginV2{ Required: true, BaseURI: &url.URL{Scheme: "http", Host: "zitadel:8080"}, diff --git a/internal/command/instance_features.go b/internal/command/instance_features.go index 806832606..3568c1e32 100644 --- a/internal/command/instance_features.go +++ b/internal/command/instance_features.go @@ -20,7 +20,7 @@ type InstanceFeatures struct { OIDCSingleV1SessionTermination *bool LoginV2 *feature.LoginV2 PermissionCheckV2 *bool - ManagementConsoleUseV2UserApi *bool + ManagementConsoleUseV2UserApi *bool `mapstructure:"ConsoleUseV2UserApi"` // for backwards compatibility we need to change this back to the old config name EnableRelationalTables *bool }