mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-01 11:52:15 +00:00
feat: asset storage (#1696)
* feat: remove assets * feat: minio implementation * fix: remove assets from tests * feat: minio implementation * feat: Env vars * fix: sprintf * fix: sprintf * Update internal/eventstore/repository/repository.go Co-authored-by: Livio Amstutz <[email protected]> * fix: error handling Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
@@ -88,7 +88,6 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name1", "IAM")),
|
||||
),
|
||||
),
|
||||
@@ -235,7 +234,6 @@ func TestCommandSide_ChangeDefaultIDPConfig(t *testing.T) {
|
||||
newDefaultIDPConfigChangedEvent(context.Background(), "config1", "name1", "name2", domain.IDPConfigStylingTypeUnspecified),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(idpconfig.NewRemoveIDPConfigNameUniqueConstraint("name1", "IAM")),
|
||||
uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name2", "IAM")),
|
||||
),
|
||||
|
||||
@@ -226,7 +226,6 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretCrypto: crypto.CreateMockEncryptionAlg(gomock.NewController(t)),
|
||||
|
||||
@@ -180,7 +180,6 @@ func TestCommandSide_AddIAMMember(t *testing.T) {
|
||||
[]string{"IAM_OWNER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("IAM", "user1")),
|
||||
),
|
||||
),
|
||||
@@ -231,7 +230,6 @@ func TestCommandSide_AddIAMMember(t *testing.T) {
|
||||
[]string{"IAM_OWNER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("IAM", "user1")),
|
||||
),
|
||||
),
|
||||
@@ -410,7 +408,6 @@ func TestCommandSide_ChangeIAMMember(t *testing.T) {
|
||||
[]string{"IAM_OWNER", "IAM_OWNER_VIEWER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
zitadelRoles: []authz.RoleMapping{
|
||||
@@ -531,7 +528,6 @@ func TestCommandSide_RemoveIAMMember(t *testing.T) {
|
||||
"user1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint("IAM", "user1")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -95,7 +95,6 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -244,7 +243,6 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) {
|
||||
newDefaultLabelPolicyChangedEvent(context.Background(), "primary-color-change", "secondary-color-change", false),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -83,7 +83,6 @@ func TestCommandSide_AddDefaultLoginPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -224,7 +223,6 @@ func TestCommandSide_ChangeDefaultLoginPolicy(t *testing.T) {
|
||||
newDefaultLoginPolicyChangedEvent(context.Background(), false, false, false, false, domain.PasswordlessTypeNotAllowed),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -394,7 +392,6 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) {
|
||||
"config1"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -558,7 +555,6 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) {
|
||||
"config1"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -605,7 +601,6 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) {
|
||||
"config1"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -671,7 +666,6 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) {
|
||||
&user.NewAggregate("user1", "org1").Aggregate,
|
||||
"config1", "externaluser1")),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewRemoveExternalIDPUniqueConstraint("config1", "externaluser1")),
|
||||
),
|
||||
),
|
||||
@@ -787,7 +781,6 @@ func TestCommandSide_AddSecondFactorDefaultLoginPolicy(t *testing.T) {
|
||||
domain.SecondFactorTypeOTP),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -920,7 +913,6 @@ func TestCommandSide_RemoveSecondFactorDefaultLoginPolicy(t *testing.T) {
|
||||
domain.SecondFactorTypeOTP),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1024,7 +1016,6 @@ func TestCommandSide_AddMultiFactorDefaultLoginPolicy(t *testing.T) {
|
||||
domain.MultiFactorTypeU2FWithPIN),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1157,7 +1148,6 @@ func TestCommandSide_RemoveMultiFactorDefaultLoginPolicy(t *testing.T) {
|
||||
domain.MultiFactorTypeU2FWithPIN),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -86,7 +86,6 @@ func TestCommandSide_AddDefaultMailTemplatePolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -221,7 +220,6 @@ func TestCommandSide_ChangeDefaultMailTemplatePolicy(t *testing.T) {
|
||||
newDefaultMailTemplatePolicyChangedEvent(context.Background(), []byte("template-change")),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -107,7 +107,6 @@ func TestCommandSide_AddDefaultMailTextPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(policy.NewAddMailTextUniqueConstraint("IAM", "mail-text-type", "de")),
|
||||
),
|
||||
),
|
||||
@@ -295,7 +294,6 @@ func TestCommandSide_ChangeDefaultMailTextPolicy(t *testing.T) {
|
||||
"button-text-change"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -71,7 +71,6 @@ func TestCommandSide_AddDefaultOrgIAMPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -191,7 +190,6 @@ func TestCommandSide_ChangeDefaultOrgIAMPolicy(t *testing.T) {
|
||||
newDefaultOrgIAMPolicyChangedEvent(context.Background(), false),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -74,7 +74,6 @@ func TestCommandSide_AddDefaultPasswordAgePolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -200,7 +199,6 @@ func TestCommandSide_ChangeDefaultPasswordAgePolicy(t *testing.T) {
|
||||
newDefaultPasswordAgePolicyChangedEvent(context.Background(), 125, 5),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -98,7 +98,6 @@ func TestCommandSide_AddDefaultPasswordComplexityPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -257,7 +256,6 @@ func TestCommandSide_ChangeDefaultPasswordComplexityPolicy(t *testing.T) {
|
||||
newDefaultPasswordComplexityPolicyChangedEvent(context.Background(), 10, false, false, false, false),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -74,7 +74,6 @@ func TestCommandSide_AddDefaultPasswordLockoutPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -200,7 +199,6 @@ func TestCommandSide_ChangeDefaultPasswordLockoutPolicy(t *testing.T) {
|
||||
newDefaultPasswordLockoutPolicyChangedEvent(context.Background(), 20, false),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -103,15 +103,15 @@ func (repo *testRepo) LatestSequence(ctx context.Context, queryFactory *reposito
|
||||
return repo.sequence, nil
|
||||
}
|
||||
|
||||
func expectPush(events []*repository.Event, assets []*repository.Asset, uniqueConstraints ...*repository.UniqueConstraint) expect {
|
||||
func expectPush(events []*repository.Event, uniqueConstraints ...*repository.UniqueConstraint) expect {
|
||||
return func(m *mock.MockRepository) {
|
||||
m.ExpectPush(events, assets, uniqueConstraints...)
|
||||
m.ExpectPush(events, uniqueConstraints...)
|
||||
}
|
||||
}
|
||||
|
||||
func expectPushFailed(err error, events []*repository.Event, assets []*repository.Asset, uniqueConstraints ...*repository.UniqueConstraint) expect {
|
||||
func expectPushFailed(err error, events []*repository.Event, uniqueConstraints ...*repository.UniqueConstraint) expect {
|
||||
return func(m *mock.MockRepository) {
|
||||
m.ExpectPushFailed(err, events, assets, uniqueConstraints...)
|
||||
m.ExpectPushFailed(err, events, uniqueConstraints...)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ func TestCommandSide_AddOrgDomain(t *testing.T) {
|
||||
"domain.ch",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -323,7 +322,6 @@ func TestCommandSide_GenerateOrgDomainValidation(t *testing.T) {
|
||||
},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -376,7 +374,6 @@ func TestCommandSide_GenerateOrgDomainValidation(t *testing.T) {
|
||||
},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -621,7 +618,6 @@ func TestCommandSide_ValidateOrgDomain(t *testing.T) {
|
||||
"domain.ch",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
alg: crypto.CreateMockEncryptionAlg(gomock.NewController(t)),
|
||||
@@ -680,7 +676,6 @@ func TestCommandSide_ValidateOrgDomain(t *testing.T) {
|
||||
"domain.ch",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgDomainUniqueConstraint("domain.ch")),
|
||||
),
|
||||
),
|
||||
@@ -743,7 +738,6 @@ func TestCommandSide_ValidateOrgDomain(t *testing.T) {
|
||||
"domain.ch",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgDomainUniqueConstraint("domain.ch")),
|
||||
),
|
||||
),
|
||||
@@ -833,7 +827,6 @@ func TestCommandSide_ValidateOrgDomain(t *testing.T) {
|
||||
false,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgDomainUniqueConstraint("domain.ch")),
|
||||
uniqueConstraintsFromEventConstraint(user.NewRemoveUsernameUniqueConstraint("[email protected]", "org2", false)),
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("[email protected]", "org2", false)),
|
||||
@@ -1034,7 +1027,6 @@ func TestCommandSide_SetPrimaryDomain(t *testing.T) {
|
||||
"domain.ch",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1228,7 +1220,6 @@ func TestCommandSide_RemoveOrgDomain(t *testing.T) {
|
||||
"domain.ch", false,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1279,7 +1270,6 @@ func TestCommandSide_RemoveOrgDomain(t *testing.T) {
|
||||
"domain.ch", true,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewRemoveOrgDomainUniqueConstraint("domain.ch")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -175,7 +175,6 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) {
|
||||
newFeaturesSetEvent(context.Background(), "org1", "Test", domain.FeaturesStateActive, time.Hour),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
iamDomain: "iam-domain",
|
||||
@@ -309,7 +308,6 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) {
|
||||
newFeaturesSetEvent(context.Background(), "org1", "Test", domain.FeaturesStateActive, time.Hour),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewRemoveOrgDomainUniqueConstraint("test1")),
|
||||
),
|
||||
),
|
||||
@@ -454,7 +452,6 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) {
|
||||
newFeaturesSetEvent(context.Background(), "org1", "Test", domain.FeaturesStateActive, time.Hour),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewRemoveOrgDomainUniqueConstraint("test1")),
|
||||
),
|
||||
),
|
||||
@@ -609,7 +606,6 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) {
|
||||
newFeaturesSetEvent(context.Background(), "org1", "Test", domain.FeaturesStateActive, time.Hour),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewRemoveOrgDomainUniqueConstraint("test1")),
|
||||
),
|
||||
),
|
||||
@@ -806,7 +802,6 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) {
|
||||
newFeaturesSetEvent(context.Background(), "org1", "Test", domain.FeaturesStateActive, time.Hour),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
iamDomain: "iam-domain",
|
||||
@@ -989,7 +984,6 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) {
|
||||
org.NewFeaturesRemovedEvent(context.Background(), &org.NewAggregate("org1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
iamDomain: "iam-domain",
|
||||
|
||||
@@ -116,7 +116,6 @@ func TestCommandSide_AddIDPConfig(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name1", "org1")),
|
||||
),
|
||||
),
|
||||
@@ -283,7 +282,6 @@ func TestCommandSide_ChangeIDPConfig(t *testing.T) {
|
||||
newIDPConfigChangedEvent(context.Background(), "org1", "config1", "name1", "name2", domain.IDPConfigStylingTypeUnspecified),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(idpconfig.NewRemoveIDPConfigNameUniqueConstraint("name1", "org1")),
|
||||
uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name2", "org1")),
|
||||
),
|
||||
|
||||
@@ -249,7 +249,6 @@ func TestCommandSide_ChangeIDPOIDCConfig(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretCrypto: crypto.CreateMockEncryptionAlg(gomock.NewController(t)),
|
||||
|
||||
@@ -196,7 +196,6 @@ func TestCommandSide_AddOrgMember(t *testing.T) {
|
||||
[]string{"ORG_OWNER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("org1", "user1")),
|
||||
),
|
||||
),
|
||||
@@ -250,7 +249,6 @@ func TestCommandSide_AddOrgMember(t *testing.T) {
|
||||
[]string{"ORG_OWNER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("org1", "user1")),
|
||||
),
|
||||
),
|
||||
@@ -445,7 +443,6 @@ func TestCommandSide_ChangeOrgMember(t *testing.T) {
|
||||
[]string{"ORG_OWNER", "ORG_OWNER_VIEWER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
zitadelRoles: []authz.RoleMapping{
|
||||
@@ -592,7 +589,6 @@ func TestCommandSide_RemoveOrgMember(t *testing.T) {
|
||||
"user1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint("project1", "user1")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -118,7 +118,6 @@ func TestCommandSide_AddLabelPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -290,7 +289,6 @@ func TestCommandSide_ChangeLabelPolicy(t *testing.T) {
|
||||
newLabelPolicyChangedEvent(context.Background(), "org1", "primary-color-change", "secondary-color-change", false),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -404,7 +402,6 @@ func TestCommandSide_RemoveLabelPolicy(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -158,7 +158,6 @@ func TestCommandSide_AddLoginPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
tokenVerifier: GetMockVerifier(t, domain.FeatureLoginPolicyUsernameLogin),
|
||||
@@ -402,7 +401,6 @@ func TestCommandSide_ChangeLoginPolicy(t *testing.T) {
|
||||
newLoginPolicyChangedEvent(context.Background(), "org1", false, false, false, false, domain.PasswordlessTypeNotAllowed),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
tokenVerifier: GetMockVerifier(t, domain.FeatureLoginPolicyUsernameLogin),
|
||||
@@ -525,7 +523,6 @@ func TestCommandSide_RemoveLoginPolicy(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -710,7 +707,6 @@ func TestCommandSide_AddIDPProviderLoginPolicy(t *testing.T) {
|
||||
domain.IdentityProviderTypeOrg),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -905,7 +901,6 @@ func TestCommandSide_RemoveIDPProviderLoginPolicy(t *testing.T) {
|
||||
"config1"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -956,7 +951,6 @@ func TestCommandSide_RemoveIDPProviderLoginPolicy(t *testing.T) {
|
||||
"config1"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1026,7 +1020,6 @@ func TestCommandSide_RemoveIDPProviderLoginPolicy(t *testing.T) {
|
||||
&user.NewAggregate("user1", "org1").Aggregate,
|
||||
"config1", "externaluser1")),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewRemoveExternalIDPUniqueConstraint("config1", "externaluser1")),
|
||||
),
|
||||
),
|
||||
@@ -1160,7 +1153,6 @@ func TestCommandSide_AddSecondFactorLoginPolicy(t *testing.T) {
|
||||
domain.SecondFactorTypeOTP),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1310,7 +1302,6 @@ func TestCommandSide_RemoveSecondFactoroginPolicy(t *testing.T) {
|
||||
domain.SecondFactorTypeOTP),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1429,7 +1420,6 @@ func TestCommandSide_AddMultiFactorLoginPolicy(t *testing.T) {
|
||||
domain.MultiFactorTypeU2FWithPIN),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1579,7 +1569,6 @@ func TestCommandSide_RemoveMultiFactorLoginPolicy(t *testing.T) {
|
||||
domain.MultiFactorTypeU2FWithPIN),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -92,7 +92,6 @@ func TestCommandSide_AddMailTemplate(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -233,7 +232,6 @@ func TestCommandSide_ChangeMailTemplate(t *testing.T) {
|
||||
newMailTemplateChangedEvent(context.Background(), "org1", "template2"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -342,7 +340,6 @@ func TestCommandSide_RemoveMailTemplate(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -160,7 +160,6 @@ func TestCommandSide_AddMailText(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(policy.NewAddMailTextUniqueConstraint("org1", "mail-text-type", "de")),
|
||||
),
|
||||
),
|
||||
@@ -377,7 +376,6 @@ func TestCommandSide_ChangeMailText(t *testing.T) {
|
||||
"button-text-change"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -514,7 +512,6 @@ func TestCommandSide_RemoveMailText(t *testing.T) {
|
||||
"de"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(policy.NewRemoveMailTextUniqueConstraint("org1", "mail-text-type", "de")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -92,7 +92,6 @@ func TestCommandSide_AddOrgIAMPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -233,7 +232,6 @@ func TestCommandSide_ChangeOrgIAMPolicy(t *testing.T) {
|
||||
newOrgIAMPolicyChangedEvent(context.Background(), "org1", false),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -342,7 +340,6 @@ func TestCommandSide_RemoveOrgIAMPolicy(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -96,7 +96,6 @@ func TestCommandSide_AddPasswordAgePolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -244,7 +243,6 @@ func TestCommandSide_ChangePasswordAgePolicy(t *testing.T) {
|
||||
newPasswordAgePolicyChangedEvent(context.Background(), "org1", 150, 5),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -356,7 +354,6 @@ func TestCommandSide_RemovePasswordAgePolicy(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -102,7 +102,6 @@ func TestCommandSide_AddPasswordComplexityPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -265,7 +264,6 @@ func TestCommandSide_ChangePasswordComplexityPolicy(t *testing.T) {
|
||||
newPasswordComplexityPolicyChangedEvent(context.Background(), "org1", 10, false, false, false, false),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -383,7 +381,6 @@ func TestCommandSide_RemovePasswordComplexityPolicy(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -96,7 +96,6 @@ func TestCommandSide_AddPasswordLockoutPolicy(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -244,7 +243,6 @@ func TestCommandSide_ChangePasswordLockoutPolicy(t *testing.T) {
|
||||
newPasswordLockoutPolicyChangedEvent(context.Background(), "org1", 5, false),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -356,7 +354,6 @@ func TestCommandSide_RemovePasswordLockoutPolicy(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -148,7 +148,6 @@ func TestCommandSide_AddOrg(t *testing.T) {
|
||||
&org.NewAggregate("org2", "org2").Aggregate,
|
||||
"user1", domain.RoleOrgOwner)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgNameUniqueConstraint("Org")),
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgDomainUniqueConstraint("org.iam-domain")),
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("org2", "user1")),
|
||||
@@ -218,7 +217,6 @@ func TestCommandSide_AddOrg(t *testing.T) {
|
||||
&org.NewAggregate("org2", "org2").Aggregate,
|
||||
"user1", domain.RoleOrgOwner)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgNameUniqueConstraint("Org")),
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgDomainUniqueConstraint("org.iam-domain")),
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("org2", "user1")),
|
||||
@@ -288,7 +286,6 @@ func TestCommandSide_AddOrg(t *testing.T) {
|
||||
domain.RoleOrgOwner,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgNameUniqueConstraint("Org")),
|
||||
uniqueConstraintsFromEventConstraint(org.NewAddOrgDomainUniqueConstraint("org.iam-domain")),
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("org2", "user1")),
|
||||
@@ -423,7 +420,6 @@ func TestCommandSide_DeactivateOrg(t *testing.T) {
|
||||
eventFromEventPusher(org.NewOrgDeactivatedEvent(context.Background(),
|
||||
&org.NewAggregate("org1", "org1").Aggregate)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -453,7 +449,6 @@ func TestCommandSide_DeactivateOrg(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -562,7 +557,6 @@ func TestCommandSide_ReactivateOrg(t *testing.T) {
|
||||
&org.NewAggregate("org1", "org1").Aggregate,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -595,7 +589,6 @@ func TestCommandSide_ReactivateOrg(t *testing.T) {
|
||||
eventFromEventPusher(org.NewOrgReactivatedEvent(context.Background(),
|
||||
&org.NewAggregate("org1", "org1").Aggregate)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -139,7 +139,6 @@ func TestCommandSide_AddAPIApplication(t *testing.T) {
|
||||
domain.APIAuthMethodTypeBasic),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddApplicationUniqueConstraint("app", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -202,7 +201,6 @@ func TestCommandSide_AddAPIApplication(t *testing.T) {
|
||||
domain.APIAuthMethodTypePrivateKeyJWT),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddApplicationUniqueConstraint("app", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -420,7 +418,6 @@ func TestCommandSide_ChangeAPIApplication(t *testing.T) {
|
||||
domain.APIAuthMethodTypePrivateKeyJWT),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -583,7 +580,6 @@ func TestCommandSide_ChangeAPIApplicationSecret(t *testing.T) {
|
||||
}),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
|
||||
@@ -154,7 +154,6 @@ func TestCommandSide_AddOIDCApplication(t *testing.T) {
|
||||
time.Second*1),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddApplicationUniqueConstraint("app", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -464,7 +463,6 @@ func TestCommandSide_ChangeOIDCApplication(t *testing.T) {
|
||||
"org1"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -664,7 +662,6 @@ func TestCommandSide_ChangeOIDCApplicationSecret(t *testing.T) {
|
||||
}),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
|
||||
@@ -159,7 +159,6 @@ func TestCommandSide_ChangeApplication(t *testing.T) {
|
||||
"app changed",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveApplicationUniqueConstraint("app", "project1")),
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddApplicationUniqueConstraint("app changed", "project1")),
|
||||
),
|
||||
@@ -319,7 +318,6 @@ func TestCommandSide_DeactivateApplication(t *testing.T) {
|
||||
"app1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -474,7 +472,6 @@ func TestCommandSide_ReactivateApplication(t *testing.T) {
|
||||
"app1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -602,7 +599,6 @@ func TestCommandSide_RemoveApplication(t *testing.T) {
|
||||
"app",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveApplicationUniqueConstraint("app", "project1")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -186,7 +186,6 @@ func TestCommandSide_AddProjectGrantMember(t *testing.T) {
|
||||
[]string{"PROJECT_GRANT_OWNER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectGrantMemberUniqueConstraint("project1", "user1", "projectgrant1")),
|
||||
),
|
||||
),
|
||||
@@ -242,7 +241,6 @@ func TestCommandSide_AddProjectGrantMember(t *testing.T) {
|
||||
[]string{"PROJECT_GRANT_OWNER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectGrantMemberUniqueConstraint("project1", "user1", "projectgrant1")),
|
||||
),
|
||||
),
|
||||
@@ -444,7 +442,6 @@ func TestCommandSide_ChangeProjectGrantMember(t *testing.T) {
|
||||
[]string{"PROJECT_GRANT_OWNER", "PROJECT_GRANT_VIEWER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
zitadelRoles: []authz.RoleMapping{
|
||||
@@ -612,7 +609,6 @@ func TestCommandSide_RemoveProjectGrantMember(t *testing.T) {
|
||||
"projectgrant1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectGrantMemberUniqueConstraint("project1", "user1", "projectgrant1")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -179,7 +179,6 @@ func TestCommandSide_AddProjectGrant(t *testing.T) {
|
||||
[]string{"key1"},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectGrantUniqueConstraint("grantedorg1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -512,7 +511,6 @@ func TestCommandSide_ChangeProjectGrant(t *testing.T) {
|
||||
[]string{"key1", "key2"},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -593,7 +591,6 @@ func TestCommandSide_ChangeProjectGrant(t *testing.T) {
|
||||
[]string{"key1"},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -688,7 +685,6 @@ func TestCommandSide_ChangeProjectGrant(t *testing.T) {
|
||||
[]string{"key1"},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -899,7 +895,6 @@ func TestCommandSide_DeactivateProjectGrant(t *testing.T) {
|
||||
"projectgrant1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1096,7 +1091,6 @@ func TestCommandSide_ReactivateProjectGrant(t *testing.T) {
|
||||
"projectgrant1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1258,7 +1252,6 @@ func TestCommandSide_RemoveProjectGrant(t *testing.T) {
|
||||
"grantedorg1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectGrantUniqueConstraint("grantedorg1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -1305,7 +1298,6 @@ func TestCommandSide_RemoveProjectGrant(t *testing.T) {
|
||||
"grantedorg1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectGrantUniqueConstraint("grantedorg1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -1365,7 +1357,6 @@ func TestCommandSide_RemoveProjectGrant(t *testing.T) {
|
||||
"projectgrant1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectGrantUniqueConstraint("grantedorg1", "project1")),
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewRemoveUserGrantUniqueConstraint("org1", "user1", "project1", "projectgrant1")),
|
||||
),
|
||||
|
||||
@@ -187,7 +187,6 @@ func TestCommandSide_AddProjectMember(t *testing.T) {
|
||||
[]string{"PROJECT_OWNER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("project1", "user1")),
|
||||
),
|
||||
),
|
||||
@@ -242,7 +241,6 @@ func TestCommandSide_AddProjectMember(t *testing.T) {
|
||||
[]string{"PROJECT_OWNER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("project1", "user1")),
|
||||
),
|
||||
),
|
||||
@@ -443,7 +441,6 @@ func TestCommandSide_ChangeProjectMember(t *testing.T) {
|
||||
[]string{"PROJECT_OWNER", "PROJECT_VIEWER"}...,
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
zitadelRoles: []authz.RoleMapping{
|
||||
@@ -591,7 +588,6 @@ func TestCommandSide_RemoveProjectMember(t *testing.T) {
|
||||
"user1",
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint("project1", "user1")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -119,7 +119,6 @@ func TestCommandSide_AddProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectRoleUniqueConstraint("key1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -164,7 +163,6 @@ func TestCommandSide_AddProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectRoleUniqueConstraint("key1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -334,7 +332,6 @@ func TestCommandSide_BulkAddProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectRoleUniqueConstraint("key1", "project1")),
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectRoleUniqueConstraint("key2", "project1")),
|
||||
),
|
||||
@@ -393,7 +390,6 @@ func TestCommandSide_BulkAddProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectRoleUniqueConstraint("key1", "project1")),
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectRoleUniqueConstraint("key2", "project1")),
|
||||
),
|
||||
@@ -633,7 +629,6 @@ func TestCommandSide_ChangeProjectRole(t *testing.T) {
|
||||
newRoleChangedEvent(context.Background(), "project1", "org1", "key1", "keychanged", "groupchanged"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -811,7 +806,6 @@ func TestCommandSide_RemoveProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectRoleUniqueConstraint("key1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -853,7 +847,6 @@ func TestCommandSide_RemoveProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectRoleUniqueConstraint("key1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -912,7 +905,6 @@ func TestCommandSide_RemoveProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectRoleUniqueConstraint("key1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -955,7 +947,6 @@ func TestCommandSide_RemoveProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectRoleUniqueConstraint("key1", "project1")),
|
||||
),
|
||||
),
|
||||
@@ -1012,7 +1003,6 @@ func TestCommandSide_RemoveProjectRole(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectRoleUniqueConstraint("key1", "project1")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -82,7 +82,6 @@ func TestCommandSide_AddProject(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectNameUniqueConstraint("project", "org1")),
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("project1", "user1")),
|
||||
),
|
||||
@@ -130,7 +129,6 @@ func TestCommandSide_AddProject(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectNameUniqueConstraint("project", "globalorg")),
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("project1", "user1")),
|
||||
),
|
||||
@@ -184,7 +182,6 @@ func TestCommandSide_AddProject(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectNameUniqueConstraint("project", "org1")),
|
||||
uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("project1", "user1")),
|
||||
),
|
||||
@@ -394,7 +391,6 @@ func TestCommandSide_ChangeProject(t *testing.T) {
|
||||
true),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectNameUniqueConstraint("project", "org1")),
|
||||
uniqueConstraintsFromEventConstraint(project.NewAddProjectNameUniqueConstraint("project-new", "org1")),
|
||||
),
|
||||
@@ -448,7 +444,6 @@ func TestCommandSide_ChangeProject(t *testing.T) {
|
||||
true),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -638,7 +633,6 @@ func TestCommandSide_DeactivateProject(t *testing.T) {
|
||||
&project.NewAggregate("project1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -815,7 +809,6 @@ func TestCommandSide_ReactivateProject(t *testing.T) {
|
||||
&project.NewAggregate("project1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -966,7 +959,6 @@ func TestCommandSide_RemoveProject(t *testing.T) {
|
||||
"project"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(project.NewRemoveProjectNameUniqueConstraint("project", "org1")),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -353,7 +353,6 @@ func TestCommandSide_AddUserGrant(t *testing.T) {
|
||||
[]string{"rolekey1"},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewAddUserGrantUniqueConstraint("org1", "user1", "project1", "")),
|
||||
),
|
||||
),
|
||||
@@ -434,7 +433,6 @@ func TestCommandSide_AddUserGrant(t *testing.T) {
|
||||
[]string{"rolekey1"},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewAddUserGrantUniqueConstraint("org1", "user1", "project1", "projectgrant1")),
|
||||
),
|
||||
),
|
||||
@@ -973,7 +971,6 @@ func TestCommandSide_ChangeUserGrant(t *testing.T) {
|
||||
[]string{"rolekey1", "rolekey2"},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1069,7 +1066,6 @@ func TestCommandSide_ChangeUserGrant(t *testing.T) {
|
||||
[]string{"rolekey1", "rolekey2"},
|
||||
)),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1294,7 +1290,6 @@ func TestCommandSide_DeactivateUserGrant(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1507,7 +1502,6 @@ func TestCommandSide_ReactivateUserGrant(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1679,7 +1673,6 @@ func TestCommandSide_RemoveUserGrant(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewRemoveUserGrantUniqueConstraint("org1", "user1", "project1", "")),
|
||||
),
|
||||
),
|
||||
@@ -1720,7 +1713,6 @@ func TestCommandSide_RemoveUserGrant(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewRemoveUserGrantUniqueConstraint("org1", "user1", "project1", "projectgrant1")),
|
||||
),
|
||||
),
|
||||
@@ -1906,7 +1898,6 @@ func TestCommandSide_BulkRemoveUserGrant(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewRemoveUserGrantUniqueConstraint("org1", "user1", "project1", "")),
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewRemoveUserGrantUniqueConstraint("org1", "user2", "project2", "")),
|
||||
),
|
||||
@@ -1961,7 +1952,6 @@ func TestCommandSide_BulkRemoveUserGrant(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewRemoveUserGrantUniqueConstraint("org1", "user1", "project1", "projectgrant1")),
|
||||
uniqueConstraintsFromEventConstraint(usergrant.NewRemoveUserGrantUniqueConstraint("org1", "user2", "project2", "projectgrant2")),
|
||||
),
|
||||
|
||||
@@ -143,7 +143,6 @@ func TestCommandSide_ChangeHumanAddress(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -194,7 +194,6 @@ func TestCommandSide_ChangeHumanEmail(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -262,7 +261,6 @@ func TestCommandSide_ChangeHumanEmail(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -453,7 +451,6 @@ func TestCommandSide_VerifyHumanEmail(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -509,7 +506,6 @@ func TestCommandSide_VerifyHumanEmail(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -721,7 +717,6 @@ func TestCommandSide_CreateVerificationCodeHumanEmail(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -848,7 +843,6 @@ func TestCommandSide_EmailVerificationCodeSent(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -178,7 +178,6 @@ func TestCommandSide_BulkAddExternalIDPs(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddExternalIDPUniqueConstraint("config1", "externaluser1")),
|
||||
),
|
||||
),
|
||||
@@ -228,7 +227,6 @@ func TestCommandSide_BulkAddExternalIDPs(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddExternalIDPUniqueConstraint("config1", "externaluser1")),
|
||||
),
|
||||
),
|
||||
@@ -409,7 +407,6 @@ func TestCommandSide_RemoveExternalIDP(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewRemoveExternalIDPUniqueConstraint("config1", "externaluser1")),
|
||||
),
|
||||
),
|
||||
@@ -552,7 +549,6 @@ func TestCommandSide_ExternalLoginCheck(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -148,7 +148,6 @@ func TestCommandSide_ResendInitialMail(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -207,7 +206,6 @@ func TestCommandSide_ResendInitialMail(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -269,7 +267,6 @@ func TestCommandSide_ResendInitialMail(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -454,7 +451,6 @@ func TestCommandSide_VerifyInitCode(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -515,7 +511,6 @@ func TestCommandSide_VerifyInitCode(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -599,7 +594,6 @@ func TestCommandSide_VerifyInitCode(t *testing.T) {
|
||||
false,
|
||||
"")),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -716,7 +710,6 @@ func TestCommandSide_InitCodeSent(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -304,7 +304,6 @@ func TestCommandSide_RemoveHumanOTP(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -125,7 +125,6 @@ func TestCommandSide_SetOneTimePassword(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
userPasswordAlg: crypto.CreateMockHashAlg(gomock.NewController(t)),
|
||||
@@ -385,7 +384,6 @@ func TestCommandSide_SetPassword(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -667,7 +665,6 @@ func TestCommandSide_ChangePassword(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
userPasswordAlg: crypto.CreateMockHashAlg(gomock.NewController(t)),
|
||||
@@ -853,7 +850,6 @@ func TestCommandSide_RequestSetPassword(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -975,7 +971,6 @@ func TestCommandSide_PasswordCodeSent(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1157,7 +1152,6 @@ func TestCommandSide_CheckPassword(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
userPasswordAlg: crypto.CreateMockHashAlg(gomock.NewController(t)),
|
||||
@@ -1225,7 +1219,6 @@ func TestCommandSide_CheckPassword(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
userPasswordAlg: crypto.CreateMockHashAlg(gomock.NewController(t)),
|
||||
|
||||
@@ -163,7 +163,6 @@ func TestCommandSide_ChangeHumanPhone(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -231,7 +230,6 @@ func TestCommandSide_ChangeHumanPhone(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -428,7 +426,6 @@ func TestCommandSide_VerifyHumanPhone(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -490,7 +487,6 @@ func TestCommandSide_VerifyHumanPhone(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -665,7 +661,6 @@ func TestCommandSide_CreateVerificationCodeHumanPhone(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
secretGenerator: GetMockSecretGenerator(t),
|
||||
@@ -787,7 +782,6 @@ func TestCommandSide_PhoneVerificationCodeSent(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -933,7 +927,6 @@ func TestCommandSide_RemoveHumanPhone(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -138,7 +138,6 @@ func TestCommandSide_ChangeHumanProfile(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -225,7 +225,6 @@ func TestCommandSide_AddHuman(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -309,7 +308,6 @@ func TestCommandSide_AddHuman(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -389,7 +387,6 @@ func TestCommandSide_AddHuman(t *testing.T) {
|
||||
&user.NewAggregate("user1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -489,7 +486,6 @@ func TestCommandSide_AddHuman(t *testing.T) {
|
||||
},
|
||||
time.Hour*1)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -583,7 +579,6 @@ func TestCommandSide_AddHuman(t *testing.T) {
|
||||
&user.NewAggregate("user1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -848,7 +843,6 @@ func TestCommandSide_ImportHuman(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -929,7 +923,6 @@ func TestCommandSide_ImportHuman(t *testing.T) {
|
||||
&user.NewAggregate("user1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -1030,7 +1023,6 @@ func TestCommandSide_ImportHuman(t *testing.T) {
|
||||
},
|
||||
time.Hour*1)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -1129,7 +1121,6 @@ func TestCommandSide_ImportHuman(t *testing.T) {
|
||||
&user.NewAggregate("user1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -1390,7 +1381,6 @@ func TestCommandSide_RegisterHuman(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -1470,7 +1460,6 @@ func TestCommandSide_RegisterHuman(t *testing.T) {
|
||||
&user.NewAggregate("user1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -1570,7 +1559,6 @@ func TestCommandSide_RegisterHuman(t *testing.T) {
|
||||
},
|
||||
time.Hour*1)),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -1668,7 +1656,6 @@ func TestCommandSide_RegisterHuman(t *testing.T) {
|
||||
&user.NewAggregate("user1", "org1").Aggregate),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -1827,7 +1814,6 @@ func TestCommandSide_HumanMFASkip(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1957,7 +1943,6 @@ func TestCommandSide_HumanSignOut(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -2024,7 +2009,6 @@ func TestCommandSide_HumanSignOut(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -128,7 +128,6 @@ func TestCommandSide_AddMachine(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -292,7 +291,6 @@ func TestCommandSide_ChangeMachine(t *testing.T) {
|
||||
newMachineChangedEvent(context.Background(), "user1", "org1", "name1", "description1"),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
@@ -257,7 +257,6 @@ func TestCommandSide_UsernameChange(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewRemoveUsernameUniqueConstraint("username", "org1", true)),
|
||||
uniqueConstraintsFromEventConstraint(user.NewAddUsernameUniqueConstraint("username1", "org1", true)),
|
||||
),
|
||||
@@ -415,7 +414,6 @@ func TestCommandSide_DeactivateUser(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -569,7 +567,6 @@ func TestCommandSide_ReactivateUser(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -724,7 +721,6 @@ func TestCommandSide_LockUser(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -878,7 +874,6 @@ func TestCommandSide_UnlockUser(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -1041,7 +1036,6 @@ func TestCommandSide_RemoveUser(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
uniqueConstraintsFromEventConstraint(user.NewRemoveUsernameUniqueConstraint("username", "org1", true)),
|
||||
),
|
||||
),
|
||||
@@ -1237,7 +1231,6 @@ func TestCommandSide_UserDomainClaimedSent(t *testing.T) {
|
||||
),
|
||||
),
|
||||
},
|
||||
nil,
|
||||
),
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user