mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
fix: revert renaming of (management) console feature flag (#11706)
# Which Problems Are Solved #11390 renamed "Console" to "Management Console". This included a rename of the feature key to enable the management console to use the V2 API for user creation. Due to the rename generated events would also be changed, resp. existing events would be ignored, which leads to inconsistency in the data model. # How the Problems Are Solved Renamed the key back to `KeyConsoleUseV2UserApi`. And added a comment to prevent future issues. # Additional Changes None # Additional Context - relates to #11390 - backport to v4
This commit is contained in:
@@ -107,7 +107,7 @@ func reduceInstanceFeature(features *InstanceFeatures, key feature.Key, value an
|
||||
case feature.KeyPermissionCheckV2:
|
||||
v := value.(bool)
|
||||
features.PermissionCheckV2 = &v
|
||||
case feature.KeyManagementConsoleUseV2UserApi:
|
||||
case feature.KeyConsoleUseV2UserApi:
|
||||
v := value.(bool)
|
||||
features.ManagementConsoleUseV2UserApi = &v
|
||||
case feature.KeyEnableRelationalTables:
|
||||
|
||||
@@ -96,7 +96,7 @@ func Test_reduceInstanceFeature(t *testing.T) {
|
||||
name: "management console uses v2 user api",
|
||||
args: args{
|
||||
features: &InstanceFeatures{},
|
||||
key: feature.KeyManagementConsoleUseV2UserApi,
|
||||
key: feature.KeyConsoleUseV2UserApi,
|
||||
value: true,
|
||||
},
|
||||
expected: &InstanceFeatures{ManagementConsoleUseV2UserApi: gu.Ptr(true)},
|
||||
|
||||
@@ -9,6 +9,10 @@ import (
|
||||
type Key int
|
||||
|
||||
const (
|
||||
// Note: Do not change the values of the existing keys, as they are used in events and changing them would break existing events.
|
||||
// If a key / feature is no longer used, mark it as reserved to prevent future use.
|
||||
// And iterate the features projections to prevent them from getting stuck.
|
||||
|
||||
// Reserved: 2, 3, 5, 6, 8, 11, 12
|
||||
|
||||
KeyUnspecified Key = 0
|
||||
@@ -19,7 +23,7 @@ const (
|
||||
KeyOIDCSingleV1SessionTermination Key = 10
|
||||
KeyLoginV2 Key = 13
|
||||
KeyPermissionCheckV2 Key = 14
|
||||
KeyManagementConsoleUseV2UserApi Key = 15
|
||||
KeyConsoleUseV2UserApi Key = 15
|
||||
KeyEnableRelationalTables Key = 16
|
||||
)
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ const (
|
||||
_KeyLowerName_2 = "improved_performance"
|
||||
_KeyName_3 = "debug_oidc_parent_erroroidc_single_v1_session_termination"
|
||||
_KeyLowerName_3 = "debug_oidc_parent_erroroidc_single_v1_session_termination"
|
||||
_KeyName_4 = "login_v2permission_check_v2management_console_use_v2_user_apienable_relational_tables"
|
||||
_KeyLowerName_4 = "login_v2permission_check_v2management_console_use_v2_user_apienable_relational_tables"
|
||||
_KeyName_4 = "login_v2permission_check_v2console_use_v2_user_apienable_relational_tables"
|
||||
_KeyLowerName_4 = "login_v2permission_check_v2console_use_v2_user_apienable_relational_tables"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -25,7 +25,7 @@ var (
|
||||
_KeyIndex_1 = [...]uint8{0, 11}
|
||||
_KeyIndex_2 = [...]uint8{0, 20}
|
||||
_KeyIndex_3 = [...]uint8{0, 23, 57}
|
||||
_KeyIndex_4 = [...]uint8{0, 8, 27, 61, 85}
|
||||
_KeyIndex_4 = [...]uint8{0, 8, 27, 50, 74}
|
||||
)
|
||||
|
||||
func (i Key) String() string {
|
||||
@@ -59,11 +59,11 @@ func _KeyNoOp() {
|
||||
_ = x[KeyOIDCSingleV1SessionTermination-(10)]
|
||||
_ = x[KeyLoginV2-(13)]
|
||||
_ = x[KeyPermissionCheckV2-(14)]
|
||||
_ = x[KeyManagementConsoleUseV2UserApi-(15)]
|
||||
_ = x[KeyConsoleUseV2UserApi-(15)]
|
||||
_ = x[KeyEnableRelationalTables-(16)]
|
||||
}
|
||||
|
||||
var _KeyValues = []Key{KeyUnspecified, KeyLoginDefaultOrg, KeyUserSchema, KeyImprovedPerformance, KeyDebugOIDCParentError, KeyOIDCSingleV1SessionTermination, KeyLoginV2, KeyPermissionCheckV2, KeyManagementConsoleUseV2UserApi, KeyEnableRelationalTables}
|
||||
var _KeyValues = []Key{KeyUnspecified, KeyLoginDefaultOrg, KeyUserSchema, KeyImprovedPerformance, KeyDebugOIDCParentError, KeyOIDCSingleV1SessionTermination, KeyLoginV2, KeyPermissionCheckV2, KeyConsoleUseV2UserApi, KeyEnableRelationalTables}
|
||||
|
||||
var _KeyNameToValueMap = map[string]Key{
|
||||
_KeyName_0[0:11]: KeyUnspecified,
|
||||
@@ -82,10 +82,10 @@ var _KeyNameToValueMap = map[string]Key{
|
||||
_KeyLowerName_4[0:8]: KeyLoginV2,
|
||||
_KeyName_4[8:27]: KeyPermissionCheckV2,
|
||||
_KeyLowerName_4[8:27]: KeyPermissionCheckV2,
|
||||
_KeyName_4[27:61]: KeyManagementConsoleUseV2UserApi,
|
||||
_KeyLowerName_4[27:61]: KeyManagementConsoleUseV2UserApi,
|
||||
_KeyName_4[61:85]: KeyEnableRelationalTables,
|
||||
_KeyLowerName_4[61:85]: KeyEnableRelationalTables,
|
||||
_KeyName_4[27:50]: KeyConsoleUseV2UserApi,
|
||||
_KeyLowerName_4[27:50]: KeyConsoleUseV2UserApi,
|
||||
_KeyName_4[50:74]: KeyEnableRelationalTables,
|
||||
_KeyLowerName_4[50:74]: KeyEnableRelationalTables,
|
||||
}
|
||||
|
||||
var _KeyNames = []string{
|
||||
@@ -97,8 +97,8 @@ var _KeyNames = []string{
|
||||
_KeyName_3[23:57],
|
||||
_KeyName_4[0:8],
|
||||
_KeyName_4[8:27],
|
||||
_KeyName_4[27:61],
|
||||
_KeyName_4[61:85],
|
||||
_KeyName_4[27:50],
|
||||
_KeyName_4[50:74],
|
||||
}
|
||||
|
||||
// KeyString retrieves an enum value from the enum constants string name.
|
||||
|
||||
@@ -118,7 +118,7 @@ func reduceInstanceFeatureSet[T any](features *InstanceFeatures, event *feature_
|
||||
features.LoginV2.set(level, event.Value)
|
||||
case feature.KeyPermissionCheckV2:
|
||||
features.PermissionCheckV2.set(level, event.Value)
|
||||
case feature.KeyManagementConsoleUseV2UserApi:
|
||||
case feature.KeyConsoleUseV2UserApi:
|
||||
features.ManagementConsoleUseV2UserApi.set(level, event.Value)
|
||||
case feature.KeyEnableRelationalTables:
|
||||
features.EnableRelationalTables.set(level, event.Value)
|
||||
|
||||
@@ -28,7 +28,7 @@ var (
|
||||
InstanceOIDCSingleV1SessionTerminationEventType = setEventTypeFromFeature(feature.LevelInstance, feature.KeyOIDCSingleV1SessionTermination)
|
||||
InstanceLoginVersion = setEventTypeFromFeature(feature.LevelInstance, feature.KeyLoginV2)
|
||||
InstancePermissionCheckV2 = setEventTypeFromFeature(feature.LevelInstance, feature.KeyPermissionCheckV2)
|
||||
InstanceManagementConsoleUseV2UserApi = setEventTypeFromFeature(feature.LevelInstance, feature.KeyManagementConsoleUseV2UserApi)
|
||||
InstanceManagementConsoleUseV2UserApi = setEventTypeFromFeature(feature.LevelInstance, feature.KeyConsoleUseV2UserApi)
|
||||
InstanceEnableRelationalTables = setEventTypeFromFeature(feature.LevelInstance, feature.KeyEnableRelationalTables)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user