mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: wrong Attributes
This commit is contained in:
parent
7f26f1815b
commit
6532072288
@ -135,62 +135,62 @@ func readModelToMember(readModel *member.ReadModel) *model.IAMMember {
|
|||||||
|
|
||||||
func writeModelToMember(writeModel *iam.MemberWriteModel) *model.IAMMember {
|
func writeModelToMember(writeModel *iam.MemberWriteModel) *model.IAMMember {
|
||||||
return &model.IAMMember{
|
return &model.IAMMember{
|
||||||
ObjectRoot: writeModelToObjectRoot(writeModel.Member.WriteModel),
|
ObjectRoot: writeModelToObjectRoot(writeModel.WriteModel.WriteModel),
|
||||||
Roles: writeModel.Member.Roles,
|
Roles: writeModel.Roles,
|
||||||
UserID: writeModel.Member.UserID,
|
UserID: writeModel.UserID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeModelToLoginPolicy(wm *login.WriteModel) *model.LoginPolicy {
|
func writeModelToLoginPolicy(wm *login.WriteModel) *model.LoginPolicy {
|
||||||
return &model.LoginPolicy{
|
return &model.LoginPolicy{
|
||||||
ObjectRoot: writeModelToObjectRoot(wm.Policy.WriteModel),
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel.WriteModel),
|
||||||
AllowUsernamePassword: wm.Policy.AllowUserNamePassword,
|
AllowUsernamePassword: wm.AllowUserNamePassword,
|
||||||
AllowRegister: wm.Policy.AllowRegister,
|
AllowRegister: wm.AllowRegister,
|
||||||
AllowExternalIdp: wm.Policy.AllowExternalIDP,
|
AllowExternalIdp: wm.AllowExternalIDP,
|
||||||
ForceMFA: wm.Policy.ForceMFA,
|
ForceMFA: wm.ForceMFA,
|
||||||
PasswordlessType: model.PasswordlessType(wm.Policy.PasswordlessType),
|
PasswordlessType: model.PasswordlessType(wm.PasswordlessType),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeModelToLabelPolicy(wm *label.WriteModel) *model.LabelPolicy {
|
func writeModelToLabelPolicy(wm *label.WriteModel) *model.LabelPolicy {
|
||||||
return &model.LabelPolicy{
|
return &model.LabelPolicy{
|
||||||
ObjectRoot: writeModelToObjectRoot(wm.Policy.WriteModel),
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel.WriteModel),
|
||||||
PrimaryColor: wm.Policy.PrimaryColor,
|
PrimaryColor: wm.PrimaryColor,
|
||||||
SecondaryColor: wm.Policy.SecondaryColor,
|
SecondaryColor: wm.SecondaryColor,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeModelToOrgIAMPolicy(wm *org_iam.WriteModel) *model.OrgIAMPolicy {
|
func writeModelToOrgIAMPolicy(wm *org_iam.WriteModel) *model.OrgIAMPolicy {
|
||||||
return &model.OrgIAMPolicy{
|
return &model.OrgIAMPolicy{
|
||||||
ObjectRoot: writeModelToObjectRoot(wm.Policy.WriteModel),
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel.WriteModel),
|
||||||
UserLoginMustBeDomain: wm.Policy.UserLoginMustBeDomain,
|
UserLoginMustBeDomain: wm.UserLoginMustBeDomain,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeModelToPasswordAgePolicy(wm *password_age.WriteModel) *model.PasswordAgePolicy {
|
func writeModelToPasswordAgePolicy(wm *password_age.WriteModel) *model.PasswordAgePolicy {
|
||||||
return &model.PasswordAgePolicy{
|
return &model.PasswordAgePolicy{
|
||||||
ObjectRoot: writeModelToObjectRoot(wm.Policy.WriteModel),
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel.WriteModel),
|
||||||
MaxAgeDays: wm.Policy.MaxAgeDays,
|
MaxAgeDays: wm.MaxAgeDays,
|
||||||
ExpireWarnDays: wm.Policy.ExpireWarnDays,
|
ExpireWarnDays: wm.ExpireWarnDays,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeModelToPasswordComplexityPolicy(wm *password_complexity.WriteModel) *model.PasswordComplexityPolicy {
|
func writeModelToPasswordComplexityPolicy(wm *password_complexity.WriteModel) *model.PasswordComplexityPolicy {
|
||||||
return &model.PasswordComplexityPolicy{
|
return &model.PasswordComplexityPolicy{
|
||||||
ObjectRoot: writeModelToObjectRoot(wm.Policy.WriteModel),
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel.WriteModel),
|
||||||
MinLength: wm.Policy.MinLength,
|
MinLength: wm.MinLength,
|
||||||
HasLowercase: wm.Policy.HasLowercase,
|
HasLowercase: wm.HasLowercase,
|
||||||
HasUppercase: wm.Policy.HasUpperCase,
|
HasUppercase: wm.HasUpperCase,
|
||||||
HasNumber: wm.Policy.HasNumber,
|
HasNumber: wm.HasNumber,
|
||||||
HasSymbol: wm.Policy.HasSymbol,
|
HasSymbol: wm.HasSymbol,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeModelToPasswordLockoutPolicy(wm *password_lockout.WriteModel) *model.PasswordLockoutPolicy {
|
func writeModelToPasswordLockoutPolicy(wm *password_lockout.WriteModel) *model.PasswordLockoutPolicy {
|
||||||
return &model.PasswordLockoutPolicy{
|
return &model.PasswordLockoutPolicy{
|
||||||
ObjectRoot: writeModelToObjectRoot(wm.Policy.WriteModel),
|
ObjectRoot: writeModelToObjectRoot(wm.WriteModel.WriteModel),
|
||||||
MaxAttempts: wm.Policy.MaxAttempts,
|
MaxAttempts: wm.MaxAttempts,
|
||||||
ShowLockOutFailures: wm.Policy.ShowLockOutFailures,
|
ShowLockOutFailures: wm.ShowLockOutFailures,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,11 +22,11 @@ func (r *Repository) AddMember(ctx context.Context, member *iam_model.IAMMember)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if addedMember.Member.IsActive {
|
if addedMember.IsActive {
|
||||||
return nil, errors.ThrowAlreadyExists(nil, "IAM-PtXi1", "Errors.IAM.Member.AlreadyExists")
|
return nil, errors.ThrowAlreadyExists(nil, "IAM-PtXi1", "Errors.IAM.Member.AlreadyExists")
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&addedMember.Member.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&addedMember.WriteModel.WriteModel).
|
||||||
PushMemberAdded(ctx, member.UserID, member.Roles...)
|
PushMemberAdded(ctx, member.UserID, member.Roles...)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, addedMember, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, addedMember, iamAgg)
|
||||||
@ -50,7 +50,7 @@ func (r *Repository) ChangeMember(ctx context.Context, member *iam_model.IAMMemb
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
iam := iam_repo.AggregateFromWriteModel(&existingMember.Member.WriteModel).
|
iam := iam_repo.AggregateFromWriteModel(&existingMember.WriteModel.WriteModel).
|
||||||
PushMemberChangedFromExisting(ctx, existingMember, member.Roles...)
|
PushMemberChangedFromExisting(ctx, existingMember, member.Roles...)
|
||||||
|
|
||||||
events, err := r.eventstore.PushAggregates(ctx, iam)
|
events, err := r.eventstore.PushAggregates(ctx, iam)
|
||||||
@ -75,7 +75,7 @@ func (r *Repository) RemoveMember(ctx context.Context, member *iam_model.IAMMemb
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&m.Member.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&m.WriteModel.WriteModel).
|
||||||
PushEvents(iam_repo.NewMemberRemovedEvent(ctx, member.UserID))
|
PushEvents(iam_repo.NewMemberRemovedEvent(ctx, member.UserID))
|
||||||
|
|
||||||
return r.eventstore.PushAggregate(ctx, m, iamAgg)
|
return r.eventstore.PushAggregate(ctx, m, iamAgg)
|
||||||
@ -104,7 +104,7 @@ func (r *Repository) memberWriteModelByID(ctx context.Context, iamID, userID str
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !writeModel.Member.IsActive {
|
if !writeModel.IsActive {
|
||||||
return nil, errors.ThrowNotFound(nil, "IAM-D8JxR", "Errors.NotFound")
|
return nil, errors.ThrowNotFound(nil, "IAM-D8JxR", "Errors.NotFound")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ func (r *Repository) AddOrgIAMPolicy(ctx context.Context, policy *iam_model.OrgI
|
|||||||
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-Lk0dS", "Errors.IAM.OrgIAMPolicy.AlreadyExists")
|
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-Lk0dS", "Errors.IAM.OrgIAMPolicy.AlreadyExists")
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.WriteModel.WriteModel).
|
||||||
PushOrgIAMPolicyAddedEvent(ctx, policy.UserLoginMustBeDomain)
|
PushOrgIAMPolicyAddedEvent(ctx, policy.UserLoginMustBeDomain)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
||||||
@ -36,7 +36,7 @@ func (r *Repository) ChangeOrgIAMPolicy(ctx context.Context, policy *iam_model.O
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.WriteModel.WriteModel).
|
||||||
PushOrgIAMPolicyChangedFromExisting(ctx, existingPolicy, policy.UserLoginMustBeDomain)
|
PushOrgIAMPolicyChangedFromExisting(ctx, existingPolicy, policy.UserLoginMustBeDomain)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
||||||
|
@ -24,7 +24,7 @@ func (r *Repository) AddLabelPolicy(ctx context.Context, policy *iam_model.Label
|
|||||||
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-2B0ps", "Errors.IAM.LabelPolicy.AlreadyExists")
|
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-2B0ps", "Errors.IAM.LabelPolicy.AlreadyExists")
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.WriteModel.WriteModel).
|
||||||
PushLabelPolicyAddedEvent(ctx, policy.PrimaryColor, policy.SecondaryColor)
|
PushLabelPolicyAddedEvent(ctx, policy.PrimaryColor, policy.SecondaryColor)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
||||||
@ -45,7 +45,7 @@ func (r *Repository) ChangeLabelPolicy(ctx context.Context, policy *iam_model.La
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.WriteModel.WriteModel).
|
||||||
PushLabelPolicyChangedFromExisting(ctx, existingPolicy, policy.PrimaryColor, policy.SecondaryColor)
|
PushLabelPolicyChangedFromExisting(ctx, existingPolicy, policy.PrimaryColor, policy.SecondaryColor)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
||||||
|
@ -28,7 +28,7 @@ func (r *Repository) AddLoginPolicy(ctx context.Context, policy *iam_model.Login
|
|||||||
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-2B0ps", "Errors.IAM.LoginPolicy.AlreadyExists")
|
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-2B0ps", "Errors.IAM.LoginPolicy.AlreadyExists")
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.WriteModel.WriteModel).
|
||||||
PushLoginPolicyAddedEvent(ctx, policy.AllowUsernamePassword, policy.AllowRegister, policy.AllowExternalIdp, policy.ForceMFA, login.PasswordlessType(policy.PasswordlessType))
|
PushLoginPolicyAddedEvent(ctx, policy.AllowUsernamePassword, policy.AllowRegister, policy.AllowExternalIdp, policy.ForceMFA, login.PasswordlessType(policy.PasswordlessType))
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
||||||
@ -49,7 +49,7 @@ func (r *Repository) ChangeLoginPolicy(ctx context.Context, policy *iam_model.Lo
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.WriteModel.WriteModel).
|
||||||
PushLoginPolicyChangedFromExisting(ctx, existingPolicy, policy.AllowUsernamePassword, policy.AllowRegister, policy.AllowExternalIdp, policy.ForceMFA, login.PasswordlessType(policy.PasswordlessType))
|
PushLoginPolicyChangedFromExisting(ctx, existingPolicy, policy.AllowUsernamePassword, policy.AllowRegister, policy.AllowExternalIdp, policy.ForceMFA, login.PasswordlessType(policy.PasswordlessType))
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
||||||
@ -96,14 +96,14 @@ func (r *Repository) AddSecondFactorToLoginPolicy(ctx context.Context, iamID str
|
|||||||
return iam_model.SecondFactorTypeUnspecified, err
|
return iam_model.SecondFactorTypeUnspecified, err
|
||||||
}
|
}
|
||||||
|
|
||||||
aggregate := iam_repo.AggregateFromWriteModel(&writeModel.SecondFactor.WriteModel).
|
aggregate := iam_repo.AggregateFromWriteModel(&writeModel.SecondFactorWriteModel.WriteModel).
|
||||||
PushLoginPolicySecondFactorAdded(ctx, factors.SecondFactorType(secondFactor))
|
PushLoginPolicySecondFactorAdded(ctx, factors.SecondFactorType(secondFactor))
|
||||||
|
|
||||||
if err = r.eventstore.PushAggregate(ctx, writeModel, aggregate); err != nil {
|
if err = r.eventstore.PushAggregate(ctx, writeModel, aggregate); err != nil {
|
||||||
return iam_model.SecondFactorTypeUnspecified, err
|
return iam_model.SecondFactorTypeUnspecified, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return iam_model.SecondFactorType(writeModel.SecondFactor.MFAType), nil
|
return iam_model.SecondFactorType(writeModel.MFAType), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Repository) RemoveSecondFactorFromLoginPolicy(ctx context.Context, iamID string, secondFactor iam_model.SecondFactorType) error {
|
func (r *Repository) RemoveSecondFactorFromLoginPolicy(ctx context.Context, iamID string, secondFactor iam_model.SecondFactorType) error {
|
||||||
@ -112,7 +112,7 @@ func (r *Repository) RemoveSecondFactorFromLoginPolicy(ctx context.Context, iamI
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
aggregate := iam_repo.AggregateFromWriteModel(&writeModel.SecondFactor.WriteModel).
|
aggregate := iam_repo.AggregateFromWriteModel(&writeModel.SecondFactorWriteModel.WriteModel).
|
||||||
PushLoginPolicySecondFactorRemoved(ctx, factors.SecondFactorType(secondFactor))
|
PushLoginPolicySecondFactorRemoved(ctx, factors.SecondFactorType(secondFactor))
|
||||||
|
|
||||||
return r.eventstore.PushAggregate(ctx, writeModel, aggregate)
|
return r.eventstore.PushAggregate(ctx, writeModel, aggregate)
|
||||||
@ -125,14 +125,14 @@ func (r *Repository) AddMultiFactorToLoginPolicy(ctx context.Context, iamID stri
|
|||||||
return iam_model.MultiFactorTypeUnspecified, err
|
return iam_model.MultiFactorTypeUnspecified, err
|
||||||
}
|
}
|
||||||
|
|
||||||
aggregate := iam_repo.AggregateFromWriteModel(&writeModel.MultiFactor.WriteModel).
|
aggregate := iam_repo.AggregateFromWriteModel(&writeModel.MultiFactoryWriteModel.WriteModel).
|
||||||
PushLoginPolicyMultiFactorAdded(ctx, factors.MultiFactorType(secondFactor))
|
PushLoginPolicyMultiFactorAdded(ctx, factors.MultiFactorType(secondFactor))
|
||||||
|
|
||||||
if err = r.eventstore.PushAggregate(ctx, writeModel, aggregate); err != nil {
|
if err = r.eventstore.PushAggregate(ctx, writeModel, aggregate); err != nil {
|
||||||
return iam_model.MultiFactorTypeUnspecified, err
|
return iam_model.MultiFactorTypeUnspecified, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return iam_model.MultiFactorType(writeModel.MultiFactor.MFAType), nil
|
return iam_model.MultiFactorType(writeModel.MultiFactoryWriteModel.MFAType), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Repository) RemoveMultiFactorFromLoginPolicy(ctx context.Context, iamID string, secondFactor iam_model.MultiFactorType) error {
|
func (r *Repository) RemoveMultiFactorFromLoginPolicy(ctx context.Context, iamID string, secondFactor iam_model.MultiFactorType) error {
|
||||||
@ -141,7 +141,7 @@ func (r *Repository) RemoveMultiFactorFromLoginPolicy(ctx context.Context, iamID
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
aggregate := iam_repo.AggregateFromWriteModel(&writeModel.MultiFactor.WriteModel).
|
aggregate := iam_repo.AggregateFromWriteModel(&writeModel.MultiFactoryWriteModel.WriteModel).
|
||||||
PushLoginPolicyMultiFactorRemoved(ctx, factors.MultiFactorType(secondFactor))
|
PushLoginPolicyMultiFactorRemoved(ctx, factors.MultiFactorType(secondFactor))
|
||||||
|
|
||||||
return r.eventstore.PushAggregate(ctx, writeModel, aggregate)
|
return r.eventstore.PushAggregate(ctx, writeModel, aggregate)
|
||||||
|
@ -19,7 +19,7 @@ func (r *Repository) AddPasswordAgePolicy(ctx context.Context, policy *iam_model
|
|||||||
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-6L0pd", "Errors.IAM.PasswordAgePolicy.AlreadyExists")
|
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-6L0pd", "Errors.IAM.PasswordAgePolicy.AlreadyExists")
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.WriteModel.WriteModel).
|
||||||
PushPasswordAgePolicyAddedEvent(ctx, policy.ExpireWarnDays, policy.MaxAgeDays)
|
PushPasswordAgePolicyAddedEvent(ctx, policy.ExpireWarnDays, policy.MaxAgeDays)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
||||||
@ -36,7 +36,7 @@ func (r *Repository) ChangePasswordAgePolicy(ctx context.Context, policy *iam_mo
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.WriteModel.WriteModel).
|
||||||
PushPasswordAgePolicyChangedFromExisting(ctx, existingPolicy, policy.ExpireWarnDays, policy.MaxAgeDays)
|
PushPasswordAgePolicyChangedFromExisting(ctx, existingPolicy, policy.ExpireWarnDays, policy.MaxAgeDays)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
||||||
|
@ -23,7 +23,7 @@ func (r *Repository) AddPasswordComplexityPolicy(ctx context.Context, policy *ia
|
|||||||
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-Lk0dS", "Errors.IAM.PasswordComplexityPolicy.AlreadyExists")
|
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-Lk0dS", "Errors.IAM.PasswordComplexityPolicy.AlreadyExists")
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.WriteModel.WriteModel).
|
||||||
PushPasswordComplexityPolicyAddedEvent(ctx, policy.MinLength, policy.HasLowercase, policy.HasUppercase, policy.HasNumber, policy.HasSymbol)
|
PushPasswordComplexityPolicyAddedEvent(ctx, policy.MinLength, policy.HasLowercase, policy.HasUppercase, policy.HasNumber, policy.HasSymbol)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
||||||
@ -44,7 +44,7 @@ func (r *Repository) ChangePasswordComplexityPolicy(ctx context.Context, policy
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.WriteModel.WriteModel).
|
||||||
PushPasswordComplexityPolicyChangedFromExisting(ctx, existingPolicy, policy.MinLength, policy.HasLowercase, policy.HasUppercase, policy.HasNumber, policy.HasSymbol)
|
PushPasswordComplexityPolicyChangedFromExisting(ctx, existingPolicy, policy.MinLength, policy.HasLowercase, policy.HasUppercase, policy.HasNumber, policy.HasSymbol)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
||||||
|
@ -19,7 +19,7 @@ func (r *Repository) AddPasswordLockoutPolicy(ctx context.Context, policy *iam_m
|
|||||||
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-0olDf", "Errors.IAM.PasswordLockoutPolicy.AlreadyExists")
|
return nil, caos_errs.ThrowAlreadyExists(nil, "IAM-0olDf", "Errors.IAM.PasswordLockoutPolicy.AlreadyExists")
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&addedPolicy.WriteModel.WriteModel).
|
||||||
PushPasswordLockoutPolicyAddedEvent(ctx, policy.MaxAttempts, policy.ShowLockOutFailures)
|
PushPasswordLockoutPolicyAddedEvent(ctx, policy.MaxAttempts, policy.ShowLockOutFailures)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, addedPolicy, iamAgg)
|
||||||
@ -36,7 +36,7 @@ func (r *Repository) ChangePasswordLockoutPolicy(ctx context.Context, policy *ia
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.Policy.WriteModel).
|
iamAgg := iam_repo.AggregateFromWriteModel(&existingPolicy.WriteModel.WriteModel).
|
||||||
PushPasswordLockoutPolicyChangedFromExisting(ctx, existingPolicy, policy.MaxAttempts, policy.ShowLockOutFailures)
|
PushPasswordLockoutPolicyChangedFromExisting(ctx, existingPolicy, policy.MaxAttempts, policy.ShowLockOutFailures)
|
||||||
|
|
||||||
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
err = r.eventstore.PushAggregate(ctx, existingPolicy, iamAgg)
|
||||||
|
@ -54,7 +54,7 @@ func ChangedEventFromExisting(
|
|||||||
ctx,
|
ctx,
|
||||||
LabelPolicyChangedEventType,
|
LabelPolicyChangedEventType,
|
||||||
),
|
),
|
||||||
¤t.Policy,
|
¤t.WriteModel,
|
||||||
primaryColor,
|
primaryColor,
|
||||||
secondaryColor,
|
secondaryColor,
|
||||||
)
|
)
|
||||||
|
@ -67,7 +67,7 @@ func ChangedEventFromExisting(
|
|||||||
ctx,
|
ctx,
|
||||||
LoginPolicyChangedEventType,
|
LoginPolicyChangedEventType,
|
||||||
),
|
),
|
||||||
¤t.Policy,
|
¤t.WriteModel,
|
||||||
allowUsernamePassword,
|
allowUsernamePassword,
|
||||||
allowRegister,
|
allowRegister,
|
||||||
allowExternalIDP,
|
allowExternalIDP,
|
||||||
|
@ -52,7 +52,7 @@ func ChangedEventFromExisting(
|
|||||||
ctx,
|
ctx,
|
||||||
OrgIAMPolicyChangedEventType,
|
OrgIAMPolicyChangedEventType,
|
||||||
),
|
),
|
||||||
¤t.Policy,
|
¤t.WriteModel,
|
||||||
userLoginMustBeDomain,
|
userLoginMustBeDomain,
|
||||||
)
|
)
|
||||||
return &ChangedEvent{
|
return &ChangedEvent{
|
||||||
|
@ -54,7 +54,7 @@ func ChangedEventFromExisting(
|
|||||||
ctx,
|
ctx,
|
||||||
PasswordAgePolicyChangedEventType,
|
PasswordAgePolicyChangedEventType,
|
||||||
),
|
),
|
||||||
¤t.Policy,
|
¤t.WriteModel,
|
||||||
expireWarnDays,
|
expireWarnDays,
|
||||||
maxAgeDays,
|
maxAgeDays,
|
||||||
)
|
)
|
||||||
|
@ -63,7 +63,7 @@ func ChangedEventFromExisting(
|
|||||||
ctx,
|
ctx,
|
||||||
PasswordComplexityPolicyChangedEventType,
|
PasswordComplexityPolicyChangedEventType,
|
||||||
),
|
),
|
||||||
¤t.Policy,
|
¤t.WriteModel,
|
||||||
minLength,
|
minLength,
|
||||||
hasLowerCase,
|
hasLowerCase,
|
||||||
hasUpperCase,
|
hasUpperCase,
|
||||||
|
@ -54,7 +54,7 @@ func ChangedEventFromExisting(
|
|||||||
ctx,
|
ctx,
|
||||||
PasswordLockoutPolicyChangedEventType,
|
PasswordLockoutPolicyChangedEventType,
|
||||||
),
|
),
|
||||||
¤t.Policy,
|
¤t.WriteModel,
|
||||||
maxAttempts,
|
maxAttempts,
|
||||||
showLockoutFailure,
|
showLockoutFailure,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user