mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:57:32 +00:00
fix(settings): fix for setting restricted languages (#9947)
# Which Problems Are Solved Zitadel encounters a migration error when setting `restricted languages` and fails to start. # How the Problems Are Solved The problem is that there is a check that checks that at least one of the restricted languages is the same as the `default language`, however, in the `authz instance` (where the default language is pulled form) is never set. I've added code to set the `default language` in the `authz instance` # Additional Context - Closes https://github.com/zitadel/zitadel/issues/9787 --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -345,6 +345,7 @@ func instanceElementsEvents(ctx context.Context, instanceID, instanceName string
|
||||
instance.NewSecretGeneratorAddedEvent(ctx, &instanceAgg.Aggregate, domain.SecretGeneratorTypeOTPEmail, 8, 5*time.Minute, false, false, true, false),
|
||||
}
|
||||
}
|
||||
|
||||
func instanceElementsConfig() *SecretGenerators {
|
||||
return &SecretGenerators{
|
||||
ClientSecret: &crypto.GeneratorConfig{Length: 64, IncludeLowerLetters: true, IncludeUpperLetters: true, IncludeDigits: true},
|
||||
@@ -668,22 +669,23 @@ func TestCommandSide_setupMinimalInterfaces(t *testing.T) {
|
||||
eventstore: expectEventstore(
|
||||
slices.Concat(
|
||||
projectFilters(),
|
||||
[]expect{expectPush(
|
||||
projectAddedEvents(context.Background(),
|
||||
"INSTANCE",
|
||||
"ORG",
|
||||
"PROJECT",
|
||||
"owner",
|
||||
false,
|
||||
)...,
|
||||
),
|
||||
[]expect{
|
||||
expectPush(
|
||||
projectAddedEvents(context.Background(),
|
||||
"INSTANCE",
|
||||
"ORG",
|
||||
"PROJECT",
|
||||
"owner",
|
||||
false,
|
||||
)...,
|
||||
),
|
||||
},
|
||||
)...,
|
||||
),
|
||||
idGenerator: id_mock.NewIDGeneratorExpectIDs(t, projectClientIDs()...),
|
||||
},
|
||||
args: args{
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN"),
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN", language.Dutch),
|
||||
instanceAgg: instance.NewAggregate("INSTANCE"),
|
||||
orgAgg: org.NewAggregate("ORG"),
|
||||
owner: "owner",
|
||||
@@ -767,7 +769,7 @@ func TestCommandSide_setupAdmins(t *testing.T) {
|
||||
},
|
||||
},
|
||||
args: args{
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN"),
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN", language.Dutch),
|
||||
instanceAgg: instance.NewAggregate("INSTANCE"),
|
||||
orgAgg: org.NewAggregate("ORG"),
|
||||
human: instanceSetupHumanConfig(),
|
||||
@@ -806,7 +808,7 @@ func TestCommandSide_setupAdmins(t *testing.T) {
|
||||
keyAlgorithm: crypto.CreateMockEncryptionAlg(gomock.NewController(t)),
|
||||
},
|
||||
args: args{
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN"),
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN", language.Dutch),
|
||||
instanceAgg: instance.NewAggregate("INSTANCE"),
|
||||
orgAgg: org.NewAggregate("ORG"),
|
||||
machine: instanceSetupMachineConfig(),
|
||||
@@ -855,7 +857,7 @@ func TestCommandSide_setupAdmins(t *testing.T) {
|
||||
keyAlgorithm: crypto.CreateMockEncryptionAlg(gomock.NewController(t)),
|
||||
},
|
||||
args: args{
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN"),
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN", language.Dutch),
|
||||
instanceAgg: instance.NewAggregate("INSTANCE"),
|
||||
orgAgg: org.NewAggregate("ORG"),
|
||||
machine: instanceSetupMachineConfig(),
|
||||
@@ -972,7 +974,7 @@ func TestCommandSide_setupDefaultOrg(t *testing.T) {
|
||||
keyAlgorithm: crypto.CreateMockEncryptionAlg(gomock.NewController(t)),
|
||||
},
|
||||
args: args{
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN"),
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN", language.Dutch),
|
||||
instanceAgg: instance.NewAggregate("INSTANCE"),
|
||||
orgName: "ZITADEL",
|
||||
machine: &AddMachine{
|
||||
@@ -1097,7 +1099,7 @@ func TestCommandSide_setupInstanceElements(t *testing.T) {
|
||||
),
|
||||
},
|
||||
args: args{
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN"),
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN", language.Dutch),
|
||||
instanceAgg: instance.NewAggregate("INSTANCE"),
|
||||
setup: setupInstanceElementsConfig(),
|
||||
},
|
||||
@@ -1183,7 +1185,7 @@ func TestCommandSide_setUpInstance(t *testing.T) {
|
||||
},
|
||||
},
|
||||
args: args{
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN"),
|
||||
ctx: contextWithInstanceSetupInfo(context.Background(), "INSTANCE", "PROJECT", "console-id", "DOMAIN", language.Dutch),
|
||||
setup: setupInstanceConfig(),
|
||||
},
|
||||
res: res{
|
||||
|
Reference in New Issue
Block a user