From c740ee5d81f478bdb6203a84a8b82541b2e4f67c Mon Sep 17 00:00:00 2001 From: Fabi <38692350+fgerschwiler@users.noreply.github.com> Date: Tue, 5 Apr 2022 07:58:09 +0200 Subject: [PATCH] feat: Instance commands (#3385) * fix: add events for domain * fix: add/remove domain command side * fix: add/remove domain command side * fix: add/remove domain query side * fix: create instance * fix: merge v2 * fix: instance domain * fix: instance domain * fix: instance domain * fix: instance domain * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from api * fix: remove domain.IAMID * fix: remove domain.IAMID * fix: add instance domain queries * fix: fix after merge * Update auth_request.go * fix keypair * remove unused code * feat: read instance id from context * feat: remove unused code * feat: use instance id from context * some fixes Co-authored-by: Livio Amstutz --- internal/api/grpc/admin/custom_text.go | 27 +- internal/api/grpc/admin/iam_settings.go | 8 +- internal/api/grpc/admin/idp.go | 6 +- internal/api/grpc/admin/idp_converter.go | 4 +- internal/api/grpc/admin/language.go | 19 +- internal/api/grpc/admin/login_policy.go | 3 +- .../api/grpc/admin/notification_provider.go | 5 +- internal/api/grpc/admin/oidc_settings.go | 4 +- internal/api/grpc/admin/sms.go | 7 +- internal/api/grpc/auth/password.go | 1 + internal/api/grpc/management/idp_converter.go | 2 +- internal/api/oidc/auth_request.go | 12 +- internal/api/oidc/key.go | 29 +- internal/api/ui/login/auth_request.go | 4 +- internal/api/ui/login/custom_action.go | 3 +- .../api/ui/login/external_login_handler.go | 23 +- .../api/ui/login/external_register_handler.go | 7 +- internal/api/ui/login/jwt_handler.go | 17 +- internal/api/ui/login/link_users_handler.go | 4 +- internal/api/ui/login/login_handler.go | 4 +- internal/api/ui/login/mfa_verify_handler.go | 4 +- .../api/ui/login/mfa_verify_u2f_handler.go | 7 +- internal/api/ui/login/password_handler.go | 2 +- .../ui/login/passwordless_login_handler.go | 4 +- .../passwordless_registration_handler.go | 1 - internal/api/ui/login/register_handler.go | 4 +- internal/api/ui/login/renderer.go | 11 +- internal/api/ui/login/resources_handler.go | 3 +- internal/api/ui/login/select_user_handler.go | 4 +- internal/auth/repository/auth_request.go | 38 +- .../eventsourcing/eventstore/auth_request.go | 96 +- .../eventsourcing/eventstore/org.go | 8 +- .../eventsourcing/handler/idp_providers.go | 9 +- .../handler/user_external_idps.go | 3 +- .../auth_request/repository/cache/cache.go | 13 +- .../auth_request/repository/repository.go | 6 +- .../eventstore/user_membership.go | 2 +- .../instancce_policy_password_age_model.go | 8 +- internal/command/instance.go | 74 - internal/command/instance_converter.go | 11 +- .../command/instance_custom_login_text.go | 5 +- .../instance_custom_login_text_model.go | 10 +- .../instance_custom_login_text_test.go | 6556 ++++++++++------- .../command/instance_custom_message_text.go | 6 +- .../instance_custom_message_text_model.go | 10 +- .../instance_custom_message_text_test.go | 31 +- internal/command/instance_custom_text.go | 4 +- .../command/instance_custom_text_model.go | 10 +- .../instance_debug_notification_file.go | 6 +- .../instance_debug_notification_file_model.go | 8 +- .../instance_debug_notification_file_test.go | 44 +- .../instance_debug_notification_log.go | 6 +- .../instance_debug_notification_log_model.go | 8 +- .../instance_debug_notification_log_test.go | 65 +- internal/command/instance_domain.go | 98 + internal/command/instance_domain_model.go | 71 + internal/command/instance_domain_test.go | 253 + internal/command/instance_features.go | 4 +- internal/command/instance_features_model.go | 7 +- internal/command/instance_idp_config.go | 7 +- internal/command/instance_idp_config_model.go | 7 +- internal/command/instance_idp_config_test.go | 53 +- internal/command/instance_idp_jwt_config.go | 2 +- .../command/instance_idp_jwt_config_model.go | 8 +- .../command/instance_idp_jwt_config_test.go | 42 +- internal/command/instance_idp_oidc_config.go | 2 +- .../command/instance_idp_oidc_config_model.go | 7 +- .../command/instance_idp_oidc_config_test.go | 42 +- internal/command/instance_member.go | 4 +- internal/command/instance_member_model.go | 10 +- internal/command/instance_member_test.go | 65 +- internal/command/instance_model.go | 30 +- internal/command/instance_oidc_settings.go | 2 +- .../command/instance_oidc_settings_model.go | 7 +- .../command/instance_oidc_settings_test.go | 33 +- internal/command/instance_policy_domain.go | 4 +- .../command/instance_policy_domain_model.go | 8 +- .../command/instance_policy_domain_test.go | 25 +- internal/command/instance_policy_label.go | 15 +- .../command/instance_policy_label_model.go | 8 +- .../command/instance_policy_label_test.go | 122 +- internal/command/instance_policy_login.go | 24 +- .../instance_policy_login_factors_model.go | 15 +- ...ce_policy_login_identity_provider_model.go | 10 +- .../command/instance_policy_login_model.go | 7 +- .../command/instance_policy_login_test.go | 138 +- .../command/instance_policy_mail_template.go | 4 +- .../instance_policy_mail_template_model.go | 8 +- .../instance_policy_mail_template_test.go | 28 +- .../command/instance_policy_password_age.go | 4 +- .../instance_policy_password_age_test.go | 28 +- .../instance_policy_password_complexity.go | 6 +- ...stance_policy_password_complexity_model.go | 8 +- ...nstance_policy_password_complexity_test.go | 30 +- .../instance_policy_password_lockout.go | 4 +- .../instance_policy_password_lockout_model.go | 8 +- .../instance_policy_password_lockout_test.go | 25 +- internal/command/instance_policy_privacy.go | 6 +- .../command/instance_policy_privacy_model.go | 8 +- .../command/instance_policy_privacy_test.go | 37 +- .../instance_secret_generator_model.go | 7 +- internal/command/instance_settings.go | 2 +- internal/command/instance_settings_test.go | 57 +- .../command/instance_smtp_config_model.go | 6 +- internal/command/key_pair.go | 8 +- internal/command/main_test.go | 29 + internal/command/org_domain.go | 2 +- internal/command/org_features.go | 2 +- internal/command/org_features_test.go | 110 +- internal/command/org_policy_label_test.go | 10 +- internal/command/org_policy_login.go | 2 +- .../command/org_policy_login_factors_model.go | 8 +- internal/command/org_policy_login_test.go | 10 +- internal/command/project.go | 7 - internal/command/project_test.go | 83 +- internal/command/setup.go | 105 - internal/command/sms_config.go | 28 +- internal/command/sms_config_model.go | 6 +- internal/command/sms_config_test.go | 115 +- internal/command/smtp.go | 16 +- internal/command/smtp_test.go | 55 +- internal/command/user.go | 2 +- internal/command/user_human_init.go | 2 +- internal/command/user_membership.go | 2 +- internal/command/user_test.go | 13 +- internal/command/v2/instance.go | 13 +- .../command/v2/instance_email_template.go | 2 +- internal/command/v2/user_domain_policy.go | 2 +- .../command/v2/user_domain_policy_test.go | 17 +- .../v2/user_password_complexity_policy.go | 2 +- .../user_password_complexity_policy_test.go | 17 +- internal/domain/instance.go | 29 +- internal/domain/instance_domain.go | 23 + .../eventsourcing/handler/notification.go | 69 +- internal/query/custom_text.go | 12 +- internal/query/features.go | 4 +- internal/query/idp.go | 2 +- internal/query/instance_domain.go | 148 + internal/query/instance_domain_test.go | 188 + internal/query/label_policy.go | 8 +- internal/query/lockout_policy.go | 4 +- internal/query/login_policy.go | 12 +- internal/query/mail_template.go | 4 +- internal/query/message_text.go | 8 +- internal/query/org_iam_policy.go | 4 +- internal/query/password_age_policy.go | 4 +- internal/query/password_complexity_policy.go | 4 +- internal/query/privacy_policy.go | 4 +- internal/query/projection/instance_domain.go | 96 + .../query/projection/instance_domain_test.go | 97 + internal/query/projection/projection.go | 1 + internal/query/zitadel_permission.go | 3 +- internal/repository/instance/aggregate.go | 7 +- internal/repository/instance/domain.go | 107 + internal/repository/instance/eventstore.go | 7 +- internal/repository/instance/instance.go | 126 + 156 files changed, 6360 insertions(+), 3951 deletions(-) delete mode 100644 internal/command/instance.go create mode 100644 internal/command/instance_domain.go create mode 100644 internal/command/instance_domain_model.go create mode 100644 internal/command/instance_domain_test.go delete mode 100644 internal/command/setup.go create mode 100644 internal/domain/instance_domain.go create mode 100644 internal/query/instance_domain.go create mode 100644 internal/query/instance_domain_test.go create mode 100644 internal/query/projection/instance_domain.go create mode 100644 internal/query/projection/instance_domain_test.go create mode 100644 internal/repository/instance/domain.go create mode 100644 internal/repository/instance/instance.go diff --git a/internal/api/grpc/admin/custom_text.go b/internal/api/grpc/admin/custom_text.go index da67d64982..c6ae47cdc5 100644 --- a/internal/api/grpc/admin/custom_text.go +++ b/internal/api/grpc/admin/custom_text.go @@ -3,6 +3,7 @@ package admin import ( "context" + "github.com/caos/zitadel/internal/api/authz" "golang.org/x/text/language" "github.com/caos/zitadel/internal/api/grpc/object" @@ -22,7 +23,7 @@ func (s *Server) GetDefaultInitMessageText(ctx context.Context, req *admin_pb.Ge } func (s *Server) GetCustomInitMessageText(ctx context.Context, req *admin_pb.GetCustomInitMessageTextRequest) (*admin_pb.GetCustomInitMessageTextResponse, error) { - msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, domain.IAMID, domain.InitCodeMessageType, req.Language) + msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, authz.GetInstance(ctx).InstanceID(), domain.InitCodeMessageType, req.Language) if err != nil { return nil, err } @@ -32,7 +33,7 @@ func (s *Server) GetCustomInitMessageText(ctx context.Context, req *admin_pb.Get } func (s *Server) SetDefaultInitMessageText(ctx context.Context, req *admin_pb.SetDefaultInitMessageTextRequest) (*admin_pb.SetDefaultInitMessageTextResponse, error) { - result, err := s.command.SetDefaultMessageText(ctx, SetInitCustomTextToDomain(req)) + result, err := s.command.SetDefaultMessageText(ctx, authz.GetInstance(ctx).InstanceID(), SetInitCustomTextToDomain(req)) if err != nil { return nil, err } @@ -70,7 +71,7 @@ func (s *Server) GetDefaultPasswordResetMessageText(ctx context.Context, req *ad } func (s *Server) GetCustomPasswordResetMessageText(ctx context.Context, req *admin_pb.GetCustomPasswordResetMessageTextRequest) (*admin_pb.GetCustomPasswordResetMessageTextResponse, error) { - msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, domain.IAMID, domain.PasswordResetMessageType, req.Language) + msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, authz.GetInstance(ctx).InstanceID(), domain.PasswordResetMessageType, req.Language) if err != nil { return nil, err } @@ -80,7 +81,7 @@ func (s *Server) GetCustomPasswordResetMessageText(ctx context.Context, req *adm } func (s *Server) SetDefaultPasswordResetMessageText(ctx context.Context, req *admin_pb.SetDefaultPasswordResetMessageTextRequest) (*admin_pb.SetDefaultPasswordResetMessageTextResponse, error) { - result, err := s.command.SetDefaultMessageText(ctx, SetPasswordResetCustomTextToDomain(req)) + result, err := s.command.SetDefaultMessageText(ctx, authz.GetInstance(ctx).InstanceID(), SetPasswordResetCustomTextToDomain(req)) if err != nil { return nil, err } @@ -118,7 +119,7 @@ func (s *Server) GetDefaultVerifyEmailMessageText(ctx context.Context, req *admi } func (s *Server) GetCustomVerifyEmailMessageText(ctx context.Context, req *admin_pb.GetCustomVerifyEmailMessageTextRequest) (*admin_pb.GetCustomVerifyEmailMessageTextResponse, error) { - msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, domain.IAMID, domain.VerifyEmailMessageType, req.Language) + msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, authz.GetInstance(ctx).InstanceID(), domain.VerifyEmailMessageType, req.Language) if err != nil { return nil, err } @@ -128,7 +129,7 @@ func (s *Server) GetCustomVerifyEmailMessageText(ctx context.Context, req *admin } func (s *Server) SetDefaultVerifyEmailMessageText(ctx context.Context, req *admin_pb.SetDefaultVerifyEmailMessageTextRequest) (*admin_pb.SetDefaultVerifyEmailMessageTextResponse, error) { - result, err := s.command.SetDefaultMessageText(ctx, SetVerifyEmailCustomTextToDomain(req)) + result, err := s.command.SetDefaultMessageText(ctx, authz.GetInstance(ctx).InstanceID(), SetVerifyEmailCustomTextToDomain(req)) if err != nil { return nil, err } @@ -166,7 +167,7 @@ func (s *Server) GetDefaultVerifyPhoneMessageText(ctx context.Context, req *admi } func (s *Server) GetCustomVerifyPhoneMessageText(ctx context.Context, req *admin_pb.GetCustomVerifyPhoneMessageTextRequest) (*admin_pb.GetCustomVerifyPhoneMessageTextResponse, error) { - msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, domain.IAMID, domain.VerifyPhoneMessageType, req.Language) + msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, authz.GetInstance(ctx).InstanceID(), domain.VerifyPhoneMessageType, req.Language) if err != nil { return nil, err } @@ -176,7 +177,7 @@ func (s *Server) GetCustomVerifyPhoneMessageText(ctx context.Context, req *admin } func (s *Server) SetDefaultVerifyPhoneMessageText(ctx context.Context, req *admin_pb.SetDefaultVerifyPhoneMessageTextRequest) (*admin_pb.SetDefaultVerifyPhoneMessageTextResponse, error) { - result, err := s.command.SetDefaultMessageText(ctx, SetVerifyPhoneCustomTextToDomain(req)) + result, err := s.command.SetDefaultMessageText(ctx, authz.GetInstance(ctx).InstanceID(), SetVerifyPhoneCustomTextToDomain(req)) if err != nil { return nil, err } @@ -214,7 +215,7 @@ func (s *Server) GetDefaultDomainClaimedMessageText(ctx context.Context, req *ad } func (s *Server) GetCustomDomainClaimedMessageText(ctx context.Context, req *admin_pb.GetCustomDomainClaimedMessageTextRequest) (*admin_pb.GetCustomDomainClaimedMessageTextResponse, error) { - msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, domain.IAMID, domain.DomainClaimedMessageType, req.Language) + msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, authz.GetInstance(ctx).InstanceID(), domain.DomainClaimedMessageType, req.Language) if err != nil { return nil, err } @@ -224,7 +225,7 @@ func (s *Server) GetCustomDomainClaimedMessageText(ctx context.Context, req *adm } func (s *Server) SetDefaultDomainClaimedMessageText(ctx context.Context, req *admin_pb.SetDefaultDomainClaimedMessageTextRequest) (*admin_pb.SetDefaultDomainClaimedMessageTextResponse, error) { - result, err := s.command.SetDefaultMessageText(ctx, SetDomainClaimedCustomTextToDomain(req)) + result, err := s.command.SetDefaultMessageText(ctx, authz.GetInstance(ctx).InstanceID(), SetDomainClaimedCustomTextToDomain(req)) if err != nil { return nil, err } @@ -262,7 +263,7 @@ func (s *Server) GetDefaultPasswordlessRegistrationMessageText(ctx context.Conte } func (s *Server) GetCustomPasswordlessRegistrationMessageText(ctx context.Context, req *admin_pb.GetCustomPasswordlessRegistrationMessageTextRequest) (*admin_pb.GetCustomPasswordlessRegistrationMessageTextResponse, error) { - msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, domain.IAMID, domain.PasswordlessRegistrationMessageType, req.Language) + msg, err := s.query.CustomMessageTextByTypeAndLanguage(ctx, authz.GetInstance(ctx).InstanceID(), domain.PasswordlessRegistrationMessageType, req.Language) if err != nil { return nil, err } @@ -272,7 +273,7 @@ func (s *Server) GetCustomPasswordlessRegistrationMessageText(ctx context.Contex } func (s *Server) SetDefaultPasswordlessRegistrationMessageText(ctx context.Context, req *admin_pb.SetDefaultPasswordlessRegistrationMessageTextRequest) (*admin_pb.SetDefaultPasswordlessRegistrationMessageTextResponse, error) { - result, err := s.command.SetDefaultMessageText(ctx, SetPasswordlessRegistrationCustomTextToDomain(req)) + result, err := s.command.SetDefaultMessageText(ctx, authz.GetInstance(ctx).InstanceID(), SetPasswordlessRegistrationCustomTextToDomain(req)) if err != nil { return nil, err } @@ -309,7 +310,7 @@ func (s *Server) GetDefaultLoginTexts(ctx context.Context, req *admin_pb.GetDefa }, nil } func (s *Server) GetCustomLoginTexts(ctx context.Context, req *admin_pb.GetCustomLoginTextsRequest) (*admin_pb.GetCustomLoginTextsResponse, error) { - msg, err := s.query.GetCustomLoginTexts(ctx, domain.IAMID, req.Language) + msg, err := s.query.GetCustomLoginTexts(ctx, authz.GetInstance(ctx).InstanceID(), req.Language) if err != nil { return nil, err } diff --git a/internal/api/grpc/admin/iam_settings.go b/internal/api/grpc/admin/iam_settings.go index c64d38839b..4ba9810cd0 100644 --- a/internal/api/grpc/admin/iam_settings.go +++ b/internal/api/grpc/admin/iam_settings.go @@ -3,8 +3,8 @@ package admin import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/api/grpc/object" - "github.com/caos/zitadel/internal/domain" admin_pb "github.com/caos/zitadel/pkg/grpc/admin" ) @@ -46,7 +46,7 @@ func (s *Server) UpdateSecretGenerator(ctx context.Context, req *admin_pb.Update } func (s *Server) GetSMTPConfig(ctx context.Context, req *admin_pb.GetSMTPConfigRequest) (*admin_pb.GetSMTPConfigResponse, error) { - smtp, err := s.query.SMTPConfigByAggregateID(ctx, domain.IAMID) + smtp, err := s.query.SMTPConfigByAggregateID(ctx, authz.GetInstance(ctx).InstanceID()) if err != nil { return nil, err } @@ -56,7 +56,7 @@ func (s *Server) GetSMTPConfig(ctx context.Context, req *admin_pb.GetSMTPConfigR } func (s *Server) UpdateSMTPConfig(ctx context.Context, req *admin_pb.UpdateSMTPConfigRequest) (*admin_pb.UpdateSMTPConfigResponse, error) { - details, err := s.command.ChangeSMTPConfig(ctx, UpdateSMTPToConfig(req)) + details, err := s.command.ChangeSMTPConfig(ctx, authz.GetInstance(ctx).InstanceID(), UpdateSMTPToConfig(req)) if err != nil { return nil, err } @@ -69,7 +69,7 @@ func (s *Server) UpdateSMTPConfig(ctx context.Context, req *admin_pb.UpdateSMTPC } func (s *Server) UpdateSMTPConfigPassword(ctx context.Context, req *admin_pb.UpdateSMTPConfigPasswordRequest) (*admin_pb.UpdateSMTPConfigPasswordResponse, error) { - details, err := s.command.ChangeSMTPConfigPassword(ctx, req.Password) + details, err := s.command.ChangeSMTPConfigPassword(ctx, authz.GetInstance(ctx).InstanceID(), req.Password) if err != nil { return nil, err } diff --git a/internal/api/grpc/admin/idp.go b/internal/api/grpc/admin/idp.go index 41ab8893e7..a497c1b2f3 100644 --- a/internal/api/grpc/admin/idp.go +++ b/internal/api/grpc/admin/idp.go @@ -3,15 +3,15 @@ package admin import ( "context" + "github.com/caos/zitadel/internal/api/authz" idp_grpc "github.com/caos/zitadel/internal/api/grpc/idp" object_pb "github.com/caos/zitadel/internal/api/grpc/object" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/query" admin_pb "github.com/caos/zitadel/pkg/grpc/admin" ) func (s *Server) GetIDPByID(ctx context.Context, req *admin_pb.GetIDPByIDRequest) (*admin_pb.GetIDPByIDResponse, error) { - idp, err := s.query.IDPByIDAndResourceOwner(ctx, req.Id, domain.IAMID) + idp, err := s.query.IDPByIDAndResourceOwner(ctx, req.Id, authz.GetInstance(ctx).InstanceID()) if err != nil { return nil, err } @@ -19,7 +19,7 @@ func (s *Server) GetIDPByID(ctx context.Context, req *admin_pb.GetIDPByIDRequest } func (s *Server) ListIDPs(ctx context.Context, req *admin_pb.ListIDPsRequest) (*admin_pb.ListIDPsResponse, error) { - queries, err := listIDPsToModel(req) + queries, err := listIDPsToModel(authz.GetInstance(ctx).InstanceID(), req) if err != nil { return nil, err } diff --git a/internal/api/grpc/admin/idp_converter.go b/internal/api/grpc/admin/idp_converter.go index ece4e28ef5..6f40b680f1 100644 --- a/internal/api/grpc/admin/idp_converter.go +++ b/internal/api/grpc/admin/idp_converter.go @@ -81,13 +81,13 @@ func updateJWTConfigToDomain(req *admin_pb.UpdateIDPJWTConfigRequest) *domain.JW } } -func listIDPsToModel(req *admin_pb.ListIDPsRequest) (*query.IDPSearchQueries, error) { +func listIDPsToModel(instanceID string, req *admin_pb.ListIDPsRequest) (*query.IDPSearchQueries, error) { offset, limit, asc := object.ListQueryToModel(req.Query) queries, err := idpQueriesToModel(req.Queries) if err != nil { return nil, err } - iamQuery, err := query.NewIDPResourceOwnerSearchQuery(domain.IAMID) + iamQuery, err := query.NewIDPResourceOwnerSearchQuery(instanceID) if err != nil { return nil, err } diff --git a/internal/api/grpc/admin/language.go b/internal/api/grpc/admin/language.go index 259075fca5..dcbca8724a 100644 --- a/internal/api/grpc/admin/language.go +++ b/internal/api/grpc/admin/language.go @@ -5,7 +5,6 @@ import ( "golang.org/x/text/language" - "github.com/caos/zitadel/internal/api/grpc/object" "github.com/caos/zitadel/internal/api/grpc/text" caos_errors "github.com/caos/zitadel/internal/errors" admin_pb "github.com/caos/zitadel/pkg/grpc/admin" @@ -20,17 +19,19 @@ func (s *Server) GetSupportedLanguages(ctx context.Context, req *admin_pb.GetSup } func (s *Server) SetDefaultLanguage(ctx context.Context, req *admin_pb.SetDefaultLanguageRequest) (*admin_pb.SetDefaultLanguageResponse, error) { - lang, err := language.Parse(req.Language) + _, err := language.Parse(req.Language) if err != nil { return nil, caos_errors.ThrowInvalidArgument(err, "API-39nnf", "Errors.Language.Parse") } - details, err := s.command.SetDefaultLanguage(ctx, lang) - if err != nil { - return nil, err - } - return &admin_pb.SetDefaultLanguageResponse{ - Details: object.DomainToChangeDetailsPb(details), - }, nil + //TODO: Will be added by silvan + //details, err := s.command.SetDefaultLanguage(ctx, lang) + //if err != nil { + // return nil, err + //} + //return &admin_pb.SetDefaultLanguageResponse{ + // Details: object.DomainToChangeDetailsPb(details), + //}, nil + return nil, nil } func (s *Server) GetDefaultLanguage(ctx context.Context, req *admin_pb.GetDefaultLanguageRequest) (*admin_pb.GetDefaultLanguageResponse, error) { diff --git a/internal/api/grpc/admin/login_policy.go b/internal/api/grpc/admin/login_policy.go index b6195e59ef..0d97454da8 100644 --- a/internal/api/grpc/admin/login_policy.go +++ b/internal/api/grpc/admin/login_policy.go @@ -3,6 +3,7 @@ package admin import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/api/grpc/user" "github.com/caos/zitadel/internal/query" @@ -36,7 +37,7 @@ func (s *Server) UpdateLoginPolicy(ctx context.Context, p *admin_pb.UpdateLoginP } func (s *Server) ListLoginPolicyIDPs(ctx context.Context, req *admin_pb.ListLoginPolicyIDPsRequest) (*admin_pb.ListLoginPolicyIDPsResponse, error) { - res, err := s.query.IDPLoginPolicyLinks(ctx, domain.IAMID, ListLoginPolicyIDPsRequestToQuery(req)) + res, err := s.query.IDPLoginPolicyLinks(ctx, authz.GetInstance(ctx).InstanceID(), ListLoginPolicyIDPsRequestToQuery(req)) if err != nil { return nil, err } diff --git a/internal/api/grpc/admin/notification_provider.go b/internal/api/grpc/admin/notification_provider.go index b14405e18a..8e0cdae9b9 100644 --- a/internal/api/grpc/admin/notification_provider.go +++ b/internal/api/grpc/admin/notification_provider.go @@ -3,13 +3,14 @@ package admin import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/api/grpc/settings" "github.com/caos/zitadel/internal/domain" admin_pb "github.com/caos/zitadel/pkg/grpc/admin" ) func (s *Server) GetFileSystemNotificationProvider(ctx context.Context, req *admin_pb.GetFileSystemNotificationProviderRequest) (*admin_pb.GetFileSystemNotificationProviderResponse, error) { - result, err := s.query.NotificationProviderByIDAndType(ctx, domain.IAMID, domain.NotificationProviderTypeFile) + result, err := s.query.NotificationProviderByIDAndType(ctx, authz.GetInstance(ctx).InstanceID(), domain.NotificationProviderTypeFile) if err != nil { return nil, err @@ -20,7 +21,7 @@ func (s *Server) GetFileSystemNotificationProvider(ctx context.Context, req *adm } func (s *Server) GetLogNotificationProvider(ctx context.Context, req *admin_pb.GetLogNotificationProviderRequest) (*admin_pb.GetLogNotificationProviderResponse, error) { - result, err := s.query.NotificationProviderByIDAndType(ctx, domain.IAMID, domain.NotificationProviderTypeLog) + result, err := s.query.NotificationProviderByIDAndType(ctx, authz.GetInstance(ctx).InstanceID(), domain.NotificationProviderTypeLog) if err != nil { return nil, err diff --git a/internal/api/grpc/admin/oidc_settings.go b/internal/api/grpc/admin/oidc_settings.go index a6a0abce18..5dac95a1e5 100644 --- a/internal/api/grpc/admin/oidc_settings.go +++ b/internal/api/grpc/admin/oidc_settings.go @@ -3,13 +3,13 @@ package admin import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/api/grpc/object" - "github.com/caos/zitadel/internal/domain" admin_pb "github.com/caos/zitadel/pkg/grpc/admin" ) func (s *Server) GetOIDCSettings(ctx context.Context, _ *admin_pb.GetOIDCSettingsRequest) (*admin_pb.GetOIDCSettingsResponse, error) { - result, err := s.query.OIDCSettingsByAggID(ctx, domain.IAMID) + result, err := s.query.OIDCSettingsByAggID(ctx, authz.GetInstance(ctx).InstanceID()) if err != nil { return nil, err } diff --git a/internal/api/grpc/admin/sms.go b/internal/api/grpc/admin/sms.go index 1844cce532..5ab40fd08a 100644 --- a/internal/api/grpc/admin/sms.go +++ b/internal/api/grpc/admin/sms.go @@ -3,6 +3,7 @@ package admin import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/api/grpc/object" admin_pb "github.com/caos/zitadel/pkg/grpc/admin" settings_pb "github.com/caos/zitadel/pkg/grpc/settings" @@ -40,7 +41,7 @@ func (s *Server) GetSMSProvider(ctx context.Context, req *admin_pb.GetSMSProvide } func (s *Server) AddSMSProviderTwilio(ctx context.Context, req *admin_pb.AddSMSProviderTwilioRequest) (*admin_pb.AddSMSProviderTwilioResponse, error) { - id, result, err := s.command.AddSMSConfigTwilio(ctx, AddSMSConfigTwilioToConfig(req)) + id, result, err := s.command.AddSMSConfigTwilio(ctx, authz.GetInstance(ctx).InstanceID(), AddSMSConfigTwilioToConfig(req)) if err != nil { return nil, err @@ -52,7 +53,7 @@ func (s *Server) AddSMSProviderTwilio(ctx context.Context, req *admin_pb.AddSMSP } func (s *Server) UpdateSMSProviderTwilio(ctx context.Context, req *admin_pb.UpdateSMSProviderTwilioRequest) (*admin_pb.UpdateSMSProviderTwilioResponse, error) { - result, err := s.command.ChangeSMSConfigTwilio(ctx, req.Id, UpdateSMSConfigTwilioToConfig(req)) + result, err := s.command.ChangeSMSConfigTwilio(ctx, authz.GetInstance(ctx).InstanceID(), req.Id, UpdateSMSConfigTwilioToConfig(req)) if err != nil { return nil, err @@ -63,7 +64,7 @@ func (s *Server) UpdateSMSProviderTwilio(ctx context.Context, req *admin_pb.Upda } func (s *Server) UpdateSMSProviderTwilioToken(ctx context.Context, req *admin_pb.UpdateSMSProviderTwilioTokenRequest) (*admin_pb.UpdateSMSProviderTwilioTokenResponse, error) { - result, err := s.command.ChangeSMSConfigTwilioToken(ctx, req.Id, req.Token) + result, err := s.command.ChangeSMSConfigTwilioToken(ctx, authz.GetInstance(ctx).InstanceID(), req.Id, req.Token) if err != nil { return nil, err diff --git a/internal/api/grpc/auth/password.go b/internal/api/grpc/auth/password.go index 6a628351c3..0d96baf446 100644 --- a/internal/api/grpc/auth/password.go +++ b/internal/api/grpc/auth/password.go @@ -2,6 +2,7 @@ package auth import ( "context" + "github.com/caos/zitadel/internal/api/grpc/object" "github.com/caos/zitadel/internal/api/authz" diff --git a/internal/api/grpc/management/idp_converter.go b/internal/api/grpc/management/idp_converter.go index 86f5978f25..57b04e1333 100644 --- a/internal/api/grpc/management/idp_converter.go +++ b/internal/api/grpc/management/idp_converter.go @@ -91,7 +91,7 @@ func listIDPsToModel(ctx context.Context, req *mgmt_pb.ListOrgIDPsRequest) (quer if err != nil { return nil, err } - resourceOwnerQuery, err := query.NewIDPResourceOwnerListSearchQuery(domain.IAMID, authz.GetCtxData(ctx).OrgID) + resourceOwnerQuery, err := query.NewIDPResourceOwnerListSearchQuery(authz.GetInstance(ctx).InstanceID(), authz.GetCtxData(ctx).OrgID) if err != nil { return nil, err } diff --git a/internal/api/oidc/auth_request.go b/internal/api/oidc/auth_request.go index fd831db7d9..53ed9860c4 100644 --- a/internal/api/oidc/auth_request.go +++ b/internal/api/oidc/auth_request.go @@ -44,8 +44,7 @@ func (o *OPStorage) AuthRequestByID(ctx context.Context, id string) (_ op.AuthRe if !ok { return nil, errors.ThrowPreconditionFailed(nil, "OIDC-D3g21", "no user agent id") } - instanceID := authz.GetInstance(ctx).InstanceID() - resp, err := o.repo.AuthRequestByIDCheckLoggedIn(ctx, id, userAgentID, instanceID) + resp, err := o.repo.AuthRequestByIDCheckLoggedIn(ctx, id, userAgentID) if err != nil { return nil, err } @@ -56,8 +55,7 @@ func (o *OPStorage) AuthRequestByCode(ctx context.Context, code string) (_ op.Au ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - instanceID := authz.GetInstance(ctx).InstanceID() - resp, err := o.repo.AuthRequestByCode(ctx, code, instanceID) + resp, err := o.repo.AuthRequestByCode(ctx, code) if err != nil { return nil, err } @@ -71,16 +69,14 @@ func (o *OPStorage) SaveAuthCode(ctx context.Context, id, code string) (err erro if !ok { return errors.ThrowPreconditionFailed(nil, "OIDC-Dgus2", "no user agent id") } - instanceID := authz.GetInstance(ctx).InstanceID() - return o.repo.SaveAuthCode(ctx, id, code, userAgentID, instanceID) + return o.repo.SaveAuthCode(ctx, id, code, userAgentID) } func (o *OPStorage) DeleteAuthRequest(ctx context.Context, id string) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - instanceID := authz.GetInstance(ctx).InstanceID() - return o.repo.DeleteAuthRequest(ctx, id, instanceID) + return o.repo.DeleteAuthRequest(ctx, id) } func (o *OPStorage) CreateAccessToken(ctx context.Context, req op.TokenRequest) (_ string, _ time.Time, err error) { diff --git a/internal/api/oidc/key.go b/internal/api/oidc/key.go index 1006b5af65..6e04c21985 100644 --- a/internal/api/oidc/key.go +++ b/internal/api/oidc/key.go @@ -11,7 +11,6 @@ import ( "github.com/caos/zitadel/internal/telemetry/tracing" "github.com/caos/zitadel/internal/crypto" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/query" @@ -54,7 +53,7 @@ func (o *OPStorage) GetSigningKey(ctx context.Context, keyCh chan<- jose.Signing <-renewTimer.C } checkAfter := o.resetTimer(renewTimer, true) - logging.Log("OIDC-dK432").Infof("requested next signing key check in %s", checkAfter) + logging.Infof("requested next signing key check in %s", checkAfter) case <-renewTimer.C: o.getSigningKey(ctx, renewTimer, keyCh) } @@ -66,7 +65,7 @@ func (o *OPStorage) getSigningKey(ctx context.Context, renewTimer *time.Timer, k keys, err := o.query.ActivePrivateSigningKey(ctx, time.Now().Add(o.signingKeyGracefulPeriod)) if err != nil { checkAfter := o.resetTimer(renewTimer, true) - logging.Log("OIDC-ASff").Infof("next signing key check in %s", checkAfter) + logging.Infof("next signing key check in %s", checkAfter) return } if len(keys.Keys) == 0 { @@ -76,13 +75,13 @@ func (o *OPStorage) getSigningKey(ctx context.Context, renewTimer *time.Timer, k } o.refreshSigningKey(ctx, keyCh, o.signingKeyAlgorithm, sequence) checkAfter := o.resetTimer(renewTimer, true) - logging.Log("OIDC-ASDf3").Infof("next signing key check in %s", checkAfter) + logging.Infof("next signing key check in %s", checkAfter) return } err = o.exchangeSigningKey(selectSigningKey(keys.Keys), keyCh) - logging.Log("OIDC-aDfg3").OnError(err).Error("could not exchange signing key") + logging.OnError(err).Error("could not exchange signing key") checkAfter := o.resetTimer(renewTimer, err != nil) - logging.Log("OIDC-dK432").Infof("next signing key check in %s", checkAfter) + logging.Infof("next signing key check in %s", checkAfter) } func (o *OPStorage) resetTimer(timer *time.Timer, shortRefresh bool) (nextCheck time.Duration) { @@ -100,20 +99,20 @@ func (o *OPStorage) resetTimer(timer *time.Timer, shortRefresh bool) (nextCheck func (o *OPStorage) refreshSigningKey(ctx context.Context, keyCh chan<- jose.SigningKey, algorithm string, sequence uint64) { if o.currentKey != nil && o.currentKey.Expiry().Before(time.Now().UTC()) { - logging.Log("OIDC-ADg26").Info("unset current signing key") + logging.Info("unset current signing key") keyCh <- jose.SigningKey{} } ok, err := o.ensureIsLatestKey(ctx, sequence) if err != nil { - logging.Log("OIDC-sdz53").WithError(err).Error("could not ensure latest key") + logging.New().WithError(err).Error("could not ensure latest key") return } if !ok { - logging.Log("EVENT-GBD23").Warn("view not up to date, retrying later") + logging.Warn("view not up to date, retrying later") return } err = o.lockAndGenerateSigningKeyPair(ctx, algorithm) - logging.Log("EVENT-B4d21").OnError(err).Warn("could not create signing key") + logging.OnError(err).Warn("could not create signing key") } func (o *OPStorage) ensureIsLatestKey(ctx context.Context, sequence uint64) (bool, error) { @@ -126,7 +125,7 @@ func (o *OPStorage) ensureIsLatestKey(ctx context.Context, sequence uint64) (boo func (o *OPStorage) exchangeSigningKey(key query.PrivateKey, keyCh chan<- jose.SigningKey) (err error) { if o.currentKey != nil && o.currentKey.ID() == key.ID() { - logging.Log("OIDC-Abb3e").Info("no new signing key") + logging.Info("no new signing key") return nil } keyData, err := crypto.Decrypt(key.Key(), o.encAlg) @@ -145,12 +144,12 @@ func (o *OPStorage) exchangeSigningKey(key query.PrivateKey, keyCh chan<- jose.S }, } o.currentKey = key - logging.LogWithFields("OIDC-dsg54", "keyID", key.ID()).Info("exchanged signing key") + logging.WithFields("keyID", key.ID()).Info("exchanged signing key") return nil } func (o *OPStorage) lockAndGenerateSigningKeyPair(ctx context.Context, algorithm string) error { - logging.Log("OIDC-sdz53").Info("lock and generate signing key pair") + logging.Info("lock and generate signing key pair") ctx, cancel := context.WithCancel(ctx) defer cancel() @@ -161,7 +160,7 @@ func (o *OPStorage) lockAndGenerateSigningKeyPair(ctx context.Context, algorithm if errors.IsErrorAlreadyExists(err) { return nil } - logging.Log("OIDC-Dfg32").OnError(err).Warn("initial lock failed") + logging.OnError(err).Warn("initial lock failed") return err } @@ -171,7 +170,7 @@ func (o *OPStorage) lockAndGenerateSigningKeyPair(ctx context.Context, algorithm func (o *OPStorage) getMaxKeySequence(ctx context.Context) (uint64, error) { return o.eventstore.LatestSequence(ctx, eventstore.NewSearchQueryBuilder(eventstore.ColumnsMaxSequence). - ResourceOwner(domain.IAMID). + ResourceOwner("system"). //TODO: change with multi issuer AddQuery(). AggregateTypes(keypair.AggregateType). Builder(), diff --git a/internal/api/ui/login/auth_request.go b/internal/api/ui/login/auth_request.go index 12dfbc7b8d..d7a2984077 100644 --- a/internal/api/ui/login/auth_request.go +++ b/internal/api/ui/login/auth_request.go @@ -5,7 +5,6 @@ import ( "github.com/caos/zitadel/internal/domain" - "github.com/caos/zitadel/internal/api/authz" http_mw "github.com/caos/zitadel/internal/api/http/middleware" ) @@ -20,8 +19,7 @@ func (l *Login) getAuthRequest(r *http.Request) (*domain.AuthRequest, error) { return nil, nil } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - return l.authRepo.AuthRequestByID(r.Context(), authRequestID, userAgentID, instanceID) + return l.authRepo.AuthRequestByID(r.Context(), authRequestID, userAgentID) } func (l *Login) getAuthRequestAndParseData(r *http.Request, data interface{}) (*domain.AuthRequest, error) { diff --git a/internal/api/ui/login/custom_action.go b/internal/api/ui/login/custom_action.go index 739cda75f7..de9a5e9485 100644 --- a/internal/api/ui/login/custom_action.go +++ b/internal/api/ui/login/custom_action.go @@ -4,6 +4,7 @@ import ( "context" "github.com/caos/oidc/pkg/oidc" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/actions" "github.com/caos/zitadel/internal/domain" @@ -15,7 +16,7 @@ func (l *Login) customExternalUserMapping(ctx context.Context, user *domain.Exte if resourceOwner == "" { resourceOwner = config.AggregateID } - if resourceOwner == domain.IAMID { + if resourceOwner == authz.GetInstance(ctx).InstanceID() { iam, err := l.query.Instance(ctx) if err != nil { return nil, err diff --git a/internal/api/ui/login/external_login_handler.go b/internal/api/ui/login/external_login_handler.go index 2cd8b756b8..98d691a1e1 100644 --- a/internal/api/ui/login/external_login_handler.go +++ b/internal/api/ui/login/external_login_handler.go @@ -11,8 +11,6 @@ import ( "github.com/caos/oidc/pkg/oidc" "golang.org/x/oauth2" - "github.com/caos/zitadel/internal/api/authz" - http_mw "github.com/caos/zitadel/internal/api/http/middleware" "github.com/caos/zitadel/internal/crypto" "github.com/caos/zitadel/internal/domain" @@ -89,8 +87,7 @@ func (l *Login) handleIDP(w http.ResponseWriter, r *http.Request, authReq *domai return } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.SelectExternalIDP(r.Context(), authReq.ID, idpConfig.IDPConfigID, userAgentID, instanceID) + err = l.authRepo.SelectExternalIDP(r.Context(), authReq.ID, idpConfig.IDPConfigID, userAgentID) if err != nil { l.renderLogin(w, r, authReq, err) return @@ -142,8 +139,7 @@ func (l *Login) handleExternalLoginCallback(w http.ResponseWriter, r *http.Reque return } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - authReq, err := l.authRepo.AuthRequestByID(r.Context(), data.State, userAgentID, instanceID) + authReq, err := l.authRepo.AuthRequestByID(r.Context(), data.State, userAgentID) if err != nil { l.renderError(w, r, authReq, err) return @@ -202,8 +198,7 @@ func (l *Login) handleExternalUserAuthenticated(w http.ResponseWriter, r *http.R return } - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.CheckExternalUserLogin(setContext(r.Context(), ""), authReq.ID, userAgentID, instanceID, externalUser, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.CheckExternalUserLogin(setContext(r.Context(), ""), authReq.ID, userAgentID, externalUser, domain.BrowserInfoFromRequest(r)) if err != nil { if errors.IsNotFound(err) { err = nil @@ -231,7 +226,7 @@ func (l *Login) handleExternalUserAuthenticated(w http.ResponseWriter, r *http.R l.renderExternalNotFoundOption(w, r, authReq, iam, orgIAMPolicy, human, idpLinking, err) return } - authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, userAgentID, instanceID) + authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, userAgentID) if err != nil { l.renderExternalNotFoundOption(w, r, authReq, iam, orgIAMPolicy, human, idpLinking, err) return @@ -240,7 +235,7 @@ func (l *Login) handleExternalUserAuthenticated(w http.ResponseWriter, r *http.R return } if len(externalUser.Metadatas) > 0 { - authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, userAgentID, instanceID) + authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, userAgentID) if err != nil { return } @@ -329,8 +324,7 @@ func (l *Login) handleExternalNotFoundOptionCheck(w http.ResponseWriter, r *http return } else if data.ResetLinking { userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.ResetLinkingUsers(r.Context(), authReq.ID, userAgentID, instanceID) + err = l.authRepo.ResetLinkingUsers(r.Context(), authReq.ID, userAgentID) if err != nil { l.renderExternalNotFoundOption(w, r, authReq, nil, nil, nil, nil, err) } @@ -368,7 +362,6 @@ func (l *Login) handleAutoRegister(w http.ResponseWriter, r *http.Request, authR } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() if len(authReq.LinkingUsers) == 0 { l.renderError(w, r, authReq, caos_errors.ThrowPreconditionFailed(nil, "LOGIN-asfg3", "Errors.ExternalIDP.NoExternalUserData")) return @@ -380,12 +373,12 @@ func (l *Login) handleAutoRegister(w http.ResponseWriter, r *http.Request, authR l.renderExternalNotFoundOption(w, r, authReq, iam, orgIamPolicy, nil, nil, err) return } - err = l.authRepo.AutoRegisterExternalUser(setContext(r.Context(), resourceOwner), user, externalIDP, memberRoles, authReq.ID, userAgentID, resourceOwner, instanceID, metadata, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.AutoRegisterExternalUser(setContext(r.Context(), resourceOwner), user, externalIDP, memberRoles, authReq.ID, userAgentID, resourceOwner, metadata, domain.BrowserInfoFromRequest(r)) if err != nil { l.renderExternalNotFoundOption(w, r, authReq, iam, orgIamPolicy, user, externalIDP, err) return } - authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID, instanceID) + authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID) if err != nil { l.renderError(w, r, authReq, err) return diff --git a/internal/api/ui/login/external_register_handler.go b/internal/api/ui/login/external_register_handler.go index 994f802186..06450ed7f3 100644 --- a/internal/api/ui/login/external_register_handler.go +++ b/internal/api/ui/login/external_register_handler.go @@ -8,7 +8,6 @@ import ( "github.com/caos/oidc/pkg/oidc" "golang.org/x/text/language" - "github.com/caos/zitadel/internal/api/authz" http_mw "github.com/caos/zitadel/internal/api/http/middleware" "github.com/caos/zitadel/internal/domain" iam_model "github.com/caos/zitadel/internal/iam/model" @@ -68,8 +67,7 @@ func (l *Login) handleExternalRegister(w http.ResponseWriter, r *http.Request) { return } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.SelectExternalIDP(r.Context(), authReq.ID, idpConfig.IDPConfigID, userAgentID, instanceID) + err = l.authRepo.SelectExternalIDP(r.Context(), authReq.ID, idpConfig.IDPConfigID, userAgentID) if err != nil { l.renderLogin(w, r, authReq, err) return @@ -89,8 +87,7 @@ func (l *Login) handleExternalRegisterCallback(w http.ResponseWriter, r *http.Re return } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - authReq, err := l.authRepo.AuthRequestByID(r.Context(), data.State, userAgentID, instanceID) + authReq, err := l.authRepo.AuthRequestByID(r.Context(), data.State, userAgentID) if err != nil { l.renderError(w, r, authReq, err) return diff --git a/internal/api/ui/login/jwt_handler.go b/internal/api/ui/login/jwt_handler.go index 9c5ae01bdb..d8acaa363e 100644 --- a/internal/api/ui/login/jwt_handler.go +++ b/internal/api/ui/login/jwt_handler.go @@ -12,7 +12,6 @@ import ( "github.com/caos/oidc/pkg/client/rp" "github.com/caos/oidc/pkg/oidc" - "github.com/caos/zitadel/internal/api/authz" http_util "github.com/caos/zitadel/internal/api/http" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/errors" @@ -45,8 +44,7 @@ func (l *Login) handleJWTRequest(w http.ResponseWriter, r *http.Request) { l.renderError(w, r, nil, err) return } - instanceID := authz.GetInstance(r.Context()).InstanceID() - authReq, err := l.authRepo.AuthRequestByID(r.Context(), data.AuthRequestID, userAgentID, instanceID) + authReq, err := l.authRepo.AuthRequestByID(r.Context(), data.AuthRequestID, userAgentID) if err != nil { l.renderError(w, r, authReq, err) return @@ -84,13 +82,13 @@ func (l *Login) handleJWTExtraction(w http.ResponseWriter, r *http.Request, auth return } metadata := externalUser.Metadatas - err = l.authRepo.CheckExternalUserLogin(setContext(r.Context(), ""), authReq.ID, authReq.AgentID, authReq.InstanceID, externalUser, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.CheckExternalUserLogin(setContext(r.Context(), ""), authReq.ID, authReq.AgentID, externalUser, domain.BrowserInfoFromRequest(r)) if err != nil { l.jwtExtractionUserNotFound(w, r, authReq, idpConfig, tokens, err) return } if len(metadata) > 0 { - authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID, authReq.InstanceID) + authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID) if err != nil { l.renderError(w, r, authReq, err) return @@ -117,7 +115,7 @@ func (l *Login) jwtExtractionUserNotFound(w http.ResponseWriter, r *http.Request l.renderExternalNotFoundOption(w, r, authReq, nil, nil, nil, nil, err) return } - authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID, authReq.InstanceID) + authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID) if err != nil { l.renderError(w, r, authReq, err) return @@ -135,12 +133,12 @@ func (l *Login) jwtExtractionUserNotFound(w http.ResponseWriter, r *http.Request l.renderError(w, r, authReq, err) return } - err = l.authRepo.AutoRegisterExternalUser(setContext(r.Context(), resourceOwner), user, externalIDP, nil, authReq.ID, authReq.AgentID, resourceOwner, authReq.InstanceID, metadata, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.AutoRegisterExternalUser(setContext(r.Context(), resourceOwner), user, externalIDP, nil, authReq.ID, authReq.AgentID, resourceOwner, metadata, domain.BrowserInfoFromRequest(r)) if err != nil { l.renderError(w, r, authReq, err) return } - authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID, authReq.InstanceID) + authReq, err = l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID) if err != nil { l.renderError(w, r, authReq, err) return @@ -209,8 +207,7 @@ func (l *Login) handleJWTCallback(w http.ResponseWriter, r *http.Request) { l.renderError(w, r, nil, err) return } - instanceID := authz.GetInstance(r.Context()).InstanceID() - authReq, err := l.authRepo.AuthRequestByID(r.Context(), data.AuthRequestID, userAgentID, instanceID) + authReq, err := l.authRepo.AuthRequestByID(r.Context(), data.AuthRequestID, userAgentID) if err != nil { l.renderError(w, r, authReq, err) return diff --git a/internal/api/ui/login/link_users_handler.go b/internal/api/ui/login/link_users_handler.go index dd9b498e33..9d56126360 100644 --- a/internal/api/ui/login/link_users_handler.go +++ b/internal/api/ui/login/link_users_handler.go @@ -3,7 +3,6 @@ package login import ( "net/http" - "github.com/caos/zitadel/internal/api/authz" http_mw "github.com/caos/zitadel/internal/api/http/middleware" "github.com/caos/zitadel/internal/domain" ) @@ -14,8 +13,7 @@ const ( func (l *Login) linkUsers(w http.ResponseWriter, r *http.Request, authReq *domain.AuthRequest, err error) { userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.LinkExternalUsers(setContext(r.Context(), authReq.UserOrgID), authReq.ID, userAgentID, instanceID, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.LinkExternalUsers(setContext(r.Context(), authReq.UserOrgID), authReq.ID, userAgentID, domain.BrowserInfoFromRequest(r)) l.renderLinkUsersDone(w, r, authReq, err) } diff --git a/internal/api/ui/login/login_handler.go b/internal/api/ui/login/login_handler.go index c98cebd3e1..c1400cadcf 100644 --- a/internal/api/ui/login/login_handler.go +++ b/internal/api/ui/login/login_handler.go @@ -3,7 +3,6 @@ package login import ( "net/http" - "github.com/caos/zitadel/internal/api/authz" http_mw "github.com/caos/zitadel/internal/api/http/middleware" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/errors" @@ -60,9 +59,8 @@ func (l *Login) handleLoginNameCheck(w http.ResponseWriter, r *http.Request) { return } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() loginName := data.LoginName - err = l.authRepo.CheckLoginName(r.Context(), authReq.ID, loginName, userAgentID, instanceID) + err = l.authRepo.CheckLoginName(r.Context(), authReq.ID, loginName, userAgentID) if err != nil { l.renderLogin(w, r, authReq, err) return diff --git a/internal/api/ui/login/mfa_verify_handler.go b/internal/api/ui/login/mfa_verify_handler.go index 175c280434..f4c2d52e59 100644 --- a/internal/api/ui/login/mfa_verify_handler.go +++ b/internal/api/ui/login/mfa_verify_handler.go @@ -3,7 +3,6 @@ package login import ( "net/http" - "github.com/caos/zitadel/internal/api/authz" http_mw "github.com/caos/zitadel/internal/api/http/middleware" "github.com/caos/zitadel/internal/domain" ) @@ -36,8 +35,7 @@ func (l *Login) handleMFAVerify(w http.ResponseWriter, r *http.Request) { } if data.MFAType == domain.MFATypeOTP { userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.VerifyMFAOTP(setContext(r.Context(), authReq.UserOrgID), authReq.ID, authReq.UserID, authReq.UserOrgID, data.Code, userAgentID, instanceID, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.VerifyMFAOTP(setContext(r.Context(), authReq.UserOrgID), authReq.ID, authReq.UserID, authReq.UserOrgID, data.Code, userAgentID, domain.BrowserInfoFromRequest(r)) if err != nil { l.renderMFAVerifySelected(w, r, authReq, step, domain.MFATypeOTP, err) return diff --git a/internal/api/ui/login/mfa_verify_u2f_handler.go b/internal/api/ui/login/mfa_verify_u2f_handler.go index 1a61aae52e..6b85213471 100644 --- a/internal/api/ui/login/mfa_verify_u2f_handler.go +++ b/internal/api/ui/login/mfa_verify_u2f_handler.go @@ -6,7 +6,6 @@ import ( "github.com/caos/zitadel/internal/domain" - "github.com/caos/zitadel/internal/api/authz" http_mw "github.com/caos/zitadel/internal/api/http/middleware" ) @@ -30,8 +29,7 @@ func (l *Login) renderU2FVerification(w http.ResponseWriter, r *http.Request, au var webAuthNLogin *domain.WebAuthNLogin if err == nil { userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - webAuthNLogin, err = l.authRepo.BeginMFAU2FLogin(setContext(r.Context(), authReq.UserOrgID), authReq.UserID, authReq.UserOrgID, authReq.ID, userAgentID, instanceID) + webAuthNLogin, err = l.authRepo.BeginMFAU2FLogin(setContext(r.Context(), authReq.UserOrgID), authReq.UserID, authReq.UserOrgID, authReq.ID, userAgentID) } if err != nil { errID, errMessage = l.getErrorMessage(r, err) @@ -72,8 +70,7 @@ func (l *Login) handleU2FVerification(w http.ResponseWriter, r *http.Request) { return } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.VerifyMFAU2F(setContext(r.Context(), authReq.UserOrgID), authReq.UserID, authReq.UserOrgID, authReq.ID, userAgentID, instanceID, credData, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.VerifyMFAU2F(setContext(r.Context(), authReq.UserOrgID), authReq.UserID, authReq.UserOrgID, authReq.ID, userAgentID, credData, domain.BrowserInfoFromRequest(r)) if err != nil { l.renderU2FVerification(w, r, authReq, step.MFAProviders, err) return diff --git a/internal/api/ui/login/password_handler.go b/internal/api/ui/login/password_handler.go index 32e9ce84be..8e7b7ad4ea 100644 --- a/internal/api/ui/login/password_handler.go +++ b/internal/api/ui/login/password_handler.go @@ -38,7 +38,7 @@ func (l *Login) handlePasswordCheck(w http.ResponseWriter, r *http.Request) { l.renderError(w, r, authReq, err) return } - err = l.authRepo.VerifyPassword(setContext(r.Context(), authReq.UserOrgID), authReq.ID, authReq.UserID, authReq.UserOrgID, data.Password, authReq.AgentID, authReq.InstanceID, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.VerifyPassword(setContext(r.Context(), authReq.UserOrgID), authReq.ID, authReq.UserID, authReq.UserOrgID, data.Password, authReq.AgentID, domain.BrowserInfoFromRequest(r)) if err != nil { l.renderPassword(w, r, authReq, err) return diff --git a/internal/api/ui/login/passwordless_login_handler.go b/internal/api/ui/login/passwordless_login_handler.go index fa6ffe3191..c309b6fb8e 100644 --- a/internal/api/ui/login/passwordless_login_handler.go +++ b/internal/api/ui/login/passwordless_login_handler.go @@ -25,7 +25,7 @@ func (l *Login) renderPasswordlessVerification(w http.ResponseWriter, r *http.Re var errID, errMessage, credentialData string var webAuthNLogin *domain.WebAuthNLogin if err == nil { - webAuthNLogin, err = l.authRepo.BeginPasswordlessLogin(setContext(r.Context(), authReq.UserOrgID), authReq.UserID, authReq.UserOrgID, authReq.ID, authReq.AgentID, authReq.InstanceID) + webAuthNLogin, err = l.authRepo.BeginPasswordlessLogin(setContext(r.Context(), authReq.UserOrgID), authReq.UserID, authReq.UserOrgID, authReq.ID, authReq.AgentID) } if err != nil { errID, errMessage = l.getErrorMessage(r, err) @@ -62,7 +62,7 @@ func (l *Login) handlePasswordlessVerification(w http.ResponseWriter, r *http.Re l.renderPasswordlessVerification(w, r, authReq, formData.PasswordLogin, err) return } - err = l.authRepo.VerifyPasswordless(setContext(r.Context(), authReq.UserOrgID), authReq.UserID, authReq.UserOrgID, authReq.ID, authReq.AgentID, authReq.InstanceID, credData, domain.BrowserInfoFromRequest(r)) + err = l.authRepo.VerifyPasswordless(setContext(r.Context(), authReq.UserOrgID), authReq.UserID, authReq.UserOrgID, authReq.ID, authReq.AgentID, credData, domain.BrowserInfoFromRequest(r)) if err != nil { l.renderPasswordlessVerification(w, r, authReq, formData.PasswordLogin, err) return diff --git a/internal/api/ui/login/passwordless_registration_handler.go b/internal/api/ui/login/passwordless_registration_handler.go index 8a3e2c6963..757b32d412 100644 --- a/internal/api/ui/login/passwordless_registration_handler.go +++ b/internal/api/ui/login/passwordless_registration_handler.go @@ -5,7 +5,6 @@ import ( "net/http" "github.com/caos/logging" - http_mw "github.com/caos/zitadel/internal/api/http/middleware" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore/v1/models" diff --git a/internal/api/ui/login/register_handler.go b/internal/api/ui/login/register_handler.go index 2c47c989dd..cd77477a46 100644 --- a/internal/api/ui/login/register_handler.go +++ b/internal/api/ui/login/register_handler.go @@ -5,7 +5,6 @@ import ( "golang.org/x/text/language" - "github.com/caos/zitadel/internal/api/authz" http_mw "github.com/caos/zitadel/internal/api/http/middleware" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" @@ -95,8 +94,7 @@ func (l *Login) handleRegisterCheck(w http.ResponseWriter, r *http.Request) { return } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.SelectUser(r.Context(), authRequest.ID, user.AggregateID, userAgentID, instanceID) + err = l.authRepo.SelectUser(r.Context(), authRequest.ID, user.AggregateID, userAgentID) if err != nil { l.renderRegister(w, r, authRequest, data, err) return diff --git a/internal/api/ui/login/renderer.go b/internal/api/ui/login/renderer.go index 42c76d8e65..7f0ef8cda5 100644 --- a/internal/api/ui/login/renderer.go +++ b/internal/api/ui/login/renderer.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/caos/logging" + "github.com/caos/zitadel/internal/api/authz" "github.com/gorilla/csrf" "golang.org/x/text/language" @@ -220,7 +221,7 @@ func CreateRenderer(pathPrefix string, staticDir http.FileSystem, staticStorage tmplMapping, funcs, i18n.TranslatorConfig{DefaultLanguage: defaultLanguage, CookieName: cookieName}, ) - logging.Log("APP-40tSoJ").OnError(err).WithError(err).Panic("error creating renderer") + logging.New().OnError(err).WithError(err).Panic("error creating renderer") return r } @@ -229,7 +230,7 @@ func (l *Login) renderNextStep(w http.ResponseWriter, r *http.Request, authReq * l.renderInternalError(w, r, nil, caos_errs.ThrowInvalidArgument(nil, "LOGIN-Df3f2", "Errors.AuthRequest.NotFound")) return } - authReq, err := l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID, authReq.InstanceID) + authReq, err := l.authRepo.AuthRequestByID(r.Context(), authReq.ID, authReq.AgentID) if err != nil { l.renderInternalError(w, r, authReq, err) return @@ -341,7 +342,7 @@ func (l *Login) getBaseData(r *http.Request, authReq *domain.AuthRequest, title Theme: l.getTheme(r), ThemeMode: l.getThemeMode(r), DarkMode: l.isDarkMode(r), - PrivateLabelingOrgID: l.getPrivateLabelingID(authReq), + PrivateLabelingOrgID: l.getPrivateLabelingID(authz.GetInstance(r.Context()).InstanceID(), authReq), OrgID: l.getOrgID(authReq), OrgName: l.getOrgName(authReq), PrimaryDomain: l.getOrgPrimaryDomain(authReq), @@ -455,8 +456,8 @@ func (l *Login) getOrgID(authReq *domain.AuthRequest) string { return authReq.UserOrgID } -func (l *Login) getPrivateLabelingID(authReq *domain.AuthRequest) string { - privateLabelingOrgID := domain.IAMID +func (l *Login) getPrivateLabelingID(instanceID string, authReq *domain.AuthRequest) string { + privateLabelingOrgID := instanceID if authReq == nil { return privateLabelingOrgID } diff --git a/internal/api/ui/login/resources_handler.go b/internal/api/ui/login/resources_handler.go index dbb6aad26c..b2cce55be2 100644 --- a/internal/api/ui/login/resources_handler.go +++ b/internal/api/ui/login/resources_handler.go @@ -4,6 +4,7 @@ import ( "context" "net/http" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" ) @@ -24,7 +25,7 @@ func (l *Login) handleDynamicResources(w http.ResponseWriter, r *http.Request) { return } - bucketName := domain.IAMID + bucketName := authz.GetInstance(r.Context()).InstanceID() if data.OrgID != "" && !data.DefaultPolicy { bucketName = data.OrgID } diff --git a/internal/api/ui/login/select_user_handler.go b/internal/api/ui/login/select_user_handler.go index b2f2597837..aad30927e8 100644 --- a/internal/api/ui/login/select_user_handler.go +++ b/internal/api/ui/login/select_user_handler.go @@ -5,7 +5,6 @@ import ( "github.com/caos/zitadel/internal/domain" - "github.com/caos/zitadel/internal/api/authz" http_mw "github.com/caos/zitadel/internal/api/http/middleware" ) @@ -39,8 +38,7 @@ func (l *Login) handleSelectUser(w http.ResponseWriter, r *http.Request) { return } userAgentID, _ := http_mw.UserAgentIDFromCtx(r.Context()) - instanceID := authz.GetInstance(r.Context()).InstanceID() - err = l.authRepo.SelectUser(r.Context(), authSession.ID, data.UserID, userAgentID, instanceID) + err = l.authRepo.SelectUser(r.Context(), authSession.ID, data.UserID, userAgentID) if err != nil { l.renderError(w, r, authSession, err) return diff --git a/internal/auth/repository/auth_request.go b/internal/auth/repository/auth_request.go index 79eb549969..423d7f453e 100644 --- a/internal/auth/repository/auth_request.go +++ b/internal/auth/repository/auth_request.go @@ -8,30 +8,30 @@ import ( type AuthRequestRepository interface { CreateAuthRequest(ctx context.Context, request *domain.AuthRequest) (*domain.AuthRequest, error) - AuthRequestByID(ctx context.Context, id, userAgentID, instanceID string) (*domain.AuthRequest, error) - AuthRequestByIDCheckLoggedIn(ctx context.Context, id, userAgentID, instanceID string) (*domain.AuthRequest, error) - AuthRequestByCode(ctx context.Context, code, instanceID string) (*domain.AuthRequest, error) - SaveAuthCode(ctx context.Context, id, code, userAgentID, instanceID string) error - DeleteAuthRequest(ctx context.Context, id, instanceID string) error + AuthRequestByID(ctx context.Context, id, userAgentID string) (*domain.AuthRequest, error) + AuthRequestByIDCheckLoggedIn(ctx context.Context, id, userAgentID string) (*domain.AuthRequest, error) + AuthRequestByCode(ctx context.Context, code string) (*domain.AuthRequest, error) + SaveAuthCode(ctx context.Context, id, code, userAgentID string) error + DeleteAuthRequest(ctx context.Context, id string) error - CheckLoginName(ctx context.Context, id, loginName, userAgentID, instanceID string) error - CheckExternalUserLogin(ctx context.Context, authReqID, userAgentID, instanceID string, user *domain.ExternalUser, info *domain.BrowserInfo) error - SetExternalUserLogin(ctx context.Context, authReqID, userAgentID, instanceID string, user *domain.ExternalUser) error - SelectUser(ctx context.Context, id, userID, userAgentID, instanceID string) error - SelectExternalIDP(ctx context.Context, authReqID, idpConfigID, userAgentID, instanceID string) error - VerifyPassword(ctx context.Context, id, userID, resourceOwner, password, userAgentID, instanceID string, info *domain.BrowserInfo) error + CheckLoginName(ctx context.Context, id, loginName, userAgentID string) error + CheckExternalUserLogin(ctx context.Context, authReqID, userAgentID string, user *domain.ExternalUser, info *domain.BrowserInfo) error + SetExternalUserLogin(ctx context.Context, authReqID, userAgentID string, user *domain.ExternalUser) error + SelectUser(ctx context.Context, id, userID, userAgentID string) error + SelectExternalIDP(ctx context.Context, authReqID, idpConfigID, userAgentID string) error + VerifyPassword(ctx context.Context, id, userID, resourceOwner, password, userAgentID string, info *domain.BrowserInfo) error - VerifyMFAOTP(ctx context.Context, authRequestID, userID, resourceOwner, code, userAgentID, instanceID string, info *domain.BrowserInfo) error - BeginMFAU2FLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID, instanceID string) (*domain.WebAuthNLogin, error) - VerifyMFAU2F(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID, instanceID string, credentialData []byte, info *domain.BrowserInfo) error + VerifyMFAOTP(ctx context.Context, authRequestID, userID, resourceOwner, code, userAgentID string, info *domain.BrowserInfo) error + BeginMFAU2FLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string) (*domain.WebAuthNLogin, error) + VerifyMFAU2F(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string, credentialData []byte, info *domain.BrowserInfo) error BeginPasswordlessSetup(ctx context.Context, userID, resourceOwner string, preferredPlatformType domain.AuthenticatorAttachment) (login *domain.WebAuthNToken, err error) VerifyPasswordlessSetup(ctx context.Context, userID, resourceOwner, userAgentID, tokenName string, credentialData []byte) (err error) BeginPasswordlessInitCodeSetup(ctx context.Context, userID, resourceOwner, codeID, verificationCode string, preferredPlatformType domain.AuthenticatorAttachment) (login *domain.WebAuthNToken, err error) VerifyPasswordlessInitCodeSetup(ctx context.Context, userID, resourceOwner, userAgentID, tokenName, codeID, verificationCode string, credentialData []byte) (err error) - BeginPasswordlessLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID, instanceID string) (*domain.WebAuthNLogin, error) - VerifyPasswordless(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID, instanceID string, credentialData []byte, info *domain.BrowserInfo) error + BeginPasswordlessLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string) (*domain.WebAuthNLogin, error) + VerifyPasswordless(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string, credentialData []byte, info *domain.BrowserInfo) error - LinkExternalUsers(ctx context.Context, authReqID, userAgentID, instanceID string, info *domain.BrowserInfo) error - AutoRegisterExternalUser(ctx context.Context, user *domain.Human, externalIDP *domain.UserIDPLink, orgMemberRoles []string, authReqID, userAgentID, resourceOwner, instanceID string, metadatas []*domain.Metadata, info *domain.BrowserInfo) error - ResetLinkingUsers(ctx context.Context, authReqID, userAgentID, instanceID string) error + LinkExternalUsers(ctx context.Context, authReqID, userAgentID string, info *domain.BrowserInfo) error + AutoRegisterExternalUser(ctx context.Context, user *domain.Human, externalIDP *domain.UserIDPLink, orgMemberRoles []string, authReqID, userAgentID, resourceOwner string, metadatas []*domain.Metadata, info *domain.BrowserInfo) error + ResetLinkingUsers(ctx context.Context, authReqID, userAgentID string) error } diff --git a/internal/auth/repository/eventsourcing/eventstore/auth_request.go b/internal/auth/repository/eventsourcing/eventstore/auth_request.go index 8f2c320d63..d9e29a03c8 100644 --- a/internal/auth/repository/eventsourcing/eventstore/auth_request.go +++ b/internal/auth/repository/eventsourcing/eventstore/auth_request.go @@ -156,22 +156,22 @@ func (repo *AuthRequestRepo) CreateAuthRequest(ctx context.Context, request *dom return request, nil } -func (repo *AuthRequestRepo) AuthRequestByID(ctx context.Context, id, userAgentID, instanceID string) (_ *domain.AuthRequest, err error) { +func (repo *AuthRequestRepo) AuthRequestByID(ctx context.Context, id, userAgentID string) (_ *domain.AuthRequest, err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - return repo.getAuthRequestNextSteps(ctx, id, userAgentID, instanceID, false) + return repo.getAuthRequestNextSteps(ctx, id, userAgentID, false) } -func (repo *AuthRequestRepo) AuthRequestByIDCheckLoggedIn(ctx context.Context, id, userAgentID, instanceID string) (_ *domain.AuthRequest, err error) { +func (repo *AuthRequestRepo) AuthRequestByIDCheckLoggedIn(ctx context.Context, id, userAgentID string) (_ *domain.AuthRequest, err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - return repo.getAuthRequestNextSteps(ctx, id, userAgentID, instanceID, true) + return repo.getAuthRequestNextSteps(ctx, id, userAgentID, true) } -func (repo *AuthRequestRepo) SaveAuthCode(ctx context.Context, id, code, userAgentID, instanceID string) (err error) { +func (repo *AuthRequestRepo) SaveAuthCode(ctx context.Context, id, code, userAgentID string) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequest(ctx, id, userAgentID, instanceID) + request, err := repo.getAuthRequest(ctx, id, userAgentID) if err != nil { return err } @@ -179,10 +179,10 @@ func (repo *AuthRequestRepo) SaveAuthCode(ctx context.Context, id, code, userAge return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) AuthRequestByCode(ctx context.Context, code, instanceID string) (_ *domain.AuthRequest, err error) { +func (repo *AuthRequestRepo) AuthRequestByCode(ctx context.Context, code string) (_ *domain.AuthRequest, err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.AuthRequests.GetAuthRequestByCode(ctx, code, instanceID) + request, err := repo.AuthRequests.GetAuthRequestByCode(ctx, code) if err != nil { return nil, err } @@ -198,16 +198,16 @@ func (repo *AuthRequestRepo) AuthRequestByCode(ctx context.Context, code, instan return request, nil } -func (repo *AuthRequestRepo) DeleteAuthRequest(ctx context.Context, id, instanceID string) (err error) { +func (repo *AuthRequestRepo) DeleteAuthRequest(ctx context.Context, id string) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - return repo.AuthRequests.DeleteAuthRequest(ctx, id, instanceID) + return repo.AuthRequests.DeleteAuthRequest(ctx, id) } -func (repo *AuthRequestRepo) CheckLoginName(ctx context.Context, id, loginName, userAgentID, instanceID string) (err error) { +func (repo *AuthRequestRepo) CheckLoginName(ctx context.Context, id, loginName, userAgentID string) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequest(ctx, id, userAgentID, instanceID) + request, err := repo.getAuthRequest(ctx, id, userAgentID) if err != nil { return err } @@ -218,10 +218,10 @@ func (repo *AuthRequestRepo) CheckLoginName(ctx context.Context, id, loginName, return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) SelectExternalIDP(ctx context.Context, authReqID, idpConfigID, userAgentID, instanceID string) (err error) { +func (repo *AuthRequestRepo) SelectExternalIDP(ctx context.Context, authReqID, idpConfigID, userAgentID string) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequest(ctx, authReqID, userAgentID, instanceID) + request, err := repo.getAuthRequest(ctx, authReqID, userAgentID) if err != nil { return err } @@ -232,10 +232,10 @@ func (repo *AuthRequestRepo) SelectExternalIDP(ctx context.Context, authReqID, i return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) CheckExternalUserLogin(ctx context.Context, authReqID, userAgentID, instanceID string, externalUser *domain.ExternalUser, info *domain.BrowserInfo) (err error) { +func (repo *AuthRequestRepo) CheckExternalUserLogin(ctx context.Context, authReqID, userAgentID string, externalUser *domain.ExternalUser, info *domain.BrowserInfo) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequest(ctx, authReqID, userAgentID, instanceID) + request, err := repo.getAuthRequest(ctx, authReqID, userAgentID) if err != nil { return err } @@ -257,10 +257,10 @@ func (repo *AuthRequestRepo) CheckExternalUserLogin(ctx context.Context, authReq return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) SetExternalUserLogin(ctx context.Context, authReqID, userAgentID, instanceID string, externalUser *domain.ExternalUser) (err error) { +func (repo *AuthRequestRepo) SetExternalUserLogin(ctx context.Context, authReqID, userAgentID string, externalUser *domain.ExternalUser) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequest(ctx, authReqID, userAgentID, instanceID) + request, err := repo.getAuthRequest(ctx, authReqID, userAgentID) if err != nil { return err } @@ -277,10 +277,10 @@ func (repo *AuthRequestRepo) setLinkingUser(ctx context.Context, request *domain return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) SelectUser(ctx context.Context, id, userID, userAgentID, instanceID string) (err error) { +func (repo *AuthRequestRepo) SelectUser(ctx context.Context, id, userID, userAgentID string) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequest(ctx, id, userAgentID, instanceID) + request, err := repo.getAuthRequest(ctx, id, userAgentID) if err != nil { return err } @@ -299,10 +299,10 @@ func (repo *AuthRequestRepo) SelectUser(ctx context.Context, id, userID, userAge return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) VerifyPassword(ctx context.Context, id, userID, resourceOwner, password, userAgentID, instanceID string, info *domain.BrowserInfo) (err error) { +func (repo *AuthRequestRepo) VerifyPassword(ctx context.Context, authReqID, userID, resourceOwner, password, userAgentID string, info *domain.BrowserInfo) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequestEnsureUser(ctx, id, userAgentID, userID, instanceID) + request, err := repo.getAuthRequestEnsureUser(ctx, authReqID, userAgentID, userID) if err != nil { return err } @@ -328,31 +328,31 @@ func lockoutPolicyToDomain(policy *query.LockoutPolicy) *domain.LockoutPolicy { } } -func (repo *AuthRequestRepo) VerifyMFAOTP(ctx context.Context, authRequestID, userID, resourceOwner, code, userAgentID, instanceID string, info *domain.BrowserInfo) (err error) { +func (repo *AuthRequestRepo) VerifyMFAOTP(ctx context.Context, authRequestID, userID, resourceOwner, code, userAgentID string, info *domain.BrowserInfo) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID, instanceID) + request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID) if err != nil { return err } return repo.Command.HumanCheckMFAOTP(ctx, userID, code, resourceOwner, request.WithCurrentInfo(info)) } -func (repo *AuthRequestRepo) BeginMFAU2FLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID, instanceID string) (login *domain.WebAuthNLogin, err error) { +func (repo *AuthRequestRepo) BeginMFAU2FLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string) (login *domain.WebAuthNLogin, err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID, instanceID) + request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID) if err != nil { return nil, err } return repo.Command.HumanBeginU2FLogin(ctx, userID, resourceOwner, request, true) } -func (repo *AuthRequestRepo) VerifyMFAU2F(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID, instanceID string, credentialData []byte, info *domain.BrowserInfo) (err error) { +func (repo *AuthRequestRepo) VerifyMFAU2F(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string, credentialData []byte, info *domain.BrowserInfo) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID, instanceID) + request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID) if err != nil { return err } @@ -393,30 +393,30 @@ func (repo *AuthRequestRepo) VerifyPasswordlessInitCodeSetup(ctx context.Context return err } -func (repo *AuthRequestRepo) BeginPasswordlessLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID, instanceID string) (login *domain.WebAuthNLogin, err error) { +func (repo *AuthRequestRepo) BeginPasswordlessLogin(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string) (login *domain.WebAuthNLogin, err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID, instanceID) + request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID) if err != nil { return nil, err } return repo.Command.HumanBeginPasswordlessLogin(ctx, userID, resourceOwner, request, true) } -func (repo *AuthRequestRepo) VerifyPasswordless(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID, instanceID string, credentialData []byte, info *domain.BrowserInfo) (err error) { +func (repo *AuthRequestRepo) VerifyPasswordless(ctx context.Context, userID, resourceOwner, authRequestID, userAgentID string, credentialData []byte, info *domain.BrowserInfo) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID, instanceID) + request, err := repo.getAuthRequestEnsureUser(ctx, authRequestID, userAgentID, userID) if err != nil { return err } return repo.Command.HumanFinishPasswordlessLogin(ctx, userID, resourceOwner, credentialData, request, true) } -func (repo *AuthRequestRepo) LinkExternalUsers(ctx context.Context, authReqID, userAgentID, instanceID string, info *domain.BrowserInfo) (err error) { +func (repo *AuthRequestRepo) LinkExternalUsers(ctx context.Context, authReqID, userAgentID string, info *domain.BrowserInfo) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequest(ctx, authReqID, userAgentID, instanceID) + request, err := repo.getAuthRequest(ctx, authReqID, userAgentID) if err != nil { return err } @@ -432,8 +432,8 @@ func (repo *AuthRequestRepo) LinkExternalUsers(ctx context.Context, authReqID, u return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) ResetLinkingUsers(ctx context.Context, authReqID, userAgentID, instanceID string) error { - request, err := repo.getAuthRequest(ctx, authReqID, userAgentID, instanceID) +func (repo *AuthRequestRepo) ResetLinkingUsers(ctx context.Context, authReqID, userAgentID string) error { + request, err := repo.getAuthRequest(ctx, authReqID, userAgentID) if err != nil { return err } @@ -442,10 +442,10 @@ func (repo *AuthRequestRepo) ResetLinkingUsers(ctx context.Context, authReqID, u return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) AutoRegisterExternalUser(ctx context.Context, registerUser *domain.Human, externalIDP *domain.UserIDPLink, orgMemberRoles []string, authReqID, userAgentID, resourceOwner, instanceID string, metadatas []*domain.Metadata, info *domain.BrowserInfo) (err error) { +func (repo *AuthRequestRepo) AutoRegisterExternalUser(ctx context.Context, registerUser *domain.Human, externalIDP *domain.UserIDPLink, orgMemberRoles []string, authReqID, userAgentID, resourceOwner string, metadatas []*domain.Metadata, info *domain.BrowserInfo) (err error) { ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - request, err := repo.getAuthRequest(ctx, authReqID, userAgentID, instanceID) + request, err := repo.getAuthRequest(ctx, authReqID, userAgentID) if err != nil { return err } @@ -478,8 +478,8 @@ func (repo *AuthRequestRepo) AutoRegisterExternalUser(ctx context.Context, regis return repo.AuthRequests.UpdateAuthRequest(ctx, request) } -func (repo *AuthRequestRepo) getAuthRequestNextSteps(ctx context.Context, id, userAgentID, instanceID string, checkLoggedIn bool) (*domain.AuthRequest, error) { - request, err := repo.getAuthRequest(ctx, id, userAgentID, instanceID) +func (repo *AuthRequestRepo) getAuthRequestNextSteps(ctx context.Context, id, userAgentID string, checkLoggedIn bool) (*domain.AuthRequest, error) { + request, err := repo.getAuthRequest(ctx, id, userAgentID) if err != nil { return nil, err } @@ -491,8 +491,8 @@ func (repo *AuthRequestRepo) getAuthRequestNextSteps(ctx context.Context, id, us return request, nil } -func (repo *AuthRequestRepo) getAuthRequestEnsureUser(ctx context.Context, authRequestID, userAgentID, userID, instanceID string) (*domain.AuthRequest, error) { - request, err := repo.getAuthRequest(ctx, authRequestID, userAgentID, instanceID) +func (repo *AuthRequestRepo) getAuthRequestEnsureUser(ctx context.Context, authRequestID, userAgentID, userID string) (*domain.AuthRequest, error) { + request, err := repo.getAuthRequest(ctx, authRequestID, userAgentID) if err != nil { return nil, err } @@ -506,8 +506,8 @@ func (repo *AuthRequestRepo) getAuthRequestEnsureUser(ctx context.Context, authR return request, nil } -func (repo *AuthRequestRepo) getAuthRequest(ctx context.Context, id, userAgentID, instanceID string) (*domain.AuthRequest, error) { - request, err := repo.AuthRequests.GetAuthRequestByID(ctx, id, instanceID) +func (repo *AuthRequestRepo) getAuthRequest(ctx context.Context, id, userAgentID string) (*domain.AuthRequest, error) { + request, err := repo.AuthRequests.GetAuthRequestByID(ctx, id) if err != nil { return nil, err } @@ -529,7 +529,7 @@ func (repo *AuthRequestRepo) getLoginPolicyAndIDPProviders(ctx context.Context, if !policy.AllowExternalIDPs { return policy, nil, nil } - idpProviders, err := getLoginPolicyIDPProviders(repo.IDPProviderViewProvider, domain.IAMID, orgID, policy.IsDefault) + idpProviders, err := getLoginPolicyIDPProviders(repo.IDPProviderViewProvider, authz.GetInstance(ctx).InstanceID(), orgID, policy.IsDefault) if err != nil { return nil, nil, err } @@ -544,7 +544,7 @@ func (repo *AuthRequestRepo) fillPolicies(ctx context.Context, request *domain.A orgID = request.UserOrgID } if orgID == "" { - orgID = domain.IAMID + orgID = authz.GetInstance(ctx).InstanceID() } loginPolicy, idpProviders, err := repo.getLoginPolicyAndIDPProviders(ctx, orgID) @@ -565,7 +565,7 @@ func (repo *AuthRequestRepo) fillPolicies(ctx context.Context, request *domain.A return err } request.PrivacyPolicy = privacyPolicy - privateLabelingOrgID := domain.IAMID + privateLabelingOrgID := authz.GetInstance(ctx).InstanceID() if request.PrivateLabelingSetting != domain.PrivateLabelingSettingUnspecified { privateLabelingOrgID = request.ApplicationResourceOwner } @@ -582,7 +582,7 @@ func (repo *AuthRequestRepo) fillPolicies(ctx context.Context, request *domain.A return err } request.LabelPolicy = labelPolicy - defaultLoginTranslations, err := repo.getLoginTexts(ctx, domain.IAMID) + defaultLoginTranslations, err := repo.getLoginTexts(ctx, authz.GetInstance(ctx).InstanceID()) if err != nil { return err } diff --git a/internal/auth/repository/eventsourcing/eventstore/org.go b/internal/auth/repository/eventsourcing/eventstore/org.go index d5ad978432..543e61cac8 100644 --- a/internal/auth/repository/eventsourcing/eventstore/org.go +++ b/internal/auth/repository/eventsourcing/eventstore/org.go @@ -8,11 +8,9 @@ import ( "github.com/caos/zitadel/internal/config/systemdefaults" "github.com/caos/zitadel/internal/domain" eventstore "github.com/caos/zitadel/internal/eventstore/v1" - "github.com/caos/zitadel/internal/eventstore/v1/models" iam_model "github.com/caos/zitadel/internal/iam/model" iam_view_model "github.com/caos/zitadel/internal/iam/repository/view/model" "github.com/caos/zitadel/internal/query" - "github.com/caos/zitadel/internal/repository/instance" ) type OrgRepository struct { @@ -41,7 +39,7 @@ func (repo *OrgRepository) GetMyPasswordComplexityPolicy(ctx context.Context) (* } func (repo *OrgRepository) GetLoginText(ctx context.Context, orgID string) ([]*domain.CustomText, error) { - loginTexts, err := repo.Query.CustomTextListByTemplate(ctx, domain.IAMID, domain.LoginCustomText) + loginTexts, err := repo.Query.CustomTextListByTemplate(ctx, authz.GetInstance(ctx).InstanceID(), domain.LoginCustomText) if err != nil { return nil, err } @@ -51,7 +49,3 @@ func (repo *OrgRepository) GetLoginText(ctx context.Context, orgID string) ([]*d } return append(query.CustomTextsToDomain(loginTexts), query.CustomTextsToDomain(orgLoginTexts)...), nil } - -func (p *OrgRepository) getIAMEvents(ctx context.Context, sequence uint64) ([]*models.Event, error) { - return p.Eventstore.FilterEvents(ctx, models.NewSearchQuery().AggregateIDFilter(domain.IAMID).AggregateTypeFilter(instance.AggregateType)) -} diff --git a/internal/auth/repository/eventsourcing/handler/idp_providers.go b/internal/auth/repository/eventsourcing/handler/idp_providers.go index 259855075d..b1026af09d 100644 --- a/internal/auth/repository/eventsourcing/handler/idp_providers.go +++ b/internal/auth/repository/eventsourcing/handler/idp_providers.go @@ -4,7 +4,6 @@ import ( "context" "github.com/caos/logging" - "github.com/caos/zitadel/internal/config/systemdefaults" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" @@ -113,7 +112,7 @@ func (i *IDPProvider) processIdpProvider(event *models.Event) (err error) { case instance.IDPConfigChangedEventType, org.IDPConfigChangedEventType: esConfig := new(iam_view_model.IDPConfigView) providerType := iam_model.IDPProviderTypeSystem - if event.AggregateID != domain.IAMID { + if event.AggregateID != event.InstanceID { providerType = iam_model.IDPProviderTypeOrg } esConfig.AppendEvent(providerType, event) @@ -122,7 +121,7 @@ func (i *IDPProvider) processIdpProvider(event *models.Event) (err error) { return err } config := new(query2.IDP) - if event.AggregateID == domain.IAMID { + if event.AggregateID == event.InstanceID { config, err = i.getDefaultIDPConfig(event.InstanceID, esConfig.IDPConfigID) } else { config, err = i.getOrgIDPConfig(event.InstanceID, event.AggregateID, esConfig.IDPConfigID) @@ -180,7 +179,7 @@ func (i *IDPProvider) fillConfigData(provider *iam_view_model.IDPProviderView, c } func (i *IDPProvider) OnError(event *es_models.Event, err error) error { - logging.LogWithFields("SPOOL-Fjd89", "id", event.AggregateID).WithError(err).Warn("something went wrong in idp provider handler") + logging.WithFields("id", event.AggregateID).WithError(err).Warn("something went wrong in idp provider handler") return spooler.HandleError(event, err, i.view.GetLatestIDPProviderFailedEvent, i.view.ProcessedIDPProviderFailedEvent, i.view.ProcessedIDPProviderSequence, i.errorCountUntilSkip) } @@ -193,5 +192,5 @@ func (i *IDPProvider) getOrgIDPConfig(instanceID, aggregateID, idpConfigID strin } func (u *IDPProvider) getDefaultIDPConfig(instanceID, idpConfigID string) (*query2.IDP, error) { - return u.queries.IDPByIDAndResourceOwner(withInstanceID(context.Background(), instanceID), idpConfigID, domain.IAMID) + return u.queries.IDPByIDAndResourceOwner(withInstanceID(context.Background(), instanceID), idpConfigID, instanceID) } diff --git a/internal/auth/repository/eventsourcing/handler/user_external_idps.go b/internal/auth/repository/eventsourcing/handler/user_external_idps.go index e7f2fa8c9d..7478500e0e 100644 --- a/internal/auth/repository/eventsourcing/handler/user_external_idps.go +++ b/internal/auth/repository/eventsourcing/handler/user_external_idps.go @@ -6,7 +6,6 @@ import ( "github.com/caos/logging" "github.com/caos/zitadel/internal/config/systemdefaults" - "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" v1 "github.com/caos/zitadel/internal/eventstore/v1" @@ -186,5 +185,5 @@ func (i *ExternalIDP) getOrgIDPConfig(instanceID, aggregateID, idpConfigID strin } func (i *ExternalIDP) getDefaultIDPConfig(instanceID, idpConfigID string) (*query2.IDP, error) { - return i.queries.IDPByIDAndResourceOwner(withInstanceID(context.Background(), instanceID), idpConfigID, domain.IAMID) + return i.queries.IDPByIDAndResourceOwner(withInstanceID(context.Background(), instanceID), idpConfigID, instanceID) } diff --git a/internal/auth_request/repository/cache/cache.go b/internal/auth_request/repository/cache/cache.go index f311d79891..5446c3c6a9 100644 --- a/internal/auth_request/repository/cache/cache.go +++ b/internal/auth_request/repository/cache/cache.go @@ -8,6 +8,7 @@ import ( "fmt" "time" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" ) @@ -26,12 +27,12 @@ func (c *AuthRequestCache) Health(ctx context.Context) error { return c.client.PingContext(ctx) } -func (c *AuthRequestCache) GetAuthRequestByID(_ context.Context, id, instanceID string) (*domain.AuthRequest, error) { - return c.getAuthRequest("id", id, instanceID) +func (c *AuthRequestCache) GetAuthRequestByID(ctx context.Context, id string) (*domain.AuthRequest, error) { + return c.getAuthRequest("id", id, authz.GetInstance(ctx).InstanceID()) } -func (c *AuthRequestCache) GetAuthRequestByCode(_ context.Context, code, instanceID string) (*domain.AuthRequest, error) { - return c.getAuthRequest("code", code, instanceID) +func (c *AuthRequestCache) GetAuthRequestByCode(ctx context.Context, code string) (*domain.AuthRequest, error) { + return c.getAuthRequest("code", code, authz.GetInstance(ctx).InstanceID()) } func (c *AuthRequestCache) SaveAuthRequest(_ context.Context, request *domain.AuthRequest) error { @@ -45,8 +46,8 @@ func (c *AuthRequestCache) UpdateAuthRequest(_ context.Context, request *domain. return c.saveAuthRequest(request, "UPDATE auth.auth_requests SET request = $2, instance_id = $3, change_date = $4, code = $5 WHERE id = $1", request.ChangeDate, request.Code) } -func (c *AuthRequestCache) DeleteAuthRequest(_ context.Context, id, instanceID string) error { - _, err := c.client.Exec("DELETE FROM auth.auth_requests WHERE instance_id = $1 and id = $2", instanceID, id) +func (c *AuthRequestCache) DeleteAuthRequest(ctx context.Context, id string) error { + _, err := c.client.Exec("DELETE FROM auth.auth_requests WHERE instance_id = $1 and id = $2", authz.GetInstance(ctx).InstanceID(), id) if err != nil { return caos_errs.ThrowInternal(err, "CACHE-dsHw3", "unable to delete auth request") } diff --git a/internal/auth_request/repository/repository.go b/internal/auth_request/repository/repository.go index b86fb74ab6..f089ad9bbe 100644 --- a/internal/auth_request/repository/repository.go +++ b/internal/auth_request/repository/repository.go @@ -9,9 +9,9 @@ import ( type AuthRequestCache interface { Health(ctx context.Context) error - GetAuthRequestByID(ctx context.Context, id, instanceID string) (*domain.AuthRequest, error) - GetAuthRequestByCode(ctx context.Context, code, instanceID string) (*domain.AuthRequest, error) + GetAuthRequestByID(ctx context.Context, id string) (*domain.AuthRequest, error) + GetAuthRequestByCode(ctx context.Context, code string) (*domain.AuthRequest, error) SaveAuthRequest(ctx context.Context, request *domain.AuthRequest) error UpdateAuthRequest(ctx context.Context, request *domain.AuthRequest) error - DeleteAuthRequest(ctx context.Context, id, instanceID string) error + DeleteAuthRequest(ctx context.Context, id string) error } diff --git a/internal/authz/repository/eventsourcing/eventstore/user_membership.go b/internal/authz/repository/eventsourcing/eventstore/user_membership.go index fd3bce964f..94f4aaf93b 100644 --- a/internal/authz/repository/eventsourcing/eventstore/user_membership.go +++ b/internal/authz/repository/eventsourcing/eventstore/user_membership.go @@ -61,7 +61,7 @@ func (repo *UserMembershipRepo) searchUserMemberships(ctx context.Context) ([]*u { Key: user_model.UserMembershipSearchKeyAggregateID, Method: domain.SearchMethodEquals, - Value: domain.IAMID, + Value: instance.InstanceID(), }, { Key: user_model.UserMembershipSearchKeyInstanceID, diff --git a/internal/command/instancce_policy_password_age_model.go b/internal/command/instancce_policy_password_age_model.go index 72b53d1791..292b20bf24 100644 --- a/internal/command/instancce_policy_password_age_model.go +++ b/internal/command/instancce_policy_password_age_model.go @@ -3,9 +3,9 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" ) @@ -14,12 +14,12 @@ type InstancePasswordAgePolicyWriteModel struct { PasswordAgePolicyWriteModel } -func NewInstancePasswordAgePolicyWriteModel() *InstancePasswordAgePolicyWriteModel { +func NewInstancePasswordAgePolicyWriteModel(ctx context.Context) *InstancePasswordAgePolicyWriteModel { return &InstancePasswordAgePolicyWriteModel{ PasswordAgePolicyWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance.go b/internal/command/instance.go deleted file mode 100644 index b37a0ed2a2..0000000000 --- a/internal/command/instance.go +++ /dev/null @@ -1,74 +0,0 @@ -package command - -import ( - "context" - - "github.com/caos/zitadel/internal/domain" - caos_errs "github.com/caos/zitadel/internal/errors" - "github.com/caos/zitadel/internal/eventstore" - "github.com/caos/zitadel/internal/repository/instance" - "github.com/caos/zitadel/internal/telemetry/tracing" - "golang.org/x/text/language" -) - -//TODO: private as soon as setup uses query -func (c *Commands) GetInstance(ctx context.Context) (*domain.Instance, error) { - iamWriteModel := NewInstanceWriteModel() - err := c.eventstore.FilterToQueryReducer(ctx, iamWriteModel) - if err != nil { - return nil, err - } - return writeModelToInstance(iamWriteModel), nil -} - -func (c *Commands) setGlobalOrg(ctx context.Context, iamAgg *eventstore.Aggregate, iamWriteModel *InstanceWriteModel, orgID string) (eventstore.Command, error) { - err := c.eventstore.FilterToQueryReducer(ctx, iamWriteModel) - if err != nil { - return nil, err - } - if iamWriteModel.GlobalOrgID != "" { - return nil, caos_errs.ThrowPreconditionFailed(nil, "IAM-HGG24", "Errors.IAM.GlobalOrgAlreadySet") - } - return instance.NewGlobalOrgSetEventEvent(ctx, iamAgg, orgID), nil -} - -func (c *Commands) setIAMProject(ctx context.Context, iamAgg *eventstore.Aggregate, iamWriteModel *InstanceWriteModel, projectID string) (eventstore.Command, error) { - err := c.eventstore.FilterToQueryReducer(ctx, iamWriteModel) - if err != nil { - return nil, err - } - if iamWriteModel.ProjectID != "" { - return nil, caos_errs.ThrowPreconditionFailed(nil, "IAM-EGbw2", "Errors.IAM.IAMProjectAlreadySet") - } - return instance.NewIAMProjectSetEvent(ctx, iamAgg, projectID), nil -} - -func (c *Commands) SetDefaultLanguage(ctx context.Context, language language.Tag) (*domain.ObjectDetails, error) { - iamWriteModel, err := c.getIAMWriteModel(ctx) - if err != nil { - return nil, err - } - iamAgg := InstanceAggregateFromWriteModel(&iamWriteModel.WriteModel) - pushedEvents, err := c.eventstore.Push(ctx, instance.NewDefaultLanguageSetEvent(ctx, iamAgg, language)) - if err != nil { - return nil, err - } - err = AppendAndReduce(iamWriteModel, pushedEvents...) - if err != nil { - return nil, err - } - return writeModelToObjectDetails(&iamWriteModel.WriteModel), nil -} - -func (c *Commands) getIAMWriteModel(ctx context.Context) (_ *InstanceWriteModel, err error) { - ctx, span := tracing.NewSpan(ctx) - defer func() { span.EndWithError(err) }() - - writeModel := NewInstanceWriteModel() - err = c.eventstore.FilterToQueryReducer(ctx, writeModel) - if err != nil { - return nil, err - } - - return writeModel, nil -} diff --git a/internal/command/instance_converter.go b/internal/command/instance_converter.go index 9fca854b88..627a3ea341 100644 --- a/internal/command/instance_converter.go +++ b/internal/command/instance_converter.go @@ -8,6 +8,7 @@ import ( func writeModelToObjectRoot(writeModel eventstore.WriteModel) models.ObjectRoot { return models.ObjectRoot{ + InstanceID: writeModel.InstanceID, AggregateID: writeModel.AggregateID, ChangeDate: writeModel.ChangeDate, ResourceOwner: writeModel.ResourceOwner, @@ -15,16 +16,6 @@ func writeModelToObjectRoot(writeModel eventstore.WriteModel) models.ObjectRoot } } -func writeModelToInstance(wm *InstanceWriteModel) *domain.Instance { - return &domain.Instance{ - ObjectRoot: writeModelToObjectRoot(wm.WriteModel), - SetUpStarted: wm.SetUpStarted, - SetUpDone: wm.SetUpDone, - GlobalOrgID: wm.GlobalOrgID, - IAMProjectID: wm.ProjectID, - } -} - func memberWriteModelToMember(writeModel *MemberWriteModel) *domain.Member { return &domain.Member{ ObjectRoot: writeModelToObjectRoot(writeModel.WriteModel), diff --git a/internal/command/instance_custom_login_text.go b/internal/command/instance_custom_login_text.go index bcae2c672a..22d5be6b01 100644 --- a/internal/command/instance_custom_login_text.go +++ b/internal/command/instance_custom_login_text.go @@ -3,6 +3,7 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "golang.org/x/text/language" "github.com/caos/zitadel/internal/domain" @@ -12,7 +13,7 @@ import ( ) func (c *Commands) SetCustomInstanceLoginText(ctx context.Context, loginText *domain.CustomLoginText) (*domain.ObjectDetails, error) { - iamAgg := instance.NewAggregate() + iamAgg := instance.NewAggregate(authz.GetInstance(ctx).InstanceID()) events, existingMailText, err := c.setCustomInstanceLoginText(ctx, &iamAgg.Aggregate, loginText) if err != nil { return nil, err @@ -62,7 +63,7 @@ func (c *Commands) setCustomInstanceLoginText(ctx context.Context, instanceAgg * } func (c *Commands) defaultLoginTextWriteModelByID(ctx context.Context, lang language.Tag) (*InstanceCustomLoginTextReadModel, error) { - writeModel := NewInstanceCustomLoginTextReadModel(lang) + writeModel := NewInstanceCustomLoginTextReadModel(ctx, lang) err := c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_custom_login_text_model.go b/internal/command/instance_custom_login_text_model.go index 72b4011e39..4a7e5d319b 100644 --- a/internal/command/instance_custom_login_text_model.go +++ b/internal/command/instance_custom_login_text_model.go @@ -1,9 +1,11 @@ package command import ( + "context" + + "github.com/caos/zitadel/internal/api/authz" "golang.org/x/text/language" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" ) @@ -12,12 +14,12 @@ type InstanceCustomLoginTextReadModel struct { CustomLoginTextReadModel } -func NewInstanceCustomLoginTextReadModel(lang language.Tag) *InstanceCustomLoginTextReadModel { +func NewInstanceCustomLoginTextReadModel(ctx context.Context, lang language.Tag) *InstanceCustomLoginTextReadModel { return &InstanceCustomLoginTextReadModel{ CustomLoginTextReadModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, Language: lang, }, diff --git a/internal/command/instance_custom_login_text_test.go b/internal/command/instance_custom_login_text_test.go index 6fd9620a15..00b5c30235 100644 --- a/internal/command/instance_custom_login_text_test.go +++ b/internal/command/instance_custom_login_text_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/stretchr/testify/assert" "golang.org/x/text/language" @@ -55,1092 +56,1312 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, "TitleLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, "TitleLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, "DescriptionLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, "DescriptionLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, "OtherUser", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, "OtherUser", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, "SessionState0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, "SessionState0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, "SessionState1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, "SessionState1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, "TitleLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, "TitleLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, "DescriptionLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, "DescriptionLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, "LoginNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, "LoginNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, "UsernamePlaceholder", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, "UsernamePlaceholder", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, "LoginnamePlaceholder", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, "LoginnamePlaceholder", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, "RegisterButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, "RegisterButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, "ExternalUserDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, "ExternalUserDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, "ResetLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, "ResetLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, "MinLength", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, "MinLength", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, "HasUppercase", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, "HasUppercase", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, "HasLowercase", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, "HasLowercase", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, "HasNumber", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, "HasNumber", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, "HasSymbol", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, "HasSymbol", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, "Confirmation", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, "Confirmation", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, "NextButtonText", language.English, ), - ), eventFromEventPusher( + ), + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, "LoginButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, "LoginButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, "Provider0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, "Provider0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, "Provider1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, "Provider1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, "SkipButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, "SkipButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, "OTPDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, "OTPDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, "SecretLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, "SecretLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, "TokenNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, "TokenNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, "RegisterTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, "RegisterTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, "ChooseOther", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, "ChooseOther", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, "Provider0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, "Provider0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, "Provider1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, "Provider1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, "ValidateTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, "ValidateTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, "LoginWithPwButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, "LoginWithPwButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, "ValidateTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, "ValidateTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, "DescriptionInit", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, "DescriptionInit", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, "PasswordlessButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, "PasswordlessButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, "SkipButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, "SkipButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, "RegisterTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, "RegisterTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, "TokenNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, "TokenNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, "DescriptionClose", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, "DescriptionClose", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, "OldPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, "OldPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, "RegisterUsernamePasswordButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, "RegisterUsernamePasswordButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, "DescriptionOrgRegister", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, "DescriptionOrgRegister", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, "LanguageLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, "LanguageLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, "GenderLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, "GenderLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, "PasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, "PasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, "BackButtonText", language.English, ), - ), eventFromEventPusher( + ), + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, "NicknameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, "NicknameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, "LanguageLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, "LanguageLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, "PhoneLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, "PhoneLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, "OrgNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, "OrgNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, "PasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, "PasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, "LinkButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, "LinkButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, "AutoRegisterButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, "AutoRegisterButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, "AutoRedirectDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, "AutoRedirectDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, "RedirectedDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, "RedirectedDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, "LoginButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, "LoginButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, "TOS", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, "TOS", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, "PrivacyPolicy", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, "PrivacyPolicy", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, "Help", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, "Help", language.English, ), ), }, @@ -1148,7 +1369,7 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), config: &domain.CustomLoginText{ Language: language.English, SelectAccount: domain.SelectAccountScreenText{ @@ -1441,7 +1662,7 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1451,2187 +1672,2623 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, "TitleLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, "TitleLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, "DescriptionLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, "DescriptionLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, "OtherUser", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, "OtherUser", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, "SessionState0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, "SessionState0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, "SessionState1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, "SessionState1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, "TitleLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, "TitleLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, "DescriptionLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, "DescriptionLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, "LoginNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, "LoginNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, "UsernamePlaceholder", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, "UsernamePlaceholder", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, "LoginnamePlaceholder", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, "LoginnamePlaceholder", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, "RegisterButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, "RegisterButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, "ExternalUserDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, "ExternalUserDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, "ResetLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, "ResetLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, "MinLength", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, "MinLength", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, "HasUppercase", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, "HasUppercase", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, "HasLowercase", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, "HasLowercase", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, "HasNumber", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, "HasNumber", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, "HasSymbol", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, "HasSymbol", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, "Confirmation", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, "Confirmation", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, "LoginButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, "LoginButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, "Provider0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, "Provider0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, "Provider1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, "Provider1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, "SkipButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, "SkipButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, "OTPDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, "OTPDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, "SecretLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, "SecretLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, "TokenNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, "TokenNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, "RegisterTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, "RegisterTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, "ChooseOther", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, "ChooseOther", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, "Provider0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, "Provider0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, "Provider1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, "Provider1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, "ValidateTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, "ValidateTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, "LoginWithPwButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, "LoginWithPwButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, "ValidateTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, "ValidateTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, "DescriptionInit", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, "DescriptionInit", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, "PasswordlessButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, "PasswordlessButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, "SkipButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, "SkipButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, "RegisterTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, "RegisterTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, "TokenNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, "TokenNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, "DescriptionClose", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, "DescriptionClose", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, "OldPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, "OldPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, "RegisterUsernamePasswordButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, "RegisterUsernamePasswordButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, "DescriptionOrgRegister", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, "DescriptionOrgRegister", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, "LanguageLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, "LanguageLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, "GenderLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, "GenderLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, "PasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, "PasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, "NicknameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, "NicknameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, "LanguageLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, "LanguageLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, "PhoneLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, "PhoneLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, "OrgNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, "OrgNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, "PasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, "PasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, "LinkButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, "LinkButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, "AutoRegisterButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, "AutoRegisterButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, "AutoRedirectDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, "AutoRedirectDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, "RedirectedDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, "RedirectedDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, "LoginButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, "LoginButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, "TOS", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, "TOS", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, "PrivacyPolicy", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, "PrivacyPolicy", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, "Help", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, "Help", language.English, ), ), ), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, language.English, ), ), }, @@ -3639,7 +4296,7 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), config: &domain.CustomLoginText{ Language: language.English, SelectAccount: domain.SelectAccountScreenText{}, @@ -3680,7 +4337,7 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -3690,3278 +4347,3933 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, "TitleLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, "TitleLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, "DescriptionLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, "DescriptionLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, "OtherUser", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, "OtherUser", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, "SessionState0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, "SessionState0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, "SessionState1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, "SessionState1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, "TitleLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, "TitleLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, "DescriptionLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, "DescriptionLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, "LoginNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, "LoginNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, "UsernamePlaceholder", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, "UsernamePlaceholder", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, "LoginnamePlaceholder", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, "LoginnamePlaceholder", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, "RegisterButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, "RegisterButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, "ExternalUserDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, "ExternalUserDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, "ResetLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, "ResetLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, "MinLength", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, "MinLength", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, "HasUppercase", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, "HasUppercase", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, "HasLowercase", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, "HasLowercase", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, "HasNumber", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, "HasNumber", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, "HasSymbol", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, "HasSymbol", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, "Confirmation", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, "Confirmation", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, "LoginButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, "LoginButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, "Provider0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, "Provider0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, "Provider1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, "Provider1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, "SkipButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, "SkipButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, "OTPDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, "OTPDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, "SecretLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, "SecretLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, "TokenNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, "TokenNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, "RegisterTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, "RegisterTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, "ChooseOther", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, "ChooseOther", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, "Provider0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, "Provider0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, "Provider1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, "Provider1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, "ValidateTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, "ValidateTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, "LoginWithPwButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, "LoginWithPwButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, "ValidateTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, "ValidateTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, "DescriptionInit", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, "DescriptionInit", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, "PasswordlessButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, "PasswordlessButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, "SkipButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, "SkipButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, "RegisterTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, "RegisterTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, "TokenNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, "TokenNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, "DescriptionClose", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, "DescriptionClose", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, "OldPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, "OldPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, "RegisterUsernamePasswordButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, "RegisterUsernamePasswordButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, "DescriptionOrgRegister", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, "DescriptionOrgRegister", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, "LanguageLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, "LanguageLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, "GenderLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, "GenderLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, "PasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, "PasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, "NicknameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, "NicknameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, "LanguageLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, "LanguageLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, "PhoneLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, "PhoneLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, "OrgNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, "OrgNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, "PasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, "PasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, "LinkButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, "LinkButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, "AutoRegisterButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, "AutoRegisterButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, "AutoRedirectDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, "AutoRedirectDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, "RedirectedDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, "RedirectedDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, "LoginButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, "LoginButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, "TOS", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, "TOS", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, "PrivacyPolicy", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, "PrivacyPolicy", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, "Help", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, "Help", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, language.English, ), ), - eventFromEventPusher( + + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, language.English, ), ), ), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, "TitleLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountTitleLinkingProcess, "TitleLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, "DescriptionLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountDescriptionLinkingProcess, "DescriptionLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, "OtherUser", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountOtherUser, "OtherUser", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, "SessionState0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateActive, "SessionState0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, "SessionState1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountSessionStateInactive, "SessionState1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySelectAccountUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, "TitleLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginTitleLinkingProcess, "TitleLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, "DescriptionLinking", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginDescriptionLinkingProcess, "DescriptionLinking", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, "LoginNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNameLabel, "LoginNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, "UsernamePlaceholder", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUsernamePlaceHolder, "UsernamePlaceholder", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, "LoginnamePlaceholder", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginLoginnamePlaceHolder, "LoginnamePlaceholder", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, "RegisterButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginRegisterButtonText, "RegisterButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, "ExternalUserDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginExternalUserDescription, "ExternalUserDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLoginUserMustBeMemberOfOrg, "MustBeMemberOfOrg", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, "ResetLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetLinkText, "ResetLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, "MinLength", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordMinLength, "MinLength", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, "HasUppercase", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasUppercase, "HasUppercase", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, "HasLowercase", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasLowercase, "HasLowercase", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, "HasNumber", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasNumber, "HasNumber", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, "HasSymbol", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordHasSymbol, "HasSymbol", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, "Confirmation", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordConfirmation, "Confirmation", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyUsernameChangeDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitPasswordDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, "LoginButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyEmailVerificationDoneLoginButtonText, "LoginButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, "ResendButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserResendButtonText, "ResendButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitializeUserNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitUserDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, "Provider0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptOTPOption, "Provider0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, "Provider1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptU2FOption, "Provider1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, "SkipButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptSkipButtonText, "SkipButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAPromptNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, "OTPDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPDescriptionOTP, "OTPDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, "SecretLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPSecretLabel, "SecretLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAOTPCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, "TokenNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FTokenNameLabel, "TokenNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, "RegisterTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FRegisterTokenButtonText, "RegisterTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFAU2FErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyInitMFADoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, "ChooseOther", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersChooseOther, "ChooseOther", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, "Provider0", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersOTP, "Provider0", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, "Provider1", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyMFAProvidersU2F, "Provider1", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, "CodeLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPCodeLabel, "CodeLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAOTPNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, "ValidateTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FValidateTokenText, "ValidateTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyVerifyMFAU2FErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, "LoginWithPwButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessLoginWithPwButtonText, "LoginWithPwButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, "ValidateTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessValidateTokenButtonText, "ValidateTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, "DescriptionInit", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptDescriptionInit, "DescriptionInit", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, "PasswordlessButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptPasswordlessButtonText, "PasswordlessButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, "SkipButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessPromptSkipButtonText, "SkipButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, "RegisterTokenButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationRegisterTokenButtonText, "RegisterTokenButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, "TokenNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationTokenNameLabel, "TokenNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, "NotSupported", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationNotSupported, "NotSupported", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, "ErrorRetry", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationErrorRetry, "ErrorRetry", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, "DescriptionClose", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneDescriptionClose, "DescriptionClose", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordlessRegistrationDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, "OldPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeOldPasswordLabel, "OldPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, "NewPasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordLabel, "NewPasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNewPasswordConfirmLabel, "NewPasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordChangeDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyPasswordResetDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, "RegisterUsernamePasswordButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionUserNameButtonText, "RegisterUsernamePasswordButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationOptionExternalLoginDescription, "ExternalLoginDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, "DescriptionOrgRegister", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserDescriptionOrgRegister, "DescriptionOrgRegister", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, "LanguageLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserLanguageLabel, "LanguageLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, "GenderLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserGenderLabel, "GenderLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, "PasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPasswordConfirmLabel, "PasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegistrationUserBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, "NicknameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNicknameLabel, "NicknameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, "LanguageLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewLanguageLabel, "LanguageLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, "PhoneLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPhoneLabel, "PhoneLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, "BackButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewBackButtonText, "BackButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, "OrgNameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgOrgNameLabel, "OrgNameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, "FirstnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgFirstnameLabel, "FirstnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, "LastnameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgLastnameLabel, "LastnameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, "UsernameLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgUsernameLabel, "UsernameLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, "EmailLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgEmailLabel, "EmailLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, "PasswordLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordLabel, "PasswordLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, "PasswordConfirmLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPasswordConfirmLabel, "PasswordConfirmLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgTosConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyRegisterOrgSaveButtonText, "SaveButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, "CancelButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneCancelButtonText, "CancelButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLinkingUserDoneNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, "LinkButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundLinkButtonText, "LinkButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, "AutoRegisterButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundAutoRegisterButtonText, "AutoRegisterButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSAndPrivacyLabel, "TOSAndPrivacyLabel", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, "TOSConfirm", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirm, "TOSConfirm", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, "TOSLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSLinkText, "TOSLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, "TOSConfirmAnd", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundTOSConfirmAnd, "TOSConfirmAnd", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, "PrivacyLinkText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalNotFoundPrivacyLinkText, "PrivacyLinkText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, "AutoRedirectDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginAutoRedirectDescription, "AutoRedirectDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, "RedirectedDescription", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginRedirectedDescription, "RedirectedDescription", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, "NextButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeySuccessLoginNextButtonText, "NextButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, "Title", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneTitle, "Title", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, "Description", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneDescription, "Description", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, "LoginButtonText", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyLogoutDoneLoginButtonText, "LoginButtonText", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, "TOS", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterTOS, "TOS", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, "PrivacyPolicy", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterPrivacyPolicy, "PrivacyPolicy", language.English, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, "Help", language.English, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyFooterHelp, "Help", language.English, ), ), }, @@ -6969,7 +8281,7 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), config: &domain.CustomLoginText{ Language: language.English, SelectAccount: domain.SelectAccountScreenText{ @@ -7262,7 +8574,7 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, diff --git a/internal/command/instance_custom_message_text.go b/internal/command/instance_custom_message_text.go index 3e2406433a..2d2c4d64fb 100644 --- a/internal/command/instance_custom_message_text.go +++ b/internal/command/instance_custom_message_text.go @@ -10,8 +10,8 @@ import ( "golang.org/x/text/language" ) -func (c *Commands) SetDefaultMessageText(ctx context.Context, messageText *domain.CustomMessageText) (*domain.ObjectDetails, error) { - instanceAgg := instance.NewAggregate() +func (c *Commands) SetDefaultMessageText(ctx context.Context, instanceID string, messageText *domain.CustomMessageText) (*domain.ObjectDetails, error) { + instanceAgg := instance.NewAggregate(instanceID) events, existingMessageText, err := c.setDefaultMessageText(ctx, &instanceAgg.Aggregate, messageText) if err != nil { return nil, err @@ -114,7 +114,7 @@ func (c *Commands) RemoveInstanceMessageTexts(ctx context.Context, messageTextTy } func (c *Commands) defaultCustomMessageTextWriteModelByID(ctx context.Context, messageType string, lang language.Tag) (*InstanceCustomMessageTextWriteModel, error) { - writeModel := NewInstanceCustomMessageTextWriteModel(messageType, lang) + writeModel := NewInstanceCustomMessageTextWriteModel(ctx, messageType, lang) err := c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_custom_message_text_model.go b/internal/command/instance_custom_message_text_model.go index 42cbe24769..7e2d23a1cc 100644 --- a/internal/command/instance_custom_message_text_model.go +++ b/internal/command/instance_custom_message_text_model.go @@ -1,9 +1,11 @@ package command import ( + "context" + + "github.com/caos/zitadel/internal/api/authz" "golang.org/x/text/language" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" ) @@ -12,12 +14,12 @@ type InstanceCustomMessageTextWriteModel struct { CustomMessageTextReadModel } -func NewInstanceCustomMessageTextWriteModel(messageTextType string, lang language.Tag) *InstanceCustomMessageTextWriteModel { +func NewInstanceCustomMessageTextWriteModel(ctx context.Context, messageTextType string, lang language.Tag) *InstanceCustomMessageTextWriteModel { return &InstanceCustomMessageTextWriteModel{ CustomMessageTextReadModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, MessageTextType: messageTextType, Language: lang, diff --git a/internal/command/instance_custom_message_text_test.go b/internal/command/instance_custom_message_text_test.go index 89ef6af8d8..58508e8747 100644 --- a/internal/command/instance_custom_message_text_test.go +++ b/internal/command/instance_custom_message_text_test.go @@ -19,8 +19,9 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { eventstore *eventstore.Eventstore } type args struct { - ctx context.Context - config *domain.CustomMessageText + ctx context.Context + instanceID string + config *domain.CustomMessageText } type res struct { want *domain.ObjectDetails @@ -40,8 +41,9 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - config: &domain.CustomMessageText{}, + ctx: context.Background(), + instanceID: "INSTANCE", + config: &domain.CustomMessageText{}, }, res: res{ err: caos_errs.IsErrorInvalidArgument, @@ -57,7 +59,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "Template", domain.MessageGreeting, "Greeting", @@ -66,7 +68,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { ), eventFromEventPusher( instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "Template", domain.MessageSubject, "Subject", @@ -75,7 +77,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { ), eventFromEventPusher( instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "Template", domain.MessageTitle, "Title", @@ -84,7 +86,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { ), eventFromEventPusher( instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "Template", domain.MessagePreHeader, "PreHeader", @@ -93,7 +95,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { ), eventFromEventPusher( instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "Template", domain.MessageText, "Text", @@ -102,7 +104,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { ), eventFromEventPusher( instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "Template", domain.MessageButtonText, "ButtonText", @@ -111,7 +113,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { ), eventFromEventPusher( instance.NewCustomTextSetEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "Template", domain.MessageFooterText, "Footer", @@ -123,7 +125,8 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.CustomMessageText{ MessageTextType: "Template", Language: language.English, @@ -138,7 +141,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -148,7 +151,7 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { r := &Commands{ eventstore: tt.fields.eventstore, } - got, err := r.SetDefaultMessageText(tt.args.ctx, tt.args.config) + got, err := r.SetDefaultMessageText(tt.args.ctx, tt.args.instanceID, tt.args.config) if tt.res.err == nil { assert.NoError(t, err) } diff --git a/internal/command/instance_custom_text.go b/internal/command/instance_custom_text.go index 267691f798..54d0b90c92 100644 --- a/internal/command/instance_custom_text.go +++ b/internal/command/instance_custom_text.go @@ -13,7 +13,7 @@ import ( ) func (c *Commands) SetInstanceCustomText(ctx context.Context, customText *domain.CustomText) (*domain.CustomText, error) { - setText := NewInstanceCustomTextWriteModel(customText.Key, customText.Language) + setText := NewInstanceCustomTextWriteModel(ctx, customText.Key, customText.Language) instanceAgg := InstanceAggregateFromWriteModel(&setText.CustomTextWriteModel.WriteModel) event, err := c.setDefaultCustomText(ctx, instanceAgg, setText, customText) if err != nil { @@ -52,7 +52,7 @@ func (c *Commands) defaultCustomTextWriteModelByID(ctx context.Context, key stri ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstanceCustomTextWriteModel(key, language) + writeModel := NewInstanceCustomTextWriteModel(ctx, key, language) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_custom_text_model.go b/internal/command/instance_custom_text_model.go index 04258c3d76..233499eb7f 100644 --- a/internal/command/instance_custom_text_model.go +++ b/internal/command/instance_custom_text_model.go @@ -1,9 +1,11 @@ package command import ( + "context" + + "github.com/caos/zitadel/internal/api/authz" "golang.org/x/text/language" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" ) @@ -12,12 +14,12 @@ type InstanceCustomTextWriteModel struct { CustomTextWriteModel } -func NewInstanceCustomTextWriteModel(key string, language language.Tag) *InstanceCustomTextWriteModel { +func NewInstanceCustomTextWriteModel(ctx context.Context, key string, language language.Tag) *InstanceCustomTextWriteModel { return &InstanceCustomTextWriteModel{ CustomTextWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, Key: key, Language: language, diff --git a/internal/command/instance_debug_notification_file.go b/internal/command/instance_debug_notification_file.go index 0dc261d8f2..6996b41408 100644 --- a/internal/command/instance_debug_notification_file.go +++ b/internal/command/instance_debug_notification_file.go @@ -12,7 +12,7 @@ import ( ) func (c *Commands) AddDebugNotificationProviderFile(ctx context.Context, fileSystemProvider *fs.FSConfig) (*domain.ObjectDetails, error) { - writeModel := NewInstanceDebugNotificationFileWriteModel() + writeModel := NewInstanceDebugNotificationFileWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&writeModel.WriteModel) events, err := c.addDefaultDebugNotificationFile(ctx, instanceAgg, writeModel, fileSystemProvider) if err != nil { @@ -47,7 +47,7 @@ func (c *Commands) addDefaultDebugNotificationFile(ctx context.Context, instance } func (c *Commands) ChangeDefaultNotificationFile(ctx context.Context, fileSystemProvider *fs.FSConfig) (*domain.ObjectDetails, error) { - writeModel := NewInstanceDebugNotificationFileWriteModel() + writeModel := NewInstanceDebugNotificationFileWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&writeModel.WriteModel) events, err := c.changeDefaultDebugNotificationProviderFile(ctx, instanceAgg, writeModel, fileSystemProvider) if err != nil { @@ -87,7 +87,7 @@ func (c *Commands) changeDefaultDebugNotificationProviderFile(ctx context.Contex } func (c *Commands) RemoveDefaultNotificationFile(ctx context.Context) (*domain.ObjectDetails, error) { - existingProvider := NewInstanceDebugNotificationFileWriteModel() + existingProvider := NewInstanceDebugNotificationFileWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&existingProvider.WriteModel) err := c.defaultDebugNotificationProviderFileWriteModelByID(ctx, existingProvider) if err != nil { diff --git a/internal/command/instance_debug_notification_file_model.go b/internal/command/instance_debug_notification_file_model.go index 02559e5a21..07aee2f1af 100644 --- a/internal/command/instance_debug_notification_file_model.go +++ b/internal/command/instance_debug_notification_file_model.go @@ -3,10 +3,10 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/settings" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/repository/instance" ) @@ -14,12 +14,12 @@ type InstanceDebugNotificationFileWriteModel struct { DebugNotificationWriteModel } -func NewInstanceDebugNotificationFileWriteModel() *InstanceDebugNotificationFileWriteModel { +func NewInstanceDebugNotificationFileWriteModel(ctx context.Context) *InstanceDebugNotificationFileWriteModel { return &InstanceDebugNotificationFileWriteModel{ DebugNotificationWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_debug_notification_file_test.go b/internal/command/instance_debug_notification_file_test.go index fc1ca4f21a..a90d3c280a 100644 --- a/internal/command/instance_debug_notification_file_test.go +++ b/internal/command/instance_debug_notification_file_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -41,7 +42,7 @@ func TestCommandSide_AddDefaultDebugNotificationProviderFile(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewDebugNotificationProviderFileAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -67,9 +68,10 @@ func TestCommandSide_AddDefaultDebugNotificationProviderFile(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderFileAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -78,14 +80,14 @@ func TestCommandSide_AddDefaultDebugNotificationProviderFile(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), provider: &fs.FSConfig{ Compact: true, }, }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: domain.IAMID, + ResourceOwner: "INSTANCE", }, }, }, @@ -154,7 +156,7 @@ func TestCommandSide_ChangeDebugNotificationProviderFile(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewDebugNotificationProviderFileAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -180,7 +182,7 @@ func TestCommandSide_ChangeDebugNotificationProviderFile(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewDebugNotificationProviderFileAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -204,16 +206,18 @@ func TestCommandSide_ChangeDebugNotificationProviderFile(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderFileAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), ), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", newDefaultDebugNotificationFileChangedEvent(context.Background(), false), ), @@ -222,7 +226,7 @@ func TestCommandSide_ChangeDebugNotificationProviderFile(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), provider: &fs.FSConfig{ Compact: false, Enabled: false, @@ -230,7 +234,7 @@ func TestCommandSide_ChangeDebugNotificationProviderFile(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -292,29 +296,31 @@ func TestCommandSide_RemoveDebugNotificationProviderFile(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderFileAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), ), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderFileRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate), + &instance.NewAggregate("INSTANCE").Aggregate), ), }, ), ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -339,7 +345,7 @@ func TestCommandSide_RemoveDebugNotificationProviderFile(t *testing.T) { } func newDefaultDebugNotificationFileChangedEvent(ctx context.Context, compact bool) *instance.DebugNotificationProviderFileChangedEvent { event, _ := instance.NewDebugNotificationProviderFileChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []settings.DebugNotificationProviderChanges{ settings.ChangeCompact(compact), }, diff --git a/internal/command/instance_debug_notification_log.go b/internal/command/instance_debug_notification_log.go index 1b9fdfd35d..430610bf43 100644 --- a/internal/command/instance_debug_notification_log.go +++ b/internal/command/instance_debug_notification_log.go @@ -12,7 +12,7 @@ import ( ) func (c *Commands) AddDebugNotificationProviderLog(ctx context.Context, fileSystemProvider *fs.FSConfig) (*domain.ObjectDetails, error) { - writeModel := NewInstanceDebugNotificationLogWriteModel() + writeModel := NewInstanceDebugNotificationLogWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&writeModel.WriteModel) events, err := c.addDefaultDebugNotificationLog(ctx, instanceAgg, writeModel, fileSystemProvider) if err != nil { @@ -47,7 +47,7 @@ func (c *Commands) addDefaultDebugNotificationLog(ctx context.Context, instanceA } func (c *Commands) ChangeDefaultNotificationLog(ctx context.Context, fileSystemProvider *fs.FSConfig) (*domain.ObjectDetails, error) { - writeModel := NewInstanceDebugNotificationLogWriteModel() + writeModel := NewInstanceDebugNotificationLogWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&writeModel.WriteModel) event, err := c.changeDefaultDebugNotificationProviderLog(ctx, instanceAgg, writeModel, fileSystemProvider) if err != nil { @@ -82,7 +82,7 @@ func (c *Commands) changeDefaultDebugNotificationProviderLog(ctx context.Context } func (c *Commands) RemoveDefaultNotificationLog(ctx context.Context) (*domain.ObjectDetails, error) { - existingProvider := NewInstanceDebugNotificationLogWriteModel() + existingProvider := NewInstanceDebugNotificationLogWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&existingProvider.WriteModel) err := c.defaultDebugNotificationProviderLogWriteModelByID(ctx, existingProvider) if err != nil { diff --git a/internal/command/instance_debug_notification_log_model.go b/internal/command/instance_debug_notification_log_model.go index b526273e02..0ebfb5aa24 100644 --- a/internal/command/instance_debug_notification_log_model.go +++ b/internal/command/instance_debug_notification_log_model.go @@ -3,10 +3,10 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/settings" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/repository/instance" ) @@ -14,12 +14,12 @@ type InstanceDebugNotificationLogWriteModel struct { DebugNotificationWriteModel } -func NewInstanceDebugNotificationLogWriteModel() *InstanceDebugNotificationLogWriteModel { +func NewInstanceDebugNotificationLogWriteModel(ctx context.Context) *InstanceDebugNotificationLogWriteModel { return &InstanceDebugNotificationLogWriteModel{ DebugNotificationWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_debug_notification_log_test.go b/internal/command/instance_debug_notification_log_test.go index 494fa7f7c7..8bde214668 100644 --- a/internal/command/instance_debug_notification_log_test.go +++ b/internal/command/instance_debug_notification_log_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -39,9 +40,10 @@ func TestCommandSide_AddDefaultDebugNotificationProviderLog(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderLogAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -49,7 +51,7 @@ func TestCommandSide_AddDefaultDebugNotificationProviderLog(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), provider: &fs.FSConfig{ Compact: true, Enabled: true, @@ -67,9 +69,10 @@ func TestCommandSide_AddDefaultDebugNotificationProviderLog(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderLogAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -78,14 +81,14 @@ func TestCommandSide_AddDefaultDebugNotificationProviderLog(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), provider: &fs.FSConfig{ Compact: true, }, }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: domain.IAMID, + ResourceOwner: "INSTANCE", }, }, }, @@ -97,9 +100,10 @@ func TestCommandSide_AddDefaultDebugNotificationProviderLog(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderLogAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -108,7 +112,7 @@ func TestCommandSide_AddDefaultDebugNotificationProviderLog(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), provider: &fs.FSConfig{ Compact: true, Enabled: true, @@ -116,7 +120,7 @@ func TestCommandSide_AddDefaultDebugNotificationProviderLog(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: domain.IAMID, + ResourceOwner: "INSTANCE", }, }, }, @@ -185,7 +189,7 @@ func TestCommandSide_ChangeDebugNotificationProviderLog(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewDebugNotificationProviderLogAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -209,16 +213,18 @@ func TestCommandSide_ChangeDebugNotificationProviderLog(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderLogAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), ), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", newDefaultDebugNotificationLogChangedEvent(context.Background(), false), ), @@ -227,7 +233,7 @@ func TestCommandSide_ChangeDebugNotificationProviderLog(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), provider: &fs.FSConfig{ Compact: false, Enabled: false, @@ -235,7 +241,7 @@ func TestCommandSide_ChangeDebugNotificationProviderLog(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -247,14 +253,15 @@ func TestCommandSide_ChangeDebugNotificationProviderLog(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewDebugNotificationProviderLogAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), ), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", newDefaultDebugNotificationLogChangedEvent(context.Background(), false), ), @@ -263,7 +270,7 @@ func TestCommandSide_ChangeDebugNotificationProviderLog(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), provider: &fs.FSConfig{ Compact: false, Enabled: true, @@ -271,7 +278,7 @@ func TestCommandSide_ChangeDebugNotificationProviderLog(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -333,29 +340,31 @@ func TestCommandSide_RemoveDebugNotificationProviderLog(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderLogAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), ), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDebugNotificationProviderLogRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate), + &instance.NewAggregate("INSTANCE").Aggregate), ), }, ), ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -380,7 +389,7 @@ func TestCommandSide_RemoveDebugNotificationProviderLog(t *testing.T) { } func newDefaultDebugNotificationLogChangedEvent(ctx context.Context, compact bool) *instance.DebugNotificationProviderLogChangedEvent { event, _ := instance.NewDebugNotificationProviderLogChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []settings.DebugNotificationProviderChanges{ settings.ChangeCompact(compact), }, diff --git a/internal/command/instance_domain.go b/internal/command/instance_domain.go new file mode 100644 index 0000000000..e9c44fafc4 --- /dev/null +++ b/internal/command/instance_domain.go @@ -0,0 +1,98 @@ +package command + +import ( + "context" + "strings" + + "github.com/caos/zitadel/internal/api/authz" + "github.com/caos/zitadel/internal/command/v2/preparation" + "github.com/caos/zitadel/internal/repository/instance" + + "github.com/caos/zitadel/internal/domain" + caos_errs "github.com/caos/zitadel/internal/errors" + "github.com/caos/zitadel/internal/eventstore" +) + +func (c *Commands) AddInstanceDomain(ctx context.Context, instanceDomain string) (*domain.ObjectDetails, error) { + instanceAgg := instance.NewAggregate(authz.GetInstance(ctx).InstanceID()) + validation := c.addInstanceDomain(instanceAgg, instanceDomain, false) + cmds, err := preparation.PrepareCommands(ctx, c.eventstore.Filter, validation) + if err != nil { + return nil, err + } + events, err := c.eventstore.Push(ctx, cmds...) + if err != nil { + return nil, err + } + return &domain.ObjectDetails{ + Sequence: events[len(events)-1].Sequence(), + EventDate: events[len(events)-1].CreationDate(), + ResourceOwner: events[len(events)-1].Aggregate().InstanceID, + }, nil +} + +func (c *Commands) RemoveInstanceDomain(ctx context.Context, instanceDomain string) (*domain.ObjectDetails, error) { + instanceAgg := instance.NewAggregate(authz.GetInstance(ctx).InstanceID()) + validation := c.removeInstanceDomain(instanceAgg, instanceDomain) + cmds, err := preparation.PrepareCommands(ctx, c.eventstore.Filter, validation) + if err != nil { + return nil, err + } + events, err := c.eventstore.Push(ctx, cmds...) + if err != nil { + return nil, err + } + return &domain.ObjectDetails{ + Sequence: events[len(events)-1].Sequence(), + EventDate: events[len(events)-1].CreationDate(), + ResourceOwner: events[len(events)-1].Aggregate().InstanceID, + }, nil +} + +func (c *Commands) addInstanceDomain(a *instance.Aggregate, instanceDomain string, generated bool) preparation.Validation { + return func() (preparation.CreateCommands, error) { + if instanceDomain = strings.TrimSpace(instanceDomain); instanceDomain == "" { + return nil, caos_errs.ThrowInvalidArgument(nil, "INST-28nlD", "Errors.Invalid.Argument") + } + return func(ctx context.Context, filter preparation.FilterToQueryReducer) ([]eventstore.Command, error) { + domainWriteModel, err := c.getInstanceDomainWriteModel(ctx, instanceDomain) + if err != nil { + return nil, err + } + if domainWriteModel.State == domain.InstanceDomainStateActive { + return nil, caos_errs.ThrowAlreadyExists(nil, "INST-i2nl", "Errors.Instance.Domain.AlreadyExists") + } + return []eventstore.Command{instance.NewDomainAddedEvent(ctx, &a.Aggregate, instanceDomain, generated)}, nil + }, nil + } +} + +func (c *Commands) removeInstanceDomain(a *instance.Aggregate, instanceDomain string) preparation.Validation { + return func() (preparation.CreateCommands, error) { + if instanceDomain = strings.TrimSpace(instanceDomain); instanceDomain == "" { + return nil, caos_errs.ThrowInvalidArgument(nil, "INST-39nls", "Errors.Invalid.Argument") + } + return func(ctx context.Context, filter preparation.FilterToQueryReducer) ([]eventstore.Command, error) { + domainWriteModel, err := c.getInstanceDomainWriteModel(ctx, instanceDomain) + if err != nil { + return nil, err + } + if domainWriteModel.State != domain.InstanceDomainStateActive { + return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-8ls9f", "Errors.Instance.Domain.NotFound") + } + if domainWriteModel.Generated { + return nil, caos_errs.ThrowPreconditionFailed(nil, "INSTANCE-9hn3n", "Errors.Instance.Domain.GeneratedNotRemovable") + } + return []eventstore.Command{instance.NewDomainRemovedEvent(ctx, &a.Aggregate, instanceDomain)}, nil + }, nil + } +} + +func (c *Commands) getInstanceDomainWriteModel(ctx context.Context, domain string) (*InstanceDomainWriteModel, error) { + domainWriteModel := NewInstanceDomainWriteModel(ctx, domain) + err := c.eventstore.FilterToQueryReducer(ctx, domainWriteModel) + if err != nil { + return nil, err + } + return domainWriteModel, nil +} diff --git a/internal/command/instance_domain_model.go b/internal/command/instance_domain_model.go new file mode 100644 index 0000000000..9bb88699c2 --- /dev/null +++ b/internal/command/instance_domain_model.go @@ -0,0 +1,71 @@ +package command + +import ( + "context" + + "github.com/caos/zitadel/internal/api/authz" + "github.com/caos/zitadel/internal/domain" + "github.com/caos/zitadel/internal/eventstore" + "github.com/caos/zitadel/internal/repository/instance" +) + +type InstanceDomainWriteModel struct { + eventstore.WriteModel + + Domain string + Generated bool + State domain.InstanceDomainState +} + +func NewInstanceDomainWriteModel(ctx context.Context, instanceDomain string) *InstanceDomainWriteModel { + return &InstanceDomainWriteModel{ + WriteModel: eventstore.WriteModel{ + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), + }, + Domain: instanceDomain, + } +} + +func (wm *InstanceDomainWriteModel) AppendEvents(events ...eventstore.Event) { + for _, event := range events { + switch e := event.(type) { + case *instance.DomainAddedEvent: + if e.Domain != wm.Domain { + continue + } + wm.WriteModel.AppendEvents(e) + case *instance.DomainRemovedEvent: + if e.Domain != wm.Domain { + continue + } + wm.WriteModel.AppendEvents(e) + } + } +} + +func (wm *InstanceDomainWriteModel) Reduce() error { + for _, event := range wm.Events { + switch e := event.(type) { + case *instance.DomainAddedEvent: + wm.Domain = e.Domain + wm.Generated = e.Generated + wm.State = domain.InstanceDomainStateActive + case *instance.DomainRemovedEvent: + wm.State = domain.InstanceDomainStateRemoved + } + } + return nil +} + +func (wm *InstanceDomainWriteModel) Query() *eventstore.SearchQueryBuilder { + return eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent). + ResourceOwner(wm.ResourceOwner). + AddQuery(). + AggregateTypes(instance.AggregateType). + AggregateIDs(wm.AggregateID). + EventTypes( + instance.InstanceDomainAddedEventType, + instance.InstanceDomainRemovedEventType). + Builder() +} diff --git a/internal/command/instance_domain_test.go b/internal/command/instance_domain_test.go new file mode 100644 index 0000000000..075e0dcc85 --- /dev/null +++ b/internal/command/instance_domain_test.go @@ -0,0 +1,253 @@ +package command + +import ( + "context" + "testing" + + "github.com/caos/zitadel/internal/api/authz" + "github.com/stretchr/testify/assert" + + "github.com/caos/zitadel/internal/domain" + caos_errs "github.com/caos/zitadel/internal/errors" + "github.com/caos/zitadel/internal/eventstore" + "github.com/caos/zitadel/internal/eventstore/repository" + "github.com/caos/zitadel/internal/repository/instance" +) + +func TestCommandSide_AddInstanceDomain(t *testing.T) { + type fields struct { + eventstore *eventstore.Eventstore + } + type args struct { + ctx context.Context + domain string + } + type res struct { + want *domain.ObjectDetails + err func(error) bool + } + tests := []struct { + name string + fields fields + args args + res res + }{ + { + name: "invalid domain, error", + fields: fields{ + eventstore: eventstoreExpect( + t, + ), + }, + args: args{ + ctx: context.Background(), + domain: "", + }, + res: res{ + err: caos_errs.IsErrorInvalidArgument, + }, + }, + { + name: "domain already exists, precondition error", + fields: fields{ + eventstore: eventstoreExpect( + t, + expectFilter( + eventFromEventPusher( + instance.NewDomainAddedEvent(context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, + "domain.ch", + false, + ), + ), + ), + ), + }, + args: args{ + ctx: context.Background(), + domain: "domain.ch", + }, + res: res{ + err: caos_errs.IsErrorAlreadyExists, + }, + }, + { + name: "domain add, ok", + fields: fields{ + eventstore: eventstoreExpect( + t, + expectFilter(), + expectPush( + []*repository.Event{ + eventFromEventPusherWithInstanceID( + "INSTANCE", + instance.NewDomainAddedEvent(context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, + "domain.ch", + false, + )), + }, + uniqueConstraintsFromEventConstraintWithInstanceID("INSTANCE", instance.NewAddInstanceDomainUniqueConstraint("domain.ch")), + ), + ), + }, + args: args{ + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), + domain: "domain.ch", + }, + res: res{ + want: &domain.ObjectDetails{ + ResourceOwner: "INSTANCE", + }, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + r := &Commands{ + eventstore: tt.fields.eventstore, + } + got, err := r.AddInstanceDomain(tt.args.ctx, tt.args.domain) + if tt.res.err == nil { + assert.NoError(t, err) + } + if tt.res.err != nil && !tt.res.err(err) { + t.Errorf("got wrong err: %v ", err) + } + if tt.res.err == nil { + assert.Equal(t, tt.res.want, got) + } + }) + } +} + +func TestCommandSide_RemoveInstanceDomain(t *testing.T) { + type fields struct { + eventstore *eventstore.Eventstore + } + type args struct { + ctx context.Context + domain string + } + type res struct { + want *domain.ObjectDetails + err func(error) bool + } + tests := []struct { + name string + fields fields + args args + res res + }{ + { + name: "invalid domain, error", + fields: fields{ + eventstore: eventstoreExpect( + t, + ), + }, + args: args{ + ctx: context.Background(), + domain: "", + }, + res: res{ + err: caos_errs.IsErrorInvalidArgument, + }, + }, + { + name: "domain not exists, precondition error", + fields: fields{ + eventstore: eventstoreExpect( + t, + expectFilter(), + ), + }, + args: args{ + ctx: context.Background(), + domain: "domain.ch", + }, + res: res{ + err: caos_errs.IsNotFound, + }, + }, + { + name: "remove domain, ok", + fields: fields{ + eventstore: eventstoreExpect( + t, + expectFilter( + eventFromEventPusherWithInstanceID( + "INSTANCE", + instance.NewDomainAddedEvent(context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, + "domain.ch", + false, + ), + ), + ), + expectPush( + []*repository.Event{ + eventFromEventPusherWithInstanceID( + "INSTANCE", + instance.NewDomainRemovedEvent(context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, + "domain.ch", + )), + }, + uniqueConstraintsFromEventConstraintWithInstanceID("INSTANCE", instance.NewRemoveInstanceDomainUniqueConstraint("domain.ch")), + ), + ), + }, + args: args{ + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), + domain: "domain.ch", + }, + res: res{ + want: &domain.ObjectDetails{ + ResourceOwner: "INSTANCE", + }, + }, + }, + { + name: "remove generated domain, precondition failed", + fields: fields{ + eventstore: eventstoreExpect( + t, + expectFilter( + eventFromEventPusher( + instance.NewDomainAddedEvent(context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, + "domain.ch", + true, + ), + ), + ), + ), + }, + args: args{ + ctx: context.Background(), + domain: "domain.ch", + }, + res: res{ + err: caos_errs.IsPreconditionFailed, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + r := &Commands{ + eventstore: tt.fields.eventstore, + } + got, err := r.RemoveInstanceDomain(tt.args.ctx, tt.args.domain) + if tt.res.err == nil { + assert.NoError(t, err) + } + if tt.res.err != nil && !tt.res.err(err) { + t.Errorf("got wrong err: %v ", err) + } + if tt.res.err == nil { + assert.Equal(t, tt.res.want, got) + } + }) + } +} diff --git a/internal/command/instance_features.go b/internal/command/instance_features.go index e442e97594..9bb1713930 100644 --- a/internal/command/instance_features.go +++ b/internal/command/instance_features.go @@ -10,7 +10,7 @@ import ( ) func (c *Commands) SetDefaultFeatures(ctx context.Context, features *domain.Features) (*domain.ObjectDetails, error) { - existingFeatures := NewInstanceFeaturesWriteModel() + existingFeatures := NewInstanceFeaturesWriteModel(ctx) setEvent, err := c.setDefaultFeatures(ctx, existingFeatures, features) if err != nil { return nil, err @@ -65,7 +65,7 @@ func (c *Commands) setDefaultFeatures(ctx context.Context, existingFeatures *Ins } func (c *Commands) getDefaultFeatures(ctx context.Context) (*domain.Features, error) { - existingFeatures := NewInstanceFeaturesWriteModel() + existingFeatures := NewInstanceFeaturesWriteModel(ctx) err := c.eventstore.FilterToQueryReducer(ctx, existingFeatures) if err != nil { return nil, err diff --git a/internal/command/instance_features_model.go b/internal/command/instance_features_model.go index 387c17acdb..f843e7ed09 100644 --- a/internal/command/instance_features_model.go +++ b/internal/command/instance_features_model.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/features" @@ -14,12 +15,12 @@ type InstanceFeaturesWriteModel struct { FeaturesWriteModel } -func NewInstanceFeaturesWriteModel() *InstanceFeaturesWriteModel { +func NewInstanceFeaturesWriteModel(ctx context.Context) *InstanceFeaturesWriteModel { return &InstanceFeaturesWriteModel{ FeaturesWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_idp_config.go b/internal/command/instance_idp_config.go index 43f189a880..8905198382 100644 --- a/internal/command/instance_idp_config.go +++ b/internal/command/instance_idp_config.go @@ -3,6 +3,7 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -21,7 +22,7 @@ func (c *Commands) AddDefaultIDPConfig(ctx context.Context, config *domain.IDPCo if err != nil { return nil, err } - addedConfig := NewInstanceIDPConfigWriteModel(idpConfigID) + addedConfig := NewInstanceIDPConfigWriteModel(ctx, idpConfigID) instanceAgg := InstanceAggregateFromWriteModel(&addedConfig.WriteModel) events := []eventstore.Command{ @@ -159,7 +160,7 @@ func (c *Commands) RemoveDefaultIDPConfig(ctx context.Context, idpID string, idp } for _, idpProvider := range idpProviders { - if idpProvider.AggregateID == domain.IAMID { + if idpProvider.AggregateID == authz.GetInstance(ctx).InstanceID() { userEvents := c.removeIDPProviderFromDefaultLoginPolicy(ctx, instanceAgg, idpProvider, true, externalIDPs...) events = append(events, userEvents...) } @@ -194,7 +195,7 @@ func (c *Commands) isntanceIDPConfigWriteModelByID(ctx context.Context, idpID st ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstanceIDPConfigWriteModel(idpID) + writeModel := NewInstanceIDPConfigWriteModel(ctx, idpID) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_idp_config_model.go b/internal/command/instance_idp_config_model.go index 3632af3655..5a99f1800a 100644 --- a/internal/command/instance_idp_config_model.go +++ b/internal/command/instance_idp_config_model.go @@ -3,6 +3,7 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/domain" @@ -14,12 +15,12 @@ type InstanceIDPConfigWriteModel struct { IDPConfigWriteModel } -func NewInstanceIDPConfigWriteModel(configID string) *InstanceIDPConfigWriteModel { +func NewInstanceIDPConfigWriteModel(ctx context.Context, configID string) *InstanceIDPConfigWriteModel { return &InstanceIDPConfigWriteModel{ IDPConfigWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, ConfigID: configID, }, diff --git a/internal/command/instance_idp_config_test.go b/internal/command/instance_idp_config_test.go index e72d950131..b6a6bd9814 100644 --- a/internal/command/instance_idp_config_test.go +++ b/internal/command/instance_idp_config_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" @@ -61,9 +62,10 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) { t, expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeOIDC, @@ -71,9 +73,10 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) { true, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewIDPOIDCConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "clientid1", "config1", "issuer", @@ -91,14 +94,14 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) { ), ), }, - uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name1", "IAM")), + uniqueConstraintsFromEventConstraintWithInstanceID("INSTANCE", idpconfig.NewAddIDPConfigNameUniqueConstraint("name1", "INSTANCE")), ), ), idGenerator: id_mock.NewIDGeneratorExpectIDs(t, "config1"), secretCrypto: crypto.CreateMockEncryptionAlg(gomock.NewController(t)), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), config: &domain.IDPConfig{ Name: "name1", StylingType: domain.IDPConfigStylingTypeGoogle, @@ -118,8 +121,9 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) { res: res{ want: &domain.IDPConfig{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, IDPConfigID: "config1", Name: "name1", @@ -136,9 +140,10 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) { t, expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeOIDC, @@ -146,9 +151,10 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) { false, ), ), - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewIDPJWTConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "jwt-endpoint", "issuer", @@ -157,13 +163,13 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) { ), ), }, - uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name1", "IAM")), + uniqueConstraintsFromEventConstraintWithInstanceID("INSTANCE", idpconfig.NewAddIDPConfigNameUniqueConstraint("name1", "INSTANCE")), ), ), idGenerator: id_mock.NewIDGeneratorExpectIDs(t, "config1"), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), config: &domain.IDPConfig{ Name: "name1", StylingType: domain.IDPConfigStylingTypeGoogle, @@ -178,8 +184,9 @@ func TestCommandSide_AddDefaultIDPConfig(t *testing.T) { res: res{ want: &domain.IDPConfig{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, IDPConfigID: "config1", Name: "name1", @@ -269,7 +276,7 @@ func TestCommandSide_ChangeDefaultIDPConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeOIDC, @@ -279,7 +286,7 @@ func TestCommandSide_ChangeDefaultIDPConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPOIDCConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "clientid1", "config1", "issuer", @@ -303,8 +310,8 @@ func TestCommandSide_ChangeDefaultIDPConfig(t *testing.T) { newDefaultIDPConfigChangedEvent(context.Background(), "config1", "name1", "name2", domain.IDPConfigStylingTypeUnspecified, false), ), }, - uniqueConstraintsFromEventConstraint(idpconfig.NewRemoveIDPConfigNameUniqueConstraint("name1", "IAM")), - uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name2", "IAM")), + uniqueConstraintsFromEventConstraint(idpconfig.NewRemoveIDPConfigNameUniqueConstraint("name1", "INSTANCE")), + uniqueConstraintsFromEventConstraint(idpconfig.NewAddIDPConfigNameUniqueConstraint("name2", "INSTANCE")), ), ), }, @@ -320,8 +327,8 @@ func TestCommandSide_ChangeDefaultIDPConfig(t *testing.T) { res: res{ want: &domain.IDPConfig{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, IDPConfigID: "config1", Name: "name2", @@ -353,7 +360,7 @@ func TestCommandSide_ChangeDefaultIDPConfig(t *testing.T) { func newDefaultIDPConfigChangedEvent(ctx context.Context, configID, oldName, newName string, stylingType domain.IDPConfigStylingType, autoRegister bool) *instance.IDPConfigChangedEvent { event, _ := instance.NewIDPConfigChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, configID, oldName, []idpconfig.IDPConfigChanges{ diff --git a/internal/command/instance_idp_jwt_config.go b/internal/command/instance_idp_jwt_config.go index 8e8f684ffc..2619ac0ef5 100644 --- a/internal/command/instance_idp_jwt_config.go +++ b/internal/command/instance_idp_jwt_config.go @@ -11,7 +11,7 @@ func (c *Commands) ChangeDefaultIDPJWTConfig(ctx context.Context, config *domain if config.IDPConfigID == "" { return nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-m9322", "Errors.IDMissing") } - existingConfig := NewInstanceIDPJWTConfigWriteModel(config.IDPConfigID) + existingConfig := NewInstanceIDPJWTConfigWriteModel(ctx, config.IDPConfigID) err := c.eventstore.FilterToQueryReducer(ctx, existingConfig) if err != nil { return nil, err diff --git a/internal/command/instance_idp_jwt_config_model.go b/internal/command/instance_idp_jwt_config_model.go index 4de2997822..c415de5de1 100644 --- a/internal/command/instance_idp_jwt_config_model.go +++ b/internal/command/instance_idp_jwt_config_model.go @@ -3,9 +3,9 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/repository/idpconfig" "github.com/caos/zitadel/internal/repository/instance" ) @@ -14,12 +14,12 @@ type InstanceIDPJWTConfigWriteModel struct { JWTConfigWriteModel } -func NewInstanceIDPJWTConfigWriteModel(idpConfigID string) *InstanceIDPJWTConfigWriteModel { +func NewInstanceIDPJWTConfigWriteModel(ctx context.Context, idpConfigID string) *InstanceIDPJWTConfigWriteModel { return &InstanceIDPJWTConfigWriteModel{ JWTConfigWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, IDPConfigID: idpConfigID, }, diff --git a/internal/command/instance_idp_jwt_config_test.go b/internal/command/instance_idp_jwt_config_test.go index 38978cdf56..cb172d7cb2 100644 --- a/internal/command/instance_idp_jwt_config_test.go +++ b/internal/command/instance_idp_jwt_config_test.go @@ -24,8 +24,9 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { } type ( args struct { - ctx context.Context - config *domain.JWTIDPConfig + ctx context.Context + instanceID string + config *domain.JWTIDPConfig } ) type res struct { @@ -46,8 +47,9 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - config: &domain.JWTIDPConfig{}, + ctx: context.Background(), + instanceID: "INSTANCE", + config: &domain.JWTIDPConfig{}, }, res: res{ err: caos_errs.IsErrorInvalidArgument, @@ -62,7 +64,8 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.JWTIDPConfig{ IDPConfigID: "config1", }, @@ -79,7 +82,7 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeJWT, @@ -89,7 +92,7 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPJWTConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "jwt-endpoint", "issuer", @@ -99,7 +102,7 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPConfigRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name", ), @@ -108,7 +111,8 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.JWTIDPConfig{ IDPConfigID: "config1", }, @@ -125,7 +129,7 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeJWT, @@ -135,7 +139,7 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPJWTConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "jwt-endpoint", "issuer", @@ -148,7 +152,8 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { secretCrypto: crypto.CreateMockEncryptionAlg(gomock.NewController(t)), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.JWTIDPConfig{ IDPConfigID: "config1", JWTEndpoint: "jwt-endpoint", @@ -169,7 +174,7 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeJWT, @@ -179,7 +184,7 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPJWTConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "jwt-endpoint", "issuer", @@ -205,7 +210,8 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { secretCrypto: crypto.CreateMockEncryptionAlg(gomock.NewController(t)), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.JWTIDPConfig{ IDPConfigID: "config1", JWTEndpoint: "jwt-endpoint-changed", @@ -217,8 +223,8 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { res: res{ want: &domain.JWTIDPConfig{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, IDPConfigID: "config1", JWTEndpoint: "jwt-endpoint-changed", @@ -251,7 +257,7 @@ func TestCommandSide_ChangeDefaultIDPJWTConfig(t *testing.T) { func newDefaultIDPJWTConfigChangedEvent(ctx context.Context, configID, jwtEndpoint, issuer, keysEndpoint, headerName string) *instance.IDPJWTConfigChangedEvent { event, _ := instance.NewIDPJWTConfigChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, configID, []idpconfig.JWTConfigChanges{ idpconfig.ChangeJWTEndpoint(jwtEndpoint), diff --git a/internal/command/instance_idp_oidc_config.go b/internal/command/instance_idp_oidc_config.go index ac88f9a2c2..605971858a 100644 --- a/internal/command/instance_idp_oidc_config.go +++ b/internal/command/instance_idp_oidc_config.go @@ -11,7 +11,7 @@ func (c *Commands) ChangeDefaultIDPOIDCConfig(ctx context.Context, config *domai if config.IDPConfigID == "" { return nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-9djf8", "Errors.IDMissing") } - existingConfig := NewInstanceIDPOIDCConfigWriteModel(config.IDPConfigID) + existingConfig := NewInstanceIDPOIDCConfigWriteModel(ctx, config.IDPConfigID) err := c.eventstore.FilterToQueryReducer(ctx, existingConfig) if err != nil { return nil, err diff --git a/internal/command/instance_idp_oidc_config_model.go b/internal/command/instance_idp_oidc_config_model.go index 5d4ed3356e..57a150d3e2 100644 --- a/internal/command/instance_idp_oidc_config_model.go +++ b/internal/command/instance_idp_oidc_config_model.go @@ -4,6 +4,7 @@ import ( "context" "reflect" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/crypto" @@ -16,12 +17,12 @@ type InstanceIDPOIDCConfigWriteModel struct { OIDCConfigWriteModel } -func NewInstanceIDPOIDCConfigWriteModel(idpConfigID string) *InstanceIDPOIDCConfigWriteModel { +func NewInstanceIDPOIDCConfigWriteModel(ctx context.Context, idpConfigID string) *InstanceIDPOIDCConfigWriteModel { return &InstanceIDPOIDCConfigWriteModel{ OIDCConfigWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, IDPConfigID: idpConfigID, }, diff --git a/internal/command/instance_idp_oidc_config_test.go b/internal/command/instance_idp_oidc_config_test.go index b1bc654f50..415278dda6 100644 --- a/internal/command/instance_idp_oidc_config_test.go +++ b/internal/command/instance_idp_oidc_config_test.go @@ -24,8 +24,9 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { } type ( args struct { - ctx context.Context - config *domain.OIDCIDPConfig + ctx context.Context + instanceID string + config *domain.OIDCIDPConfig } ) type res struct { @@ -46,8 +47,9 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - config: &domain.OIDCIDPConfig{}, + ctx: context.Background(), + instanceID: "INSTANCE", + config: &domain.OIDCIDPConfig{}, }, res: res{ err: caos_errs.IsErrorInvalidArgument, @@ -62,7 +64,8 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.OIDCIDPConfig{ IDPConfigID: "config1", }, @@ -79,7 +82,7 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeOIDC, @@ -89,7 +92,7 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPOIDCConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "clientid1", "config1", "issuer", @@ -108,7 +111,7 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPConfigRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name", ), @@ -117,7 +120,8 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.OIDCIDPConfig{ IDPConfigID: "config1", }, @@ -134,7 +138,7 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeOIDC, @@ -144,7 +148,7 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPOIDCConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "clientid1", "config1", "issuer", @@ -166,7 +170,8 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { secretCrypto: crypto.CreateMockEncryptionAlg(gomock.NewController(t)), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.OIDCIDPConfig{ IDPConfigID: "config1", ClientID: "clientid1", @@ -190,7 +195,7 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name1", domain.IDPConfigTypeOIDC, @@ -200,7 +205,7 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { ), eventFromEventPusher( instance.NewIDPOIDCConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "clientid1", "config1", "issuer", @@ -244,7 +249,8 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { secretCrypto: crypto.CreateMockEncryptionAlg(gomock.NewController(t)), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", config: &domain.OIDCIDPConfig{ IDPConfigID: "config1", ClientID: "clientid-changed", @@ -260,8 +266,8 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { res: res{ want: &domain.OIDCIDPConfig{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, IDPConfigID: "config1", ClientID: "clientid-changed", @@ -297,7 +303,7 @@ func TestCommandSide_ChangeDefaultIDPOIDCConfig(t *testing.T) { func newDefaultIDPOIDCConfigChangedEvent(ctx context.Context, configID, clientID, issuer, authorizationEndpoint, tokenEndpoint string, secret *crypto.CryptoValue, displayMapping, usernameMapping domain.OIDCMappingField, scopes []string) *instance.IDPOIDCConfigChangedEvent { event, _ := instance.NewIDPOIDCConfigChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, configID, []idpconfig.OIDCConfigChanges{ idpconfig.ChangeClientID(clientID), diff --git a/internal/command/instance_member.go b/internal/command/instance_member.go index b2584e58b3..a4bbe45f9b 100644 --- a/internal/command/instance_member.go +++ b/internal/command/instance_member.go @@ -17,7 +17,7 @@ func (c *Commands) AddInstanceMember(ctx context.Context, member *domain.Member) if member.UserID == "" { return nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-Mf83b", "Errors.IAM.MemberInvalid") } - addedMember := NewInstanceMemberWriteModel(member.UserID) + addedMember := NewInstanceMemberWriteModel(ctx, member.UserID) instanceAgg := InstanceAggregateFromWriteModel(&addedMember.MemberWriteModel.WriteModel) err := c.checkUserExists(ctx, addedMember.UserID, "") if err != nil { @@ -128,7 +128,7 @@ func (c *Commands) instanceMemberWriteModelByID(ctx context.Context, userID stri ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstanceMemberWriteModel(userID) + writeModel := NewInstanceMemberWriteModel(ctx, userID) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_member_model.go b/internal/command/instance_member_model.go index d45620417a..656d17e6c7 100644 --- a/internal/command/instance_member_model.go +++ b/internal/command/instance_member_model.go @@ -1,7 +1,9 @@ package command import ( - "github.com/caos/zitadel/internal/domain" + "context" + + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" ) @@ -10,12 +12,12 @@ type InstanceMemberWriteModel struct { MemberWriteModel } -func NewInstanceMemberWriteModel(userID string) *InstanceMemberWriteModel { +func NewInstanceMemberWriteModel(ctx context.Context, userID string) *InstanceMemberWriteModel { return &InstanceMemberWriteModel{ MemberWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, UserID: userID, }, diff --git a/internal/command/instance_member_test.go b/internal/command/instance_member_test.go index d86a758189..910518d38c 100644 --- a/internal/command/instance_member_test.go +++ b/internal/command/instance_member_test.go @@ -2,6 +2,8 @@ package command import ( "context" + "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" @@ -13,7 +15,6 @@ import ( "github.com/caos/zitadel/internal/repository/user" "github.com/stretchr/testify/assert" "golang.org/x/text/language" - "testing" ) func TestCommandSide_AddIAMMember(t *testing.T) { @@ -127,7 +128,7 @@ func TestCommandSide_AddIAMMember(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewMemberAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "user1", ), ), @@ -174,13 +175,13 @@ func TestCommandSide_AddIAMMember(t *testing.T) { expectFilter(), expectPushFailed(caos_errs.ThrowAlreadyExists(nil, "ERROR", "internal"), []*repository.Event{ - eventFromEventPusher(instance.NewMemberAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + eventFromEventPusherWithInstanceID("INSTANCE", instance.NewMemberAddedEvent(context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, "user1", []string{"IAM_OWNER"}..., )), }, - uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("IAM", "user1")), + uniqueConstraintsFromEventConstraintWithInstanceID("INSTANCE", member.NewAddMemberUniqueConstraint("INSTANCE", "user1")), ), ), zitadelRoles: []authz.RoleMapping{ @@ -190,7 +191,7 @@ func TestCommandSide_AddIAMMember(t *testing.T) { }, }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), member: &domain.Member{ UserID: "user1", Roles: []string{"IAM_OWNER"}, @@ -206,7 +207,8 @@ func TestCommandSide_AddIAMMember(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", user.NewHumanAddedEvent(context.Background(), &user.NewAggregate("user1", "org1").Aggregate, "username1", @@ -224,13 +226,15 @@ func TestCommandSide_AddIAMMember(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher(instance.NewMemberAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, - "user1", - []string{"IAM_OWNER"}..., - )), + eventFromEventPusherWithInstanceID( + "INSTANCE", + instance.NewMemberAddedEvent(context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, + "user1", + []string{"IAM_OWNER"}..., + )), }, - uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("IAM", "user1")), + uniqueConstraintsFromEventConstraintWithInstanceID("INSTANCE", member.NewAddMemberUniqueConstraint("INSTANCE", "user1")), ), ), zitadelRoles: []authz.RoleMapping{ @@ -240,7 +244,7 @@ func TestCommandSide_AddIAMMember(t *testing.T) { }, }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), member: &domain.Member{ UserID: "user1", Roles: []string{"IAM_OWNER"}, @@ -249,8 +253,9 @@ func TestCommandSide_AddIAMMember(t *testing.T) { res: res{ want: &domain.Member{ ObjectRoot: models.ObjectRoot{ - ResourceOwner: "IAM", - AggregateID: "IAM", + InstanceID: "INSTANCE", + ResourceOwner: "INSTANCE", + AggregateID: "INSTANCE", }, UserID: "user1", Roles: []string{"IAM_OWNER"}, @@ -284,8 +289,9 @@ func TestCommandSide_ChangeIAMMember(t *testing.T) { zitadelRoles []authz.RoleMapping } type args struct { - ctx context.Context - member *domain.Member + ctx context.Context + instanceID string + member *domain.Member } type res struct { want *domain.Member @@ -362,7 +368,7 @@ func TestCommandSide_ChangeIAMMember(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewMemberAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "user1", []string{"IAM_OWNER"}..., ), @@ -394,7 +400,7 @@ func TestCommandSide_ChangeIAMMember(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewMemberAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "user1", []string{"IAM_OWNER"}..., ), @@ -403,7 +409,7 @@ func TestCommandSide_ChangeIAMMember(t *testing.T) { expectPush( []*repository.Event{ eventFromEventPusher(instance.NewMemberChangedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "user1", []string{"IAM_OWNER", "IAM_OWNER_VIEWER"}..., )), @@ -429,8 +435,8 @@ func TestCommandSide_ChangeIAMMember(t *testing.T) { res: res{ want: &domain.Member{ ObjectRoot: models.ObjectRoot{ - ResourceOwner: "IAM", - AggregateID: "IAM", + ResourceOwner: "INSTANCE", + AggregateID: "INSTANCE", }, UserID: "user1", Roles: []string{"IAM_OWNER", "IAM_OWNER_VIEWER"}, @@ -463,8 +469,9 @@ func TestCommandSide_RemoveIAMMember(t *testing.T) { eventstore *eventstore.Eventstore } type args struct { - ctx context.Context - userID string + ctx context.Context + instanceID string + userID string } type res struct { want *domain.ObjectDetails @@ -515,7 +522,7 @@ func TestCommandSide_RemoveIAMMember(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewMemberAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "user1", []string{"IAM_OWNER"}..., ), @@ -524,11 +531,11 @@ func TestCommandSide_RemoveIAMMember(t *testing.T) { expectPush( []*repository.Event{ eventFromEventPusher(instance.NewMemberRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "user1", )), }, - uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint("IAM", "user1")), + uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint("INSTANCE", "user1")), ), ), }, @@ -538,7 +545,7 @@ func TestCommandSide_RemoveIAMMember(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, diff --git a/internal/command/instance_model.go b/internal/command/instance_model.go index ab646e78d6..888aef87a7 100644 --- a/internal/command/instance_model.go +++ b/internal/command/instance_model.go @@ -1,15 +1,20 @@ package command import ( + "golang.org/x/text/language" + "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" - "golang.org/x/text/language" ) type InstanceWriteModel struct { eventstore.WriteModel + Name string + State domain.InstanceState + GeneratedDomain string + SetUpStarted domain.Step SetUpDone domain.Step @@ -18,11 +23,11 @@ type InstanceWriteModel struct { DefaultLanguage language.Tag } -func NewInstanceWriteModel() *InstanceWriteModel { +func NewInstanceWriteModel(instanceID string) *InstanceWriteModel { return &InstanceWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: instanceID, + ResourceOwner: instanceID, }, } } @@ -30,6 +35,18 @@ func NewInstanceWriteModel() *InstanceWriteModel { func (wm *InstanceWriteModel) Reduce() error { for _, event := range wm.Events { switch e := event.(type) { + case *instance.InstanceAddedEvent: + wm.Name = e.Name + wm.State = domain.InstanceStateActive + case *instance.InstanceChangedEvent: + wm.Name = e.Name + case *instance.InstanceRemovedEvent: + wm.State = domain.InstanceStateRemoved + case *instance.DomainAddedEvent: + if !e.Generated { + continue + } + wm.GeneratedDomain = e.Domain case *instance.ProjectSetEvent: wm.ProjectID = e.ProjectID case *instance.GlobalOrgSetEvent: @@ -54,6 +71,11 @@ func (wm *InstanceWriteModel) Query() *eventstore.SearchQueryBuilder { AggregateTypes(instance.AggregateType). AggregateIDs(wm.AggregateID). EventTypes( + instance.InstanceAddedEventType, + instance.InstanceChangedEventType, + instance.InstanceRemovedEventType, + instance.InstanceDomainAddedEventType, + instance.InstanceDomainRemovedEventType, instance.ProjectSetEventType, instance.GlobalOrgSetEventType, instance.DefaultLanguageSetEventType, diff --git a/internal/command/instance_oidc_settings.go b/internal/command/instance_oidc_settings.go index 01d5fe3b97..a04c4328e5 100644 --- a/internal/command/instance_oidc_settings.go +++ b/internal/command/instance_oidc_settings.go @@ -69,7 +69,7 @@ func (c *Commands) ChangeOIDCSettings(ctx context.Context, settings *domain.OIDC } func (c *Commands) getOIDCSettings(ctx context.Context) (_ *InstanceOIDCSettingsWriteModel, err error) { - writeModel := NewInstanceOIDCSettingsWriteModel() + writeModel := NewInstanceOIDCSettingsWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_oidc_settings_model.go b/internal/command/instance_oidc_settings_model.go index 0dc0ccce4c..d59eab7901 100644 --- a/internal/command/instance_oidc_settings_model.go +++ b/internal/command/instance_oidc_settings_model.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" @@ -19,11 +20,11 @@ type InstanceOIDCSettingsWriteModel struct { State domain.OIDCSettingsState } -func NewInstanceOIDCSettingsWriteModel() *InstanceOIDCSettingsWriteModel { +func NewInstanceOIDCSettingsWriteModel(ctx context.Context) *InstanceOIDCSettingsWriteModel { return &InstanceOIDCSettingsWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, } } diff --git a/internal/command/instance_oidc_settings_test.go b/internal/command/instance_oidc_settings_test.go index d664c80054..923254da03 100644 --- a/internal/command/instance_oidc_settings_test.go +++ b/internal/command/instance_oidc_settings_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/caos/zitadel/internal/api/authz" "github.com/stretchr/testify/assert" "github.com/caos/zitadel/internal/domain" @@ -40,7 +41,7 @@ func TestCommandSide_AddOIDCConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewOIDCSettingsAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, time.Hour*1, time.Hour*1, time.Hour*1, @@ -71,21 +72,23 @@ func TestCommandSide_AddOIDCConfig(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher(instance.NewOIDCSettingsAddedEvent( - context.Background(), - &instance.NewAggregate().Aggregate, - time.Hour*1, - time.Hour*1, - time.Hour*1, - time.Hour*1, - ), + eventFromEventPusherWithInstanceID( + "INSTANCE", + instance.NewOIDCSettingsAddedEvent( + context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, + time.Hour*1, + time.Hour*1, + time.Hour*1, + time.Hour*1, + ), ), }, ), ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), oidcConfig: &domain.OIDCSettings{ AccessTokenLifetime: 1 * time.Hour, IdTokenLifetime: 1 * time.Hour, @@ -95,7 +98,7 @@ func TestCommandSide_AddOIDCConfig(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -161,7 +164,7 @@ func TestCommandSide_ChangeOIDCConfig(t *testing.T) { eventFromEventPusher( instance.NewOIDCSettingsAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, time.Hour*1, time.Hour*1, time.Hour*1, @@ -193,7 +196,7 @@ func TestCommandSide_ChangeOIDCConfig(t *testing.T) { eventFromEventPusher( instance.NewOIDCSettingsAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, time.Hour*1, time.Hour*1, time.Hour*1, @@ -225,7 +228,7 @@ func TestCommandSide_ChangeOIDCConfig(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -257,7 +260,7 @@ func newOIDCConfigChangedEvent(ctx context.Context, accessTokenLifetime, idToken instance.ChangeOIDCSettingsRefreshTokenExpiration(refreshTokenExpiration), } event, _ := instance.NewOIDCSettingsChangeEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, changes, ) return event diff --git a/internal/command/instance_policy_domain.go b/internal/command/instance_policy_domain.go index dd111ea316..a5a00efc96 100644 --- a/internal/command/instance_policy_domain.go +++ b/internal/command/instance_policy_domain.go @@ -11,7 +11,7 @@ import ( ) func (c *Commands) AddDefaultDomainPolicy(ctx context.Context, policy *domain.DomainPolicy) (*domain.DomainPolicy, error) { - addedPolicy := NewInstanceDomainPolicyWriteModel() + addedPolicy := NewInstanceDomainPolicyWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&addedPolicy.WriteModel) event, err := c.addDefaultDomainPolicy(ctx, instanceAgg, addedPolicy, policy) if err != nil { @@ -83,7 +83,7 @@ func (c *Commands) defaultDomainPolicyWriteModelByID(ctx context.Context) (polic ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstanceDomainPolicyWriteModel() + writeModel := NewInstanceDomainPolicyWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_policy_domain_model.go b/internal/command/instance_policy_domain_model.go index 83c05367b0..3e487b5344 100644 --- a/internal/command/instance_policy_domain_model.go +++ b/internal/command/instance_policy_domain_model.go @@ -3,9 +3,9 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" ) @@ -14,12 +14,12 @@ type InstanceDomainPolicyWriteModel struct { PolicyDomainWriteModel } -func NewInstanceDomainPolicyWriteModel() *InstanceDomainPolicyWriteModel { +func NewInstanceDomainPolicyWriteModel(ctx context.Context) *InstanceDomainPolicyWriteModel { return &InstanceDomainPolicyWriteModel{ PolicyDomainWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_policy_domain_test.go b/internal/command/instance_policy_domain_test.go index 81b0467861..f22bed6af3 100644 --- a/internal/command/instance_policy_domain_test.go +++ b/internal/command/instance_policy_domain_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -40,7 +41,7 @@ func TestCommandSide_AddDefaultDomainPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewDomainPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -65,9 +66,10 @@ func TestCommandSide_AddDefaultDomainPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewDomainPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -76,7 +78,7 @@ func TestCommandSide_AddDefaultDomainPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.DomainPolicy{ UserLoginMustBeDomain: true, }, @@ -84,8 +86,9 @@ func TestCommandSide_AddDefaultDomainPolicy(t *testing.T) { res: res{ want: &domain.DomainPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, UserLoginMustBeDomain: true, }, @@ -155,7 +158,7 @@ func TestCommandSide_ChangeDefaultDomainPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewDomainPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -180,7 +183,7 @@ func TestCommandSide_ChangeDefaultDomainPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewDomainPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), ), @@ -203,8 +206,8 @@ func TestCommandSide_ChangeDefaultDomainPolicy(t *testing.T) { res: res{ want: &domain.DomainPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, UserLoginMustBeDomain: false, }, @@ -232,7 +235,7 @@ func TestCommandSide_ChangeDefaultDomainPolicy(t *testing.T) { func newDefaultDomainPolicyChangedEvent(ctx context.Context, userLoginMustBeDomain bool) *instance.DomainPolicyChangedEvent { event, _ := instance.NewDomainPolicyChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []policy.OrgPolicyChanges{ policy.ChangeUserLoginMustBeDomain(userLoginMustBeDomain), }, diff --git a/internal/command/instance_policy_label.go b/internal/command/instance_policy_label.go index 6917256290..6e3815801f 100644 --- a/internal/command/instance_policy_label.go +++ b/internal/command/instance_policy_label.go @@ -3,6 +3,7 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -11,7 +12,7 @@ import ( ) func (c *Commands) AddDefaultLabelPolicy(ctx context.Context, policy *domain.LabelPolicy) (*domain.LabelPolicy, error) { - addedPolicy := NewInstanceLabelPolicyWriteModel() + addedPolicy := NewInstanceLabelPolicyWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&addedPolicy.LabelPolicyWriteModel.WriteModel) event, err := c.addDefaultLabelPolicy(ctx, instanceAgg, addedPolicy, policy) if err != nil { @@ -157,7 +158,7 @@ func (c *Commands) RemoveLogoDefaultLabelPolicy(ctx context.Context) (*domain.Ob return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-Xc8Kf", "Errors.IAM.LabelPolicy.NotFound") } - err = c.RemoveAsset(ctx, domain.IAMID, existingPolicy.LogoKey) + err = c.RemoveAsset(ctx, authz.GetInstance(ctx).InstanceID(), existingPolicy.LogoKey) if err != nil { return nil, err } @@ -206,7 +207,7 @@ func (c *Commands) RemoveIconDefaultLabelPolicy(ctx context.Context) (*domain.Ob if existingPolicy.State == domain.PolicyStateUnspecified || existingPolicy.State == domain.PolicyStateRemoved { return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-4M0qw", "Errors.IAM.LabelPolicy.NotFound") } - err = c.RemoveAsset(ctx, domain.IAMID, existingPolicy.IconKey) + err = c.RemoveAsset(ctx, authz.GetInstance(ctx).InstanceID(), existingPolicy.IconKey) if err != nil { return nil, err } @@ -255,7 +256,7 @@ func (c *Commands) RemoveLogoDarkDefaultLabelPolicy(ctx context.Context) (*domai if existingPolicy.State == domain.PolicyStateUnspecified || existingPolicy.State == domain.PolicyStateRemoved { return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-3FGds", "Errors.IAM.LabelPolicy.NotFound") } - err = c.RemoveAsset(ctx, domain.IAMID, existingPolicy.LogoDarkKey) + err = c.RemoveAsset(ctx, authz.GetInstance(ctx).InstanceID(), existingPolicy.LogoDarkKey) if err != nil { return nil, err } @@ -304,7 +305,7 @@ func (c *Commands) RemoveIconDarkDefaultLabelPolicy(ctx context.Context) (*domai if existingPolicy.State == domain.PolicyStateUnspecified || existingPolicy.State == domain.PolicyStateRemoved { return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-2nc7F", "Errors.IAM.LabelPolicy.NotFound") } - err = c.RemoveAsset(ctx, domain.IAMID, existingPolicy.IconDarkKey) + err = c.RemoveAsset(ctx, authz.GetInstance(ctx).InstanceID(), existingPolicy.IconDarkKey) if err != nil { return nil, err } @@ -353,7 +354,7 @@ func (c *Commands) RemoveFontDefaultLabelPolicy(ctx context.Context) (*domain.Ob if existingPolicy.State == domain.PolicyStateUnspecified || existingPolicy.State == domain.PolicyStateRemoved { return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-Tk0gw", "Errors.IAM.LabelPolicy.NotFound") } - err = c.RemoveAsset(ctx, domain.IAMID, existingPolicy.FontKey) + err = c.RemoveAsset(ctx, authz.GetInstance(ctx).InstanceID(), existingPolicy.FontKey) if err != nil { return nil, err } @@ -373,7 +374,7 @@ func (c *Commands) defaultLabelPolicyWriteModelByID(ctx context.Context) (policy ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstanceLabelPolicyWriteModel() + writeModel := NewInstanceLabelPolicyWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_policy_label_model.go b/internal/command/instance_policy_label_model.go index 274f9f4614..2e96f19747 100644 --- a/internal/command/instance_policy_label_model.go +++ b/internal/command/instance_policy_label_model.go @@ -3,7 +3,7 @@ package command import ( "context" - "github.com/caos/zitadel/internal/domain" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" @@ -13,12 +13,12 @@ type InstanceLabelPolicyWriteModel struct { LabelPolicyWriteModel } -func NewInstanceLabelPolicyWriteModel() *InstanceLabelPolicyWriteModel { +func NewInstanceLabelPolicyWriteModel(ctx context.Context) *InstanceLabelPolicyWriteModel { return &InstanceLabelPolicyWriteModel{ LabelPolicyWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_policy_label_test.go b/internal/command/instance_policy_label_test.go index 91df747c05..1a4a3a3704 100644 --- a/internal/command/instance_policy_label_test.go +++ b/internal/command/instance_policy_label_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" @@ -44,7 +45,7 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -89,9 +90,10 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -110,7 +112,7 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.LabelPolicy{ PrimaryColor: "#ffffff", BackgroundColor: "#ffffff", @@ -128,8 +130,9 @@ func TestCommandSide_AddDefaultLabelPolicy(t *testing.T) { res: res{ want: &domain.LabelPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, PrimaryColor: "#ffffff", BackgroundColor: "#ffffff", @@ -211,7 +214,7 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -256,7 +259,7 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -311,8 +314,8 @@ func TestCommandSide_ChangeDefaultLabelPolicy(t *testing.T) { res: res{ want: &domain.LabelPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, PrimaryColor: "#000000", BackgroundColor: "#000000", @@ -388,7 +391,7 @@ func TestCommandSide_ActivateDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -407,7 +410,7 @@ func TestCommandSide_ActivateDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyActivatedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, ), ), }, @@ -419,7 +422,7 @@ func TestCommandSide_ActivateDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -500,7 +503,7 @@ func TestCommandSide_AddLogoDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -519,7 +522,7 @@ func TestCommandSide_AddLogoDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyLogoAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -533,7 +536,7 @@ func TestCommandSide_AddLogoDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -600,7 +603,7 @@ func TestCommandSide_RemoveLogoDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -616,7 +619,7 @@ func TestCommandSide_RemoveLogoDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyLogoAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -639,7 +642,7 @@ func TestCommandSide_RemoveLogoDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -655,7 +658,7 @@ func TestCommandSide_RemoveLogoDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyLogoAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -664,7 +667,7 @@ func TestCommandSide_RemoveLogoDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyLogoRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -677,7 +680,7 @@ func TestCommandSide_RemoveLogoDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -758,7 +761,7 @@ func TestCommandSide_AddIconDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -777,7 +780,7 @@ func TestCommandSide_AddIconDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyIconAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -791,7 +794,7 @@ func TestCommandSide_AddIconDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -857,7 +860,7 @@ func TestCommandSide_RemoveIconDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -873,7 +876,7 @@ func TestCommandSide_RemoveIconDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyIconAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -882,7 +885,7 @@ func TestCommandSide_RemoveIconDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyIconRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -895,7 +898,7 @@ func TestCommandSide_RemoveIconDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -926,6 +929,7 @@ func TestCommandSide_AddLogoDarkDefaultLabelPolicy(t *testing.T) { } type args struct { ctx context.Context + instanceID string storageKey string } type res struct { @@ -946,7 +950,8 @@ func TestCommandSide_AddLogoDarkDefaultLabelPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", }, res: res{ err: caos_errs.IsErrorInvalidArgument, @@ -962,6 +967,7 @@ func TestCommandSide_AddLogoDarkDefaultLabelPolicy(t *testing.T) { }, args: args{ ctx: context.Background(), + instanceID: "INSTANCE", storageKey: "key", }, res: res{ @@ -976,7 +982,7 @@ func TestCommandSide_AddLogoDarkDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -995,7 +1001,7 @@ func TestCommandSide_AddLogoDarkDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyLogoDarkAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1009,7 +1015,7 @@ func TestCommandSide_AddLogoDarkDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1075,7 +1081,7 @@ func TestCommandSide_RemoveLogoDarkDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -1091,7 +1097,7 @@ func TestCommandSide_RemoveLogoDarkDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyLogoDarkAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1114,7 +1120,7 @@ func TestCommandSide_RemoveLogoDarkDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -1130,7 +1136,7 @@ func TestCommandSide_RemoveLogoDarkDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyLogoDarkAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1139,7 +1145,7 @@ func TestCommandSide_RemoveLogoDarkDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyLogoDarkRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1152,7 +1158,7 @@ func TestCommandSide_RemoveLogoDarkDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1233,7 +1239,7 @@ func TestCommandSide_AddIconDarkDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -1252,7 +1258,7 @@ func TestCommandSide_AddIconDarkDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyIconDarkAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1266,7 +1272,7 @@ func TestCommandSide_AddIconDarkDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1332,7 +1338,7 @@ func TestCommandSide_RemoveIconDarkDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -1348,7 +1354,7 @@ func TestCommandSide_RemoveIconDarkDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyIconDarkAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1371,7 +1377,7 @@ func TestCommandSide_RemoveIconDarkDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -1387,7 +1393,7 @@ func TestCommandSide_RemoveIconDarkDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyIconDarkAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1396,7 +1402,7 @@ func TestCommandSide_RemoveIconDarkDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyIconDarkRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1409,7 +1415,7 @@ func TestCommandSide_RemoveIconDarkDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1490,7 +1496,7 @@ func TestCommandSide_AddFontDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -1509,7 +1515,7 @@ func TestCommandSide_AddFontDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyFontAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1523,7 +1529,7 @@ func TestCommandSide_AddFontDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1589,7 +1595,7 @@ func TestCommandSide_RemoveFontDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -1605,7 +1611,7 @@ func TestCommandSide_RemoveFontDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyFontAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1628,7 +1634,7 @@ func TestCommandSide_RemoveFontDefaultLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -1644,7 +1650,7 @@ func TestCommandSide_RemoveFontDefaultLabelPolicy(t *testing.T) { ), eventFromEventPusher( instance.NewLabelPolicyFontAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1653,7 +1659,7 @@ func TestCommandSide_RemoveFontDefaultLabelPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLabelPolicyFontRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "key", ), ), @@ -1666,7 +1672,7 @@ func TestCommandSide_RemoveFontDefaultLabelPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1693,7 +1699,7 @@ func TestCommandSide_RemoveFontDefaultLabelPolicy(t *testing.T) { func newDefaultLabelPolicyChangedEvent(ctx context.Context, primaryColor, backgroundColor, warnColor, fontColor, primaryColorDark, backgroundColorDark, warnColorDark, fontColorDark string, hideLoginNameSuffix, errMsgPopup, disableWatermark bool) *instance.LabelPolicyChangedEvent { event, _ := instance.NewLabelPolicyChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []policy.LabelPolicyChanges{ policy.ChangePrimaryColor(primaryColor), policy.ChangeBackgroundColor(backgroundColor), diff --git a/internal/command/instance_policy_login.go b/internal/command/instance_policy_login.go index de284383d2..2ff8451987 100644 --- a/internal/command/instance_policy_login.go +++ b/internal/command/instance_policy_login.go @@ -12,7 +12,7 @@ import ( ) func (c *Commands) getDefaultLoginPolicy(ctx context.Context) (*domain.LoginPolicy, error) { - policyWriteModel := NewInstanceLoginPolicyWriteModel() + policyWriteModel := NewInstanceLoginPolicyWriteModel(ctx) err := c.eventstore.FilterToQueryReducer(ctx, policyWriteModel) if err != nil { return nil, err @@ -23,7 +23,7 @@ func (c *Commands) getDefaultLoginPolicy(ctx context.Context) (*domain.LoginPoli } func (c *Commands) AddDefaultLoginPolicy(ctx context.Context, policy *domain.LoginPolicy) (*domain.LoginPolicy, error) { - addedPolicy := NewInstanceLoginPolicyWriteModel() + addedPolicy := NewInstanceLoginPolicyWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&addedPolicy.WriteModel) event, err := c.addDefaultLoginPolicy(ctx, instanceAgg, addedPolicy, policy) if err != nil { @@ -65,7 +65,7 @@ func (c *Commands) addDefaultLoginPolicy(ctx context.Context, instanceAgg *event } func (c *Commands) ChangeDefaultLoginPolicy(ctx context.Context, policy *domain.LoginPolicy) (*domain.LoginPolicy, error) { - existingPolicy := NewInstanceLoginPolicyWriteModel() + existingPolicy := NewInstanceLoginPolicyWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&existingPolicy.LoginPolicyWriteModel.WriteModel) event, err := c.changeDefaultLoginPolicy(ctx, instanceAgg, existingPolicy, policy) if err != nil { @@ -113,7 +113,7 @@ func (c *Commands) AddIDPProviderToDefaultLoginPolicy(ctx context.Context, idpPr if !idpProvider.IsValid() { return nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-9nf88", "Errors.IAM.LoginPolicy.IDP.Invalid") } - existingPolicy := NewInstanceLoginPolicyWriteModel() + existingPolicy := NewInstanceLoginPolicyWriteModel(ctx) err := c.defaultLoginPolicyWriteModelByID(ctx, existingPolicy) if err != nil { return nil, err @@ -126,7 +126,7 @@ func (c *Commands) AddIDPProviderToDefaultLoginPolicy(ctx context.Context, idpPr if err != nil { return nil, caos_errs.ThrowPreconditionFailed(err, "INSTANCE-m8fsd", "Errors.IDPConfig.NotExisting") } - idpModel := NewInstanceIdentityProviderWriteModel(idpProvider.IDPConfigID) + idpModel := NewInstanceIdentityProviderWriteModel(ctx, idpProvider.IDPConfigID) err = c.eventstore.FilterToQueryReducer(ctx, idpModel) if err != nil { return nil, err @@ -151,7 +151,7 @@ func (c *Commands) RemoveIDPProviderFromDefaultLoginPolicy(ctx context.Context, if !idpProvider.IsValid() { return nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-66m9s", "Errors.IAM.LoginPolicy.IDP.Invalid") } - existingPolicy := NewInstanceLoginPolicyWriteModel() + existingPolicy := NewInstanceLoginPolicyWriteModel(ctx) err := c.defaultLoginPolicyWriteModelByID(ctx, existingPolicy) if err != nil { return nil, err @@ -160,7 +160,7 @@ func (c *Commands) RemoveIDPProviderFromDefaultLoginPolicy(ctx context.Context, return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-Dfg4t", "Errors.IAM.LoginPolicy.NotFound") } - idpModel := NewInstanceIdentityProviderWriteModel(idpProvider.IDPConfigID) + idpModel := NewInstanceIdentityProviderWriteModel(ctx, idpProvider.IDPConfigID) err = c.eventstore.FilterToQueryReducer(ctx, idpModel) if err != nil { return nil, err @@ -193,7 +193,7 @@ func (c *Commands) removeIDPProviderFromDefaultLoginPolicy(ctx context.Context, for _, idp := range cascadeExternalIDPs { userEvent, _, err := c.removeUserIDPLink(ctx, idp, true) if err != nil { - logging.LogWithFields("COMMAND-4nfsf", "userid", idp.AggregateID, "idp-id", idp.IDPConfigID).WithError(err).Warn("could not cascade remove externalidp in remove provider from policy") + logging.WithFields("COMMAND-4nfsf", "userid", idp.AggregateID, "idp-id", idp.IDPConfigID).WithError(err).Warn("could not cascade remove externalidp in remove provider from policy") continue } events = append(events, userEvent) @@ -205,7 +205,7 @@ func (c *Commands) AddSecondFactorToDefaultLoginPolicy(ctx context.Context, seco if !secondFactor.Valid() { return domain.SecondFactorTypeUnspecified, nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-5m9fs", "Errors.IAM.LoginPolicy.MFA.Unspecified") } - secondFactorModel := NewInstanceSecondFactorWriteModel(secondFactor) + secondFactorModel := NewInstanceSecondFactorWriteModel(ctx, secondFactor) instanceAgg := InstanceAggregateFromWriteModel(&secondFactorModel.SecondFactorWriteModel.WriteModel) event, err := c.addSecondFactorToDefaultLoginPolicy(ctx, instanceAgg, secondFactorModel, secondFactor) if err != nil { @@ -239,7 +239,7 @@ func (c *Commands) RemoveSecondFactorFromDefaultLoginPolicy(ctx context.Context, if !secondFactor.Valid() { return nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-55n8s", "Errors.IAM.LoginPolicy.MFA.Unspecified") } - secondFactorModel := NewInstanceSecondFactorWriteModel(secondFactor) + secondFactorModel := NewInstanceSecondFactorWriteModel(ctx, secondFactor) err := c.eventstore.FilterToQueryReducer(ctx, secondFactorModel) if err != nil { return nil, err @@ -263,7 +263,7 @@ func (c *Commands) AddMultiFactorToDefaultLoginPolicy(ctx context.Context, multi if !multiFactor.Valid() { return domain.MultiFactorTypeUnspecified, nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-5m9fs", "Errors.IAM.LoginPolicy.MFA.Unspecified") } - multiFactorModel := NewInstanceMultiFactorWriteModel(multiFactor) + multiFactorModel := NewInstanceMultiFactorWriteModel(ctx, multiFactor) instanceAgg := InstanceAggregateFromWriteModel(&multiFactorModel.MultiFactorWriteModel.WriteModel) event, err := c.addMultiFactorToDefaultLoginPolicy(ctx, instanceAgg, multiFactorModel, multiFactor) if err != nil { @@ -297,7 +297,7 @@ func (c *Commands) RemoveMultiFactorFromDefaultLoginPolicy(ctx context.Context, if !multiFactor.Valid() { return nil, caos_errs.ThrowInvalidArgument(nil, "INSTANCE-33m9F", "Errors.IAM.LoginPolicy.MFA.Unspecified") } - multiFactorModel := NewInstanceMultiFactorWriteModel(multiFactor) + multiFactorModel := NewInstanceMultiFactorWriteModel(ctx, multiFactor) err := c.eventstore.FilterToQueryReducer(ctx, multiFactorModel) if err != nil { return nil, err diff --git a/internal/command/instance_policy_login_factors_model.go b/internal/command/instance_policy_login_factors_model.go index eb7a9ed6de..44ed8b77bd 100644 --- a/internal/command/instance_policy_login_factors_model.go +++ b/internal/command/instance_policy_login_factors_model.go @@ -1,6 +1,9 @@ package command import ( + "context" + + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" @@ -10,12 +13,12 @@ type InstanceSecondFactorWriteModel struct { SecondFactorWriteModel } -func NewInstanceSecondFactorWriteModel(factorType domain.SecondFactorType) *InstanceSecondFactorWriteModel { +func NewInstanceSecondFactorWriteModel(ctx context.Context, factorType domain.SecondFactorType) *InstanceSecondFactorWriteModel { return &InstanceSecondFactorWriteModel{ SecondFactorWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, MFAType: factorType, }, @@ -57,12 +60,12 @@ type InstanceMultiFactorWriteModel struct { MultiFactorWriteModel } -func NewInstanceMultiFactorWriteModel(factorType domain.MultiFactorType) *InstanceMultiFactorWriteModel { +func NewInstanceMultiFactorWriteModel(ctx context.Context, factorType domain.MultiFactorType) *InstanceMultiFactorWriteModel { return &InstanceMultiFactorWriteModel{ MultiFactorWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, MFAType: factorType, }, diff --git a/internal/command/instance_policy_login_identity_provider_model.go b/internal/command/instance_policy_login_identity_provider_model.go index e29799ca68..870d72343f 100644 --- a/internal/command/instance_policy_login_identity_provider_model.go +++ b/internal/command/instance_policy_login_identity_provider_model.go @@ -1,7 +1,9 @@ package command import ( - "github.com/caos/zitadel/internal/domain" + "context" + + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" ) @@ -10,12 +12,12 @@ type InstanceIdentityProviderWriteModel struct { IdentityProviderWriteModel } -func NewInstanceIdentityProviderWriteModel(idpConfigID string) *InstanceIdentityProviderWriteModel { +func NewInstanceIdentityProviderWriteModel(ctx context.Context, idpConfigID string) *InstanceIdentityProviderWriteModel { return &InstanceIdentityProviderWriteModel{ IdentityProviderWriteModel: IdentityProviderWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, IDPConfigID: idpConfigID, }, diff --git a/internal/command/instance_policy_login_model.go b/internal/command/instance_policy_login_model.go index 91614e2678..899da6c499 100644 --- a/internal/command/instance_policy_login_model.go +++ b/internal/command/instance_policy_login_model.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/domain" @@ -15,12 +16,12 @@ type InstanceLoginPolicyWriteModel struct { LoginPolicyWriteModel } -func NewInstanceLoginPolicyWriteModel() *InstanceLoginPolicyWriteModel { +func NewInstanceLoginPolicyWriteModel(ctx context.Context) *InstanceLoginPolicyWriteModel { return &InstanceLoginPolicyWriteModel{ LoginPolicyWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_policy_login_test.go b/internal/command/instance_policy_login_test.go index 80914390db..8760d3fc5b 100644 --- a/internal/command/instance_policy_login_test.go +++ b/internal/command/instance_policy_login_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -43,7 +44,7 @@ func TestCommandSide_AddDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, false, @@ -80,9 +81,10 @@ func TestCommandSide_AddDefaultLoginPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -101,7 +103,7 @@ func TestCommandSide_AddDefaultLoginPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.LoginPolicy{ AllowRegister: true, AllowUsernamePassword: true, @@ -119,8 +121,9 @@ func TestCommandSide_AddDefaultLoginPolicy(t *testing.T) { res: res{ want: &domain.LoginPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, AllowRegister: true, AllowUsernamePassword: true, @@ -201,7 +204,7 @@ func TestCommandSide_ChangeDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -244,9 +247,10 @@ func TestCommandSide_ChangeDefaultLoginPolicy(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -263,7 +267,8 @@ func TestCommandSide_ChangeDefaultLoginPolicy(t *testing.T) { ), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", newDefaultLoginPolicyChangedEvent(context.Background(), false, false, @@ -282,7 +287,7 @@ func TestCommandSide_ChangeDefaultLoginPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.LoginPolicy{ AllowRegister: false, AllowUsernamePassword: false, @@ -300,8 +305,9 @@ func TestCommandSide_ChangeDefaultLoginPolicy(t *testing.T) { res: res{ want: &domain.LoginPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, AllowRegister: false, AllowUsernamePassword: false, @@ -396,7 +402,7 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -432,7 +438,7 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -450,7 +456,7 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name", domain.IDPConfigTypeOIDC, @@ -462,7 +468,7 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIdentityProviderAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", ), ), @@ -485,9 +491,10 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -503,9 +510,10 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { ), ), expectFilter( - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewIDPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", "name", domain.IDPConfigTypeOIDC, @@ -517,9 +525,10 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewIdentityProviderAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1"), ), }, @@ -527,7 +536,7 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), provider: &domain.IDPProvider{ IDPConfigID: "config1", }, @@ -535,8 +544,9 @@ func TestCommandSide_AddIDPProviderDefaultLoginPolicy(t *testing.T) { res: res{ want: &domain.IDPProvider{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, IDPConfigID: "config1", }, @@ -622,7 +632,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -658,7 +668,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -676,13 +686,13 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIdentityProviderAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", ), ), eventFromEventPusher( instance.NewIdentityProviderRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", ), ), @@ -707,7 +717,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -725,7 +735,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIdentityProviderAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", ), ), @@ -734,7 +744,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewIdentityProviderRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1"), ), }, @@ -749,7 +759,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -761,7 +771,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -779,7 +789,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIdentityProviderAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", ), ), @@ -788,7 +798,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewIdentityProviderRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1"), ), }, @@ -811,7 +821,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -823,7 +833,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -841,7 +851,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewIdentityProviderAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1", ), ), @@ -857,7 +867,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewIdentityProviderRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "config1"), ), eventFromEventPusher( @@ -886,7 +896,7 @@ func TestCommandSide_RemoveIDPProviderDefaultLoginPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -951,7 +961,7 @@ func TestCommandSide_AddSecondFactorDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicySecondFactorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecondFactorTypeOTP, ), ), @@ -974,9 +984,10 @@ func TestCommandSide_AddSecondFactorDefaultLoginPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewLoginPolicySecondFactorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecondFactorTypeOTP), ), }, @@ -984,12 +995,12 @@ func TestCommandSide_AddSecondFactorDefaultLoginPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), factor: domain.SecondFactorTypeOTP, }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1070,13 +1081,13 @@ func TestCommandSide_RemoveSecondFactorDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicySecondFactorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecondFactorTypeOTP, ), ), eventFromEventPusher( instance.NewLoginPolicySecondFactorRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecondFactorTypeOTP, ), ), @@ -1099,7 +1110,7 @@ func TestCommandSide_RemoveSecondFactorDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicySecondFactorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecondFactorTypeOTP, ), ), @@ -1108,7 +1119,7 @@ func TestCommandSide_RemoveSecondFactorDefaultLoginPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLoginPolicySecondFactorRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecondFactorTypeOTP), ), }, @@ -1121,7 +1132,7 @@ func TestCommandSide_RemoveSecondFactorDefaultLoginPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1186,7 +1197,7 @@ func TestCommandSide_AddMultiFactorDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyMultiFactorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.MultiFactorTypeU2FWithPIN, ), ), @@ -1209,9 +1220,10 @@ func TestCommandSide_AddMultiFactorDefaultLoginPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewLoginPolicyMultiFactorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.MultiFactorTypeU2FWithPIN), ), }, @@ -1219,12 +1231,12 @@ func TestCommandSide_AddMultiFactorDefaultLoginPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), factor: domain.MultiFactorTypeU2FWithPIN, }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1305,13 +1317,13 @@ func TestCommandSide_RemoveMultiFactorDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyMultiFactorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.MultiFactorTypeU2FWithPIN, ), ), eventFromEventPusher( instance.NewLoginPolicyMultiFactorRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.MultiFactorTypeU2FWithPIN, ), ), @@ -1334,7 +1346,7 @@ func TestCommandSide_RemoveMultiFactorDefaultLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyMultiFactorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.MultiFactorTypeU2FWithPIN, ), ), @@ -1343,7 +1355,7 @@ func TestCommandSide_RemoveMultiFactorDefaultLoginPolicy(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewLoginPolicyMultiFactorRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.MultiFactorTypeU2FWithPIN), ), }, @@ -1356,7 +1368,7 @@ func TestCommandSide_RemoveMultiFactorDefaultLoginPolicy(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -1384,7 +1396,7 @@ func newDefaultLoginPolicyChangedEvent(ctx context.Context, allowRegister, allow passwordlessType domain.PasswordlessType, passwordLifetime, externalLoginLifetime, mfaInitSkipLifetime, secondFactorLifetime, multiFactorLifetime time.Duration) *instance.LoginPolicyChangedEvent { event, _ := instance.NewLoginPolicyChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []policy.LoginPolicyChanges{ policy.ChangeAllowRegister(allowRegister), policy.ChangeAllowExternalIDP(allowExternalIDP), diff --git a/internal/command/instance_policy_mail_template.go b/internal/command/instance_policy_mail_template.go index b21e75df97..b01c5fefd5 100644 --- a/internal/command/instance_policy_mail_template.go +++ b/internal/command/instance_policy_mail_template.go @@ -11,7 +11,7 @@ import ( ) func (c *Commands) AddDefaultMailTemplate(ctx context.Context, policy *domain.MailTemplate) (*domain.MailTemplate, error) { - addedPolicy := NewInstanceMailTemplateWriteModel() + addedPolicy := NewInstanceMailTemplateWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&addedPolicy.MailTemplateWriteModel.WriteModel) event, err := c.addDefaultMailTemplate(ctx, instanceAgg, addedPolicy, policy) if err != nil { @@ -86,7 +86,7 @@ func (c *Commands) defaultMailTemplateWriteModelByID(ctx context.Context) (polic ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstanceMailTemplateWriteModel() + writeModel := NewInstanceMailTemplateWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_policy_mail_template_model.go b/internal/command/instance_policy_mail_template_model.go index 4a58e458f5..0066c8d386 100644 --- a/internal/command/instance_policy_mail_template_model.go +++ b/internal/command/instance_policy_mail_template_model.go @@ -4,9 +4,9 @@ import ( "context" "reflect" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" ) @@ -15,12 +15,12 @@ type InstanceMailTemplateWriteModel struct { MailTemplateWriteModel } -func NewInstanceMailTemplateWriteModel() *InstanceMailTemplateWriteModel { +func NewInstanceMailTemplateWriteModel(ctx context.Context) *InstanceMailTemplateWriteModel { return &InstanceMailTemplateWriteModel{ MailTemplateWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_policy_mail_template_test.go b/internal/command/instance_policy_mail_template_test.go index ea12e08cc9..aa4d1e3ce6 100644 --- a/internal/command/instance_policy_mail_template_test.go +++ b/internal/command/instance_policy_mail_template_test.go @@ -2,6 +2,9 @@ package command import ( "context" + "testing" + + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -10,7 +13,6 @@ import ( "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" "github.com/stretchr/testify/assert" - "testing" ) func TestCommandSide_AddDefaultMailTemplatePolicy(t *testing.T) { @@ -54,7 +56,7 @@ func TestCommandSide_AddDefaultMailTemplatePolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewMailTemplateAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []byte("template"), ), ), @@ -79,9 +81,10 @@ func TestCommandSide_AddDefaultMailTemplatePolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewMailTemplateAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []byte("template"), ), ), @@ -90,7 +93,7 @@ func TestCommandSide_AddDefaultMailTemplatePolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.MailTemplate{ Template: []byte("template"), }, @@ -98,8 +101,9 @@ func TestCommandSide_AddDefaultMailTemplatePolicy(t *testing.T) { res: res{ want: &domain.MailTemplate{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, Template: []byte("template"), }, @@ -184,7 +188,7 @@ func TestCommandSide_ChangeDefaultMailTemplatePolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewMailTemplateAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []byte("template"), ), ), @@ -209,7 +213,7 @@ func TestCommandSide_ChangeDefaultMailTemplatePolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewMailTemplateAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []byte("template"), ), ), @@ -232,8 +236,8 @@ func TestCommandSide_ChangeDefaultMailTemplatePolicy(t *testing.T) { res: res{ want: &domain.MailTemplate{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, Template: []byte("template-change"), }, @@ -261,7 +265,7 @@ func TestCommandSide_ChangeDefaultMailTemplatePolicy(t *testing.T) { func newDefaultMailTemplatePolicyChangedEvent(ctx context.Context, template []byte) *instance.MailTemplateChangedEvent { event, _ := instance.NewMailTemplateChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []policy.MailTemplateChanges{ policy.ChangeTemplate(template), }, diff --git a/internal/command/instance_policy_password_age.go b/internal/command/instance_policy_password_age.go index 9e4340c4c4..be563a390e 100644 --- a/internal/command/instance_policy_password_age.go +++ b/internal/command/instance_policy_password_age.go @@ -11,7 +11,7 @@ import ( ) func (c *Commands) AddDefaultPasswordAgePolicy(ctx context.Context, policy *domain.PasswordAgePolicy) (*domain.PasswordAgePolicy, error) { - addedPolicy := NewInstancePasswordAgePolicyWriteModel() + addedPolicy := NewInstancePasswordAgePolicyWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&addedPolicy.WriteModel) event, err := c.addDefaultPasswordAgePolicy(ctx, instanceAgg, addedPolicy, policy) if err != nil { @@ -73,7 +73,7 @@ func (c *Commands) defaultPasswordAgePolicyWriteModelByID(ctx context.Context) ( ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstancePasswordAgePolicyWriteModel() + writeModel := NewInstancePasswordAgePolicyWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_policy_password_age_test.go b/internal/command/instance_policy_password_age_test.go index 54410cbe32..8c7d949c1c 100644 --- a/internal/command/instance_policy_password_age_test.go +++ b/internal/command/instance_policy_password_age_test.go @@ -2,6 +2,9 @@ package command import ( "context" + "testing" + + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -10,7 +13,6 @@ import ( "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" "github.com/stretchr/testify/assert" - "testing" ) func TestCommandSide_AddDefaultPasswordAgePolicy(t *testing.T) { @@ -39,7 +41,7 @@ func TestCommandSide_AddDefaultPasswordAgePolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPasswordAgePolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 365, 10, ), @@ -66,9 +68,10 @@ func TestCommandSide_AddDefaultPasswordAgePolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewPasswordAgePolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 365, 10, ), @@ -78,7 +81,7 @@ func TestCommandSide_AddDefaultPasswordAgePolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.PasswordAgePolicy{ ExpireWarnDays: 365, MaxAgeDays: 10, @@ -87,8 +90,9 @@ func TestCommandSide_AddDefaultPasswordAgePolicy(t *testing.T) { res: res{ want: &domain.PasswordAgePolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, ExpireWarnDays: 365, MaxAgeDays: 10, @@ -160,7 +164,7 @@ func TestCommandSide_ChangeDefaultPasswordAgePolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPasswordAgePolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 365, 10, ), @@ -187,7 +191,7 @@ func TestCommandSide_ChangeDefaultPasswordAgePolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPasswordAgePolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 365, 10, ), @@ -212,8 +216,8 @@ func TestCommandSide_ChangeDefaultPasswordAgePolicy(t *testing.T) { res: res{ want: &domain.PasswordAgePolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, MaxAgeDays: 125, ExpireWarnDays: 5, @@ -242,7 +246,7 @@ func TestCommandSide_ChangeDefaultPasswordAgePolicy(t *testing.T) { func newDefaultPasswordAgePolicyChangedEvent(ctx context.Context, maxAgeDays, expiryWarnDays uint64) *instance.PasswordAgePolicyChangedEvent { event, _ := instance.NewPasswordAgePolicyChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []policy.PasswordAgePolicyChanges{ policy.ChangeExpireWarnDays(expiryWarnDays), policy.ChangeMaxAgeDays(maxAgeDays), diff --git a/internal/command/instance_policy_password_complexity.go b/internal/command/instance_policy_password_complexity.go index 44b941ff1d..13edd96d82 100644 --- a/internal/command/instance_policy_password_complexity.go +++ b/internal/command/instance_policy_password_complexity.go @@ -11,7 +11,7 @@ import ( ) func (c *Commands) getDefaultPasswordComplexityPolicy(ctx context.Context) (*domain.PasswordComplexityPolicy, error) { - policyWriteModel := NewInstancePasswordComplexityPolicyWriteModel() + policyWriteModel := NewInstancePasswordComplexityPolicyWriteModel(ctx) err := c.eventstore.FilterToQueryReducer(ctx, policyWriteModel) if err != nil { return nil, err @@ -25,7 +25,7 @@ func (c *Commands) getDefaultPasswordComplexityPolicy(ctx context.Context) (*dom } func (c *Commands) AddDefaultPasswordComplexityPolicy(ctx context.Context, policy *domain.PasswordComplexityPolicy) (*domain.PasswordComplexityPolicy, error) { - addedPolicy := NewInstancePasswordComplexityPolicyWriteModel() + addedPolicy := NewInstancePasswordComplexityPolicyWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&addedPolicy.WriteModel) events, err := c.addDefaultPasswordComplexityPolicy(ctx, instanceAgg, addedPolicy, policy) if err != nil { @@ -92,7 +92,7 @@ func (c *Commands) defaultPasswordComplexityPolicyWriteModelByID(ctx context.Con ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstancePasswordComplexityPolicyWriteModel() + writeModel := NewInstancePasswordComplexityPolicyWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_policy_password_complexity_model.go b/internal/command/instance_policy_password_complexity_model.go index b264293e9c..8e56a56c72 100644 --- a/internal/command/instance_policy_password_complexity_model.go +++ b/internal/command/instance_policy_password_complexity_model.go @@ -3,9 +3,9 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" ) @@ -14,12 +14,12 @@ type InstancePasswordComplexityPolicyWriteModel struct { PasswordComplexityPolicyWriteModel } -func NewInstancePasswordComplexityPolicyWriteModel() *InstancePasswordComplexityPolicyWriteModel { +func NewInstancePasswordComplexityPolicyWriteModel(ctx context.Context) *InstancePasswordComplexityPolicyWriteModel { return &InstancePasswordComplexityPolicyWriteModel{ PasswordComplexityPolicyWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_policy_password_complexity_test.go b/internal/command/instance_policy_password_complexity_test.go index 5e780c1644..1dbe9b7176 100644 --- a/internal/command/instance_policy_password_complexity_test.go +++ b/internal/command/instance_policy_password_complexity_test.go @@ -2,6 +2,9 @@ package command import ( "context" + "testing" + + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -10,7 +13,6 @@ import ( "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" "github.com/stretchr/testify/assert" - "testing" ) func TestCommandSide_AddDefaultPasswordComplexityPolicy(t *testing.T) { @@ -60,7 +62,7 @@ func TestCommandSide_AddDefaultPasswordComplexityPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, true, true, true, true, ), @@ -69,7 +71,7 @@ func TestCommandSide_AddDefaultPasswordComplexityPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.PasswordComplexityPolicy{ MinLength: 8, HasUppercase: true, @@ -90,9 +92,10 @@ func TestCommandSide_AddDefaultPasswordComplexityPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewPasswordComplexityPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, true, true, true, true, ), @@ -102,7 +105,7 @@ func TestCommandSide_AddDefaultPasswordComplexityPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.PasswordComplexityPolicy{ MinLength: 8, HasUppercase: true, @@ -114,8 +117,9 @@ func TestCommandSide_AddDefaultPasswordComplexityPolicy(t *testing.T) { res: res{ want: &domain.PasswordComplexityPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, MinLength: 8, HasUppercase: true, @@ -214,7 +218,7 @@ func TestCommandSide_ChangeDefaultPasswordComplexityPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, true, true, true, true, ), @@ -244,7 +248,7 @@ func TestCommandSide_ChangeDefaultPasswordComplexityPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, true, true, true, true, ), @@ -272,8 +276,8 @@ func TestCommandSide_ChangeDefaultPasswordComplexityPolicy(t *testing.T) { res: res{ want: &domain.PasswordComplexityPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, MinLength: 10, HasUppercase: false, @@ -305,7 +309,7 @@ func TestCommandSide_ChangeDefaultPasswordComplexityPolicy(t *testing.T) { func newDefaultPasswordComplexityPolicyChangedEvent(ctx context.Context, minLength uint64, hasUpper, hasLower, hasNumber, hasSymbol bool) *instance.PasswordComplexityPolicyChangedEvent { event, _ := instance.NewPasswordComplexityPolicyChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []policy.PasswordComplexityPolicyChanges{ policy.ChangeMinLength(minLength), policy.ChangeHasUppercase(hasUpper), diff --git a/internal/command/instance_policy_password_lockout.go b/internal/command/instance_policy_password_lockout.go index 8f5d3c7f49..bcd8cfc496 100644 --- a/internal/command/instance_policy_password_lockout.go +++ b/internal/command/instance_policy_password_lockout.go @@ -11,7 +11,7 @@ import ( ) func (c *Commands) AddDefaultLockoutPolicy(ctx context.Context, policy *domain.LockoutPolicy) (*domain.LockoutPolicy, error) { - addedPolicy := NewInstanceLockoutPolicyWriteModel() + addedPolicy := NewInstanceLockoutPolicyWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&addedPolicy.WriteModel) event, err := c.addDefaultLockoutPolicy(ctx, instanceAgg, addedPolicy, policy) if err != nil { @@ -71,7 +71,7 @@ func (c *Commands) defaultLockoutPolicyWriteModelByID(ctx context.Context) (poli ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstanceLockoutPolicyWriteModel() + writeModel := NewInstanceLockoutPolicyWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_policy_password_lockout_model.go b/internal/command/instance_policy_password_lockout_model.go index 77b45d9182..24ec0d2905 100644 --- a/internal/command/instance_policy_password_lockout_model.go +++ b/internal/command/instance_policy_password_lockout_model.go @@ -3,9 +3,9 @@ package command import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" ) @@ -14,12 +14,12 @@ type InstanceLockoutPolicyWriteModel struct { LockoutPolicyWriteModel } -func NewInstanceLockoutPolicyWriteModel() *InstanceLockoutPolicyWriteModel { +func NewInstanceLockoutPolicyWriteModel(ctx context.Context) *InstanceLockoutPolicyWriteModel { return &InstanceLockoutPolicyWriteModel{ LockoutPolicyWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_policy_password_lockout_test.go b/internal/command/instance_policy_password_lockout_test.go index fd482aafbd..5e23b3d41c 100644 --- a/internal/command/instance_policy_password_lockout_test.go +++ b/internal/command/instance_policy_password_lockout_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" caos_errs "github.com/caos/zitadel/internal/errors" "github.com/caos/zitadel/internal/eventstore" @@ -40,7 +41,7 @@ func TestCommandSide_AddDefaultLockoutPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLockoutPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 10, true, ), @@ -67,9 +68,10 @@ func TestCommandSide_AddDefaultLockoutPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewLockoutPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 10, true, ), @@ -79,7 +81,7 @@ func TestCommandSide_AddDefaultLockoutPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.LockoutPolicy{ MaxPasswordAttempts: 10, ShowLockOutFailures: true, @@ -88,8 +90,9 @@ func TestCommandSide_AddDefaultLockoutPolicy(t *testing.T) { res: res{ want: &domain.LockoutPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, MaxPasswordAttempts: 10, ShowLockOutFailures: true, @@ -161,7 +164,7 @@ func TestCommandSide_ChangeDefaultLockoutPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLockoutPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 10, true, ), @@ -188,7 +191,7 @@ func TestCommandSide_ChangeDefaultLockoutPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLockoutPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 10, true, ), @@ -213,8 +216,8 @@ func TestCommandSide_ChangeDefaultLockoutPolicy(t *testing.T) { res: res{ want: &domain.LockoutPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, MaxPasswordAttempts: 20, ShowLockOutFailures: false, @@ -243,7 +246,7 @@ func TestCommandSide_ChangeDefaultLockoutPolicy(t *testing.T) { func newDefaultLockoutPolicyChangedEvent(ctx context.Context, maxAttempts uint64, showLockoutFailure bool) *instance.LockoutPolicyChangedEvent { event, _ := instance.NewLockoutPolicyChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []policy.LockoutPolicyChanges{ policy.ChangeMaxAttempts(maxAttempts), policy.ChangeShowLockOutFailures(showLockoutFailure), diff --git a/internal/command/instance_policy_privacy.go b/internal/command/instance_policy_privacy.go index 2e33c36a92..41074758b3 100644 --- a/internal/command/instance_policy_privacy.go +++ b/internal/command/instance_policy_privacy.go @@ -11,7 +11,7 @@ import ( ) func (c *Commands) getDefaultPrivacyPolicy(ctx context.Context) (*domain.PrivacyPolicy, error) { - policyWriteModel := NewInstancePrivacyPolicyWriteModel() + policyWriteModel := NewInstancePrivacyPolicyWriteModel(ctx) err := c.eventstore.FilterToQueryReducer(ctx, policyWriteModel) if err != nil { return nil, err @@ -25,7 +25,7 @@ func (c *Commands) getDefaultPrivacyPolicy(ctx context.Context) (*domain.Privacy } func (c *Commands) AddDefaultPrivacyPolicy(ctx context.Context, policy *domain.PrivacyPolicy) (*domain.PrivacyPolicy, error) { - addedPolicy := NewInstancePrivacyPolicyWriteModel() + addedPolicy := NewInstancePrivacyPolicyWriteModel(ctx) instanceAgg := InstanceAggregateFromWriteModel(&addedPolicy.WriteModel) events, err := c.addDefaultPrivacyPolicy(ctx, instanceAgg, addedPolicy, policy) if err != nil { @@ -84,7 +84,7 @@ func (c *Commands) defaultPrivacyPolicyWriteModelByID(ctx context.Context) (poli ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewInstancePrivacyPolicyWriteModel() + writeModel := NewInstancePrivacyPolicyWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_policy_privacy_model.go b/internal/command/instance_policy_privacy_model.go index cf7a5b4760..414f668480 100644 --- a/internal/command/instance_policy_privacy_model.go +++ b/internal/command/instance_policy_privacy_model.go @@ -3,7 +3,7 @@ package command import ( "context" - "github.com/caos/zitadel/internal/domain" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" "github.com/caos/zitadel/internal/repository/policy" @@ -13,12 +13,12 @@ type InstancePrivacyPolicyWriteModel struct { PrivacyPolicyWriteModel } -func NewInstancePrivacyPolicyWriteModel() *InstancePrivacyPolicyWriteModel { +func NewInstancePrivacyPolicyWriteModel(ctx context.Context) *InstancePrivacyPolicyWriteModel { return &InstancePrivacyPolicyWriteModel{ PrivacyPolicyWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, }, } diff --git a/internal/command/instance_policy_privacy_test.go b/internal/command/instance_policy_privacy_test.go index 32162d8f9e..6a5965b065 100644 --- a/internal/command/instance_policy_privacy_test.go +++ b/internal/command/instance_policy_privacy_test.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/stretchr/testify/assert" "github.com/caos/zitadel/internal/domain" @@ -41,7 +42,7 @@ func TestCommandSide_AddDefaultPrivacyPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "TOSLink", "PrivacyLink", "HelpLink", @@ -70,9 +71,10 @@ func TestCommandSide_AddDefaultPrivacyPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewPrivacyPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "TOSLink", "PrivacyLink", "HelpLink", @@ -83,7 +85,7 @@ func TestCommandSide_AddDefaultPrivacyPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.PrivacyPolicy{ TOSLink: "TOSLink", PrivacyLink: "PrivacyLink", @@ -93,8 +95,9 @@ func TestCommandSide_AddDefaultPrivacyPolicy(t *testing.T) { res: res{ want: &domain.PrivacyPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, TOSLink: "TOSLink", PrivacyLink: "PrivacyLink", @@ -110,9 +113,10 @@ func TestCommandSide_AddDefaultPrivacyPolicy(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher( + eventFromEventPusherWithInstanceID( + "INSTANCE", instance.NewPrivacyPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "", "", "", @@ -123,7 +127,7 @@ func TestCommandSide_AddDefaultPrivacyPolicy(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), policy: &domain.PrivacyPolicy{ TOSLink: "", PrivacyLink: "", @@ -133,8 +137,9 @@ func TestCommandSide_AddDefaultPrivacyPolicy(t *testing.T) { res: res{ want: &domain.PrivacyPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + InstanceID: "INSTANCE", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, TOSLink: "", PrivacyLink: "", @@ -208,7 +213,7 @@ func TestCommandSide_ChangeDefaultPrivacyPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "TOSLink", "PrivacyLink", "HelpLink", @@ -237,7 +242,7 @@ func TestCommandSide_ChangeDefaultPrivacyPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "TOSLink", "PrivacyLink", "HelpLink", @@ -268,8 +273,8 @@ func TestCommandSide_ChangeDefaultPrivacyPolicy(t *testing.T) { res: res{ want: &domain.PrivacyPolicy{ ObjectRoot: models.ObjectRoot{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", }, TOSLink: "TOSLinkChanged", PrivacyLink: "PrivacyLinkChanged", @@ -299,7 +304,7 @@ func TestCommandSide_ChangeDefaultPrivacyPolicy(t *testing.T) { func newDefaultPrivacyPolicyChangedEvent(ctx context.Context, tosLink, privacyLink, helpLink string) *instance.PrivacyPolicyChangedEvent { event, _ := instance.NewPrivacyPolicyChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []policy.PrivacyPolicyChanges{ policy.ChangeTOSLink(tosLink), policy.ChangePrivacyLink(privacyLink), diff --git a/internal/command/instance_secret_generator_model.go b/internal/command/instance_secret_generator_model.go index 2e948d0b81..57f5295015 100644 --- a/internal/command/instance_secret_generator_model.go +++ b/internal/command/instance_secret_generator_model.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" @@ -22,11 +23,11 @@ type InstanceSecretGeneratorConfigWriteModel struct { State domain.SecretGeneratorState } -func NewInstanceSecretGeneratorConfigWriteModel(GeneratorType domain.SecretGeneratorType) *InstanceSecretGeneratorConfigWriteModel { +func NewInstanceSecretGeneratorConfigWriteModel(ctx context.Context, GeneratorType domain.SecretGeneratorType) *InstanceSecretGeneratorConfigWriteModel { return &InstanceSecretGeneratorConfigWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: authz.GetInstance(ctx).InstanceID(), + ResourceOwner: authz.GetInstance(ctx).InstanceID(), }, GeneratorType: GeneratorType, } diff --git a/internal/command/instance_settings.go b/internal/command/instance_settings.go index f1cf79c649..3160d70f20 100644 --- a/internal/command/instance_settings.go +++ b/internal/command/instance_settings.go @@ -108,7 +108,7 @@ func (c *Commands) RemoveSecretGeneratorConfig(ctx context.Context, generatorTyp } func (c *Commands) getSecretConfig(ctx context.Context, generatorType domain.SecretGeneratorType) (_ *InstanceSecretGeneratorConfigWriteModel, err error) { - writeModel := NewInstanceSecretGeneratorConfigWriteModel(generatorType) + writeModel := NewInstanceSecretGeneratorConfigWriteModel(ctx, generatorType) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/instance_settings_test.go b/internal/command/instance_settings_test.go index 85f02a17f1..6877a89793 100644 --- a/internal/command/instance_settings_test.go +++ b/internal/command/instance_settings_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/caos/zitadel/internal/api/authz" "github.com/stretchr/testify/assert" "github.com/caos/zitadel/internal/crypto" @@ -58,7 +59,7 @@ func TestCommandSide_AddSecretGenerator(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewSecretGeneratorAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode, 4, time.Hour*1, @@ -95,25 +96,27 @@ func TestCommandSide_AddSecretGenerator(t *testing.T) { expectFilter(), expectPush( []*repository.Event{ - eventFromEventPusher(instance.NewSecretGeneratorAddedEvent( - context.Background(), - &instance.NewAggregate().Aggregate, - domain.SecretGeneratorTypeInitCode, - 4, - time.Hour*1, - true, - true, - true, - true, - ), + eventFromEventPusherWithInstanceID( + "INSTANCE", + instance.NewSecretGeneratorAddedEvent( + context.Background(), + &instance.NewAggregate("INSTANCE").Aggregate, + domain.SecretGeneratorTypeInitCode, + 4, + time.Hour*1, + true, + true, + true, + true, + ), ), }, - uniqueConstraintsFromEventConstraint(instance.NewAddSecretGeneratorTypeUniqueConstraint(domain.SecretGeneratorTypeInitCode)), + uniqueConstraintsFromEventConstraintWithInstanceID("INSTANCE", instance.NewAddSecretGeneratorTypeUniqueConstraint(domain.SecretGeneratorTypeInitCode)), ), ), }, args: args{ - ctx: context.Background(), + ctx: authz.WithInstanceID(context.Background(), "INSTANCE"), generator: &crypto.GeneratorConfig{ Length: 4, Expiry: 1 * time.Hour, @@ -126,7 +129,7 @@ func TestCommandSide_AddSecretGenerator(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -158,6 +161,7 @@ func TestCommandSide_ChangeSecretGenerator(t *testing.T) { ctx context.Context generator *crypto.GeneratorConfig generatorType domain.SecretGeneratorType + instanceID string } type res struct { want *domain.ObjectDetails @@ -210,7 +214,7 @@ func TestCommandSide_ChangeSecretGenerator(t *testing.T) { eventFromEventPusher( instance.NewSecretGeneratorAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode, 4, time.Hour*1, @@ -222,7 +226,7 @@ func TestCommandSide_ChangeSecretGenerator(t *testing.T) { ), eventFromEventPusher( instance.NewSecretGeneratorRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode), ), ), @@ -245,7 +249,7 @@ func TestCommandSide_ChangeSecretGenerator(t *testing.T) { eventFromEventPusher( instance.NewSecretGeneratorAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode, 4, time.Hour*1, @@ -283,7 +287,7 @@ func TestCommandSide_ChangeSecretGenerator(t *testing.T) { eventFromEventPusher( instance.NewSecretGeneratorAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode, 4, time.Hour*1, @@ -324,7 +328,7 @@ func TestCommandSide_ChangeSecretGenerator(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -355,6 +359,7 @@ func TestCommandSide_RemoveSecretGenerator(t *testing.T) { type args struct { ctx context.Context generatorType domain.SecretGeneratorType + instanceID string } type res struct { want *domain.ObjectDetails @@ -406,7 +411,7 @@ func TestCommandSide_RemoveSecretGenerator(t *testing.T) { eventFromEventPusher( instance.NewSecretGeneratorAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode, 4, time.Hour*1, @@ -418,7 +423,7 @@ func TestCommandSide_RemoveSecretGenerator(t *testing.T) { ), eventFromEventPusher( instance.NewSecretGeneratorRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode), ), ), @@ -441,7 +446,7 @@ func TestCommandSide_RemoveSecretGenerator(t *testing.T) { eventFromEventPusher( instance.NewSecretGeneratorAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode, 4, time.Hour*1, @@ -456,7 +461,7 @@ func TestCommandSide_RemoveSecretGenerator(t *testing.T) { []*repository.Event{ eventFromEventPusher( instance.NewSecretGeneratorRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.SecretGeneratorTypeInitCode), ), }, @@ -470,7 +475,7 @@ func TestCommandSide_RemoveSecretGenerator(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -504,7 +509,7 @@ func newSecretGeneratorChangedEvent(ctx context.Context, generatorType domain.Se instance.ChangeSecretGeneratorIncludeSymbols(symbols), } event, _ := instance.NewSecretGeneratorChangeEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, generatorType, changes, ) diff --git a/internal/command/instance_smtp_config_model.go b/internal/command/instance_smtp_config_model.go index 00f9967070..44e7b4c214 100644 --- a/internal/command/instance_smtp_config_model.go +++ b/internal/command/instance_smtp_config_model.go @@ -21,11 +21,11 @@ type InstanceSMTPConfigWriteModel struct { State domain.SMTPConfigState } -func NewInstanceSMTPConfigWriteModel() *InstanceSMTPConfigWriteModel { +func NewInstanceSMTPConfigWriteModel(instanceID string) *InstanceSMTPConfigWriteModel { return &InstanceSMTPConfigWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: instanceID, + ResourceOwner: instanceID, }, } } diff --git a/internal/command/key_pair.go b/internal/command/key_pair.go index ec2c48ed17..c41f3b467a 100644 --- a/internal/command/key_pair.go +++ b/internal/command/key_pair.go @@ -7,7 +7,7 @@ import ( "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/crypto" "github.com/caos/zitadel/internal/domain" - keypair "github.com/caos/zitadel/internal/repository/keypair" + "github.com/caos/zitadel/internal/repository/keypair" ) const ( @@ -28,7 +28,8 @@ func (c *Commands) GenerateSigningKeyPair(ctx context.Context, algorithm string) privateKeyExp := time.Now().UTC().Add(c.privateKeyLifetime) publicKeyExp := time.Now().UTC().Add(c.publicKeyLifetime) - keyPairWriteModel := NewKeyPairWriteModel(keyID, domain.IAMID) + //TODO: InstanceID not available here? + keyPairWriteModel := NewKeyPairWriteModel(keyID, "system") //TODO: change with multi issuer keyAgg := KeyPairAggregateFromWriteModel(&keyPairWriteModel.WriteModel) _, err = c.eventstore.Push(ctx, keypair.NewAddedEvent( ctx, @@ -41,5 +42,6 @@ func (c *Commands) GenerateSigningKeyPair(ctx context.Context, algorithm string) } func setOIDCCtx(ctx context.Context) context.Context { - return authz.SetCtxData(ctx, authz.CtxData{UserID: oidcUser, OrgID: domain.IAMID}) + //TODO: InstanceID not available here? + return authz.SetCtxData(ctx, authz.CtxData{UserID: oidcUser, OrgID: authz.GetInstance(ctx).InstanceID()}) } diff --git a/internal/command/main_test.go b/internal/command/main_test.go index e2db05a1ad..d064a1dfaa 100644 --- a/internal/command/main_test.go +++ b/internal/command/main_test.go @@ -157,6 +157,26 @@ func eventFromEventPusher(event eventstore.Command) *repository.Event { } } +func eventFromEventPusherWithInstanceID(instanceID string, event eventstore.Command) *repository.Event { + data, _ := eventstore.EventData(event) + return &repository.Event{ + ID: "", + Sequence: 0, + PreviousAggregateSequence: 0, + PreviousAggregateTypeSequence: 0, + CreationDate: time.Time{}, + Type: repository.EventType(event.Type()), + Data: data, + EditorService: event.EditorService(), + EditorUser: event.EditorUser(), + Version: repository.Version(event.Aggregate().Version), + AggregateID: event.Aggregate().ID, + AggregateType: repository.AggregateType(event.Aggregate().Type), + ResourceOwner: sql.NullString{String: event.Aggregate().ResourceOwner, Valid: event.Aggregate().ResourceOwner != ""}, + InstanceID: sql.NullString{String: instanceID, Valid: instanceID != ""}, + } +} + func eventFromEventPusherWithCreationDateNow(event eventstore.Command) *repository.Event { e := eventFromEventPusher(event) e.CreationDate = time.Now() @@ -171,6 +191,15 @@ func uniqueConstraintsFromEventConstraint(constraint *eventstore.EventUniqueCons Action: repository.UniqueConstraintAction(constraint.Action)} } +func uniqueConstraintsFromEventConstraintWithInstanceID(instanceID string, constraint *eventstore.EventUniqueConstraint) *repository.UniqueConstraint { + return &repository.UniqueConstraint{ + InstanceID: instanceID, + UniqueType: constraint.UniqueType, + UniqueField: constraint.UniqueField, + ErrorMessage: constraint.ErrorMessage, + Action: repository.UniqueConstraintAction(constraint.Action)} +} + func GetMockSecretGenerator(t *testing.T) crypto.Generator { ctrl := gomock.NewController(t) alg := crypto.CreateMockEncryptionAlg(ctrl) diff --git a/internal/command/org_domain.go b/internal/command/org_domain.go index b1153dcd24..79b715e260 100644 --- a/internal/command/org_domain.go +++ b/internal/command/org_domain.go @@ -104,7 +104,7 @@ func (c *Commands) ValidateOrgDomain(ctx context.Context, orgDomain *domain.OrgD for _, userID := range claimedUserIDs { userEvents, _, err := c.userDomainClaimed(ctx, userID) if err != nil { - logging.LogWithFields("COMMAND-5m8fs", "userid", userID).WithError(err).Warn("could not claim user") + logging.WithFields("userid", userID).WithError(err).Warn("could not claim user") continue } events = append(events, userEvents...) diff --git a/internal/command/org_features.go b/internal/command/org_features.go index 20c382e19a..69baab0f05 100644 --- a/internal/command/org_features.go +++ b/internal/command/org_features.go @@ -384,7 +384,7 @@ func (c *Commands) getOrgFeaturesOrDefault(ctx context.Context, orgID string) (* return writeModelToFeatures(&existingFeatures.FeaturesWriteModel), nil } - existingIAMFeatures := NewInstanceFeaturesWriteModel() + existingIAMFeatures := NewInstanceFeaturesWriteModel(ctx) err = c.eventstore.FilterToQueryReducer(ctx, existingIAMFeatures) if err != nil { return nil, err diff --git a/internal/command/org_features_test.go b/internal/command/org_features_test.go index 2f0a9da4cf..b9c7d3a65a 100644 --- a/internal/command/org_features_test.go +++ b/internal/command/org_features_test.go @@ -159,7 +159,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, false, false, @@ -178,7 +178,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, false, false, @@ -191,7 +191,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLabelPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "primary", "secondary", "warn", @@ -240,7 +240,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.InitCodeMessageType, domain.MessageSubject, "text", @@ -252,7 +252,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "text", @@ -264,7 +264,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "toslink", "privacylink", "helpLink", @@ -275,7 +275,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLockoutPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 5, false, ), @@ -343,7 +343,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, false, false, @@ -362,7 +362,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, false, false, @@ -375,7 +375,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLabelPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "primary", "secondary", "warn", @@ -445,7 +445,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.InitCodeMessageType, domain.MessageSubject, "text", @@ -457,7 +457,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "text", @@ -469,7 +469,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "toslink", "privacylink", "helplink", @@ -480,7 +480,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLockoutPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 5, false, ), @@ -553,7 +553,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, false, false, @@ -572,7 +572,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, false, false, @@ -585,7 +585,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLabelPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "primary", "secondary", "warn", @@ -662,7 +662,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.InitCodeMessageType, domain.MessageSubject, "text", @@ -674,7 +674,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "text", @@ -686,7 +686,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "toslink", "privacylink", "helplink", @@ -697,7 +697,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLockoutPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 5, false, ), @@ -773,7 +773,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, false, false, @@ -792,7 +792,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, false, false, @@ -805,7 +805,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLabelPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "primary", "secondary", "warn", @@ -889,7 +889,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.InitCodeMessageType, domain.MessageSubject, "text", @@ -901,7 +901,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "text", @@ -913,7 +913,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "toslink", "privacylink", "helplink", @@ -924,7 +924,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLockoutPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 5, false, ), @@ -1008,7 +1008,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -1025,7 +1025,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( org.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, false, false, @@ -1045,7 +1045,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, true, true, @@ -1064,10 +1064,10 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { //orgLoginPolicyAuthFactorsWriteModel expectFilter( eventFromEventPusher( - instance.NewLoginPolicySecondFactorAddedEvent(context.Background(), &instance.NewAggregate().Aggregate, domain.SecondFactorTypeU2F), + instance.NewLoginPolicySecondFactorAddedEvent(context.Background(), &instance.NewAggregate("INSTANCE").Aggregate, domain.SecondFactorTypeU2F), ), eventFromEventPusher( - instance.NewLoginPolicyMultiFactorAddedEvent(context.Background(), &instance.NewAggregate().Aggregate, domain.MultiFactorTypeU2FWithPIN), + instance.NewLoginPolicyMultiFactorAddedEvent(context.Background(), &instance.NewAggregate("INSTANCE").Aggregate, domain.MultiFactorTypeU2FWithPIN), ), eventFromEventPusher( org.NewLoginPolicySecondFactorAddedEvent(context.Background(), &org.NewAggregate("org1", "org1").Aggregate, domain.SecondFactorTypeOTP), @@ -1085,7 +1085,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, false, false, @@ -1096,7 +1096,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( org.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 7, false, false, @@ -1111,7 +1111,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLabelPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "primary", "secondary", "warn", @@ -1128,7 +1128,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( org.NewLabelPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "custom", "secondary", "warn", @@ -1181,7 +1181,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( org.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.InitCodeMessageType, domain.MessageSubject, "text", @@ -1193,7 +1193,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( org.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "text", @@ -1205,7 +1205,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( org.NewPrivacyPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "toslink", "privacylink", "helplink", @@ -1318,7 +1318,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, false, false, @@ -1337,7 +1337,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, false, false, @@ -1350,7 +1350,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLabelPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "primary", "secondary", "warn", @@ -1399,7 +1399,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.InitCodeMessageType, domain.MessageSubject, "text", @@ -1411,7 +1411,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "text", @@ -1423,7 +1423,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "toslink", "privacylink", "helplink", @@ -1434,7 +1434,7 @@ func TestCommandSide_SetOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLockoutPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 5, false, ), @@ -1583,7 +1583,7 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLoginPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, false, false, @@ -1602,7 +1602,7 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, false, false, @@ -1615,7 +1615,7 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLabelPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "primary", "secondary", "warn", @@ -1664,7 +1664,7 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.InitCodeMessageType, domain.MessageSubject, "text", @@ -1676,7 +1676,7 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewCustomTextSetEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, domain.LoginCustomText, domain.LoginKeyExternalRegistrationUserOverviewTitle, "text", @@ -1688,7 +1688,7 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewPrivacyPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "toslink", "privacylink", "helplink", @@ -1699,7 +1699,7 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) { eventFromEventPusher( instance.NewLockoutPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 5, false, ), @@ -1751,7 +1751,7 @@ func TestCommandSide_RemoveOrgFeatures(t *testing.T) { func newIAMFeaturesSetEvent(ctx context.Context, tierName string, state domain.FeaturesState, auditLog time.Duration) *instance.FeaturesSetEvent { event, _ := instance.NewFeaturesSetEvent( ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, []features.FeaturesChanges{ features.ChangeTierName(tierName), features.ChangeState(state), diff --git a/internal/command/org_policy_label_test.go b/internal/command/org_policy_label_test.go index 7302758109..eeb628e388 100644 --- a/internal/command/org_policy_label_test.go +++ b/internal/command/org_policy_label_test.go @@ -112,7 +112,7 @@ func TestCommandSide_AddLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -160,7 +160,7 @@ func TestCommandSide_AddLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -341,7 +341,7 @@ func TestCommandSide_ChangeLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -406,7 +406,7 @@ func TestCommandSide_ChangeLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", @@ -471,7 +471,7 @@ func TestCommandSide_ChangeLabelPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLabelPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "#ffffff", "#ffffff", "#ffffff", diff --git a/internal/command/org_policy_login.go b/internal/command/org_policy_login.go index 4c85a7b589..9f2fe88349 100644 --- a/internal/command/org_policy_login.go +++ b/internal/command/org_policy_login.go @@ -432,7 +432,7 @@ func (c *Commands) orgLoginPolicyAuthFactorsWriteModel(ctx context.Context, orgI ctx, span := tracing.NewSpan(ctx) defer func() { span.EndWithError(err) }() - writeModel := NewOrgAuthFactorsAllowedWriteModel(orgID) + writeModel := NewOrgAuthFactorsAllowedWriteModel(ctx, orgID) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/org_policy_login_factors_model.go b/internal/command/org_policy_login_factors_model.go index 0abe224b57..3b300c99aa 100644 --- a/internal/command/org_policy_login_factors_model.go +++ b/internal/command/org_policy_login_factors_model.go @@ -1,6 +1,9 @@ package command import ( + "context" + + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" "github.com/caos/zitadel/internal/repository/instance" @@ -107,9 +110,10 @@ func (wm *OrgMultiFactorWriteModel) Query() *eventstore.SearchQueryBuilder { Builder() } -func NewOrgAuthFactorsAllowedWriteModel(orgID string) *OrgAuthFactorsAllowedWriteModel { +func NewOrgAuthFactorsAllowedWriteModel(ctx context.Context, orgID string) *OrgAuthFactorsAllowedWriteModel { return &OrgAuthFactorsAllowedWriteModel{ WriteModel: eventstore.WriteModel{ + InstanceID: authz.GetInstance(ctx).InstanceID(), AggregateID: orgID, ResourceOwner: orgID, }, @@ -186,7 +190,7 @@ func (wm *OrgAuthFactorsAllowedWriteModel) Query() *eventstore.SearchQueryBuilde return eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent). AddQuery(). AggregateTypes(instance.AggregateType). - AggregateIDs(domain.IAMID). + AggregateIDs(wm.InstanceID). EventTypes( instance.LoginPolicySecondFactorAddedEventType, instance.LoginPolicySecondFactorRemovedEventType, diff --git a/internal/command/org_policy_login_test.go b/internal/command/org_policy_login_test.go index b9ee222614..ca9ea571cb 100644 --- a/internal/command/org_policy_login_test.go +++ b/internal/command/org_policy_login_test.go @@ -119,7 +119,7 @@ func TestCommandSide_AddLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, true, true, @@ -166,7 +166,7 @@ func TestCommandSide_AddLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, true, true, @@ -352,7 +352,7 @@ func TestCommandSide_ChangeLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, true, true, @@ -416,7 +416,7 @@ func TestCommandSide_ChangeLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, true, true, @@ -481,7 +481,7 @@ func TestCommandSide_ChangeLoginPolicy(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewLoginPolicyAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, false, false, false, diff --git a/internal/command/project.go b/internal/command/project.go index 29a86d04f5..2335cebfbd 100644 --- a/internal/command/project.go +++ b/internal/command/project.go @@ -38,13 +38,6 @@ func (c *Commands) addProject(ctx context.Context, projectAdd *domain.Project, r projectAgg := ProjectAggregateFromWriteModel(&addedProject.WriteModel) projectRole := domain.RoleProjectOwner - iam, err := c.GetInstance(ctx) - if err != nil { - return nil, nil, err - } - if iam.GlobalOrgID == resourceOwner { - projectRole = domain.RoleProjectOwnerGlobal - } events := []eventstore.Command{ project.NewProjectAddedEvent( ctx, diff --git a/internal/command/project_test.go b/internal/command/project_test.go index 1289597368..241ed34610 100644 --- a/internal/command/project_test.go +++ b/internal/command/project_test.go @@ -4,6 +4,8 @@ import ( "context" "testing" + id_mock "github.com/caos/zitadel/internal/id/mock" + "github.com/caos/zitadel/internal/repository/member" "github.com/stretchr/testify/assert" "github.com/caos/zitadel/internal/domain" @@ -12,9 +14,6 @@ import ( "github.com/caos/zitadel/internal/eventstore/repository" "github.com/caos/zitadel/internal/eventstore/v1/models" "github.com/caos/zitadel/internal/id" - id_mock "github.com/caos/zitadel/internal/id/mock" - "github.com/caos/zitadel/internal/repository/instance" - "github.com/caos/zitadel/internal/repository/member" "github.com/caos/zitadel/internal/repository/project" ) @@ -60,14 +59,6 @@ func TestCommandSide_AddProject(t *testing.T) { fields: fields{ eventstore: eventstoreExpect( t, - expectFilter( - eventFromEventPusher( - instance.NewGlobalOrgSetEventEvent(context.Background(), - &instance.NewAggregate().Aggregate, - "globalorg", - ), - ), - ), expectPushFailed(caos_errs.ThrowAlreadyExists(nil, "ERROR", "internl"), []*repository.Event{ eventFromEventPusher(project.NewProjectAddedEvent( @@ -107,81 +98,11 @@ func TestCommandSide_AddProject(t *testing.T) { err: caos_errs.IsErrorAlreadyExists, }, }, - { - name: "global org with project owner global, ok", - fields: fields{ - eventstore: eventstoreExpect( - t, - expectFilter( - eventFromEventPusher( - instance.NewGlobalOrgSetEventEvent(context.Background(), - &instance.NewAggregate().Aggregate, - "globalorg", - ), - ), - ), - expectPush( - []*repository.Event{ - eventFromEventPusher(project.NewProjectAddedEvent( - context.Background(), - &project.NewAggregate("project1", "globalorg").Aggregate, - "project", true, true, true, - domain.PrivateLabelingSettingAllowLoginUserResourceOwnerPolicy, - ), - ), - eventFromEventPusher(project.NewProjectMemberAddedEvent( - context.Background(), - &project.NewAggregate("project1", "globalorg").Aggregate, - "user1", - []string{domain.RoleProjectOwnerGlobal}..., - ), - ), - }, - uniqueConstraintsFromEventConstraint(project.NewAddProjectNameUniqueConstraint("project", "globalorg")), - uniqueConstraintsFromEventConstraint(member.NewAddMemberUniqueConstraint("project1", "user1")), - ), - ), - idGenerator: id_mock.NewIDGeneratorExpectIDs(t, "project1"), - }, - args: args{ - ctx: context.Background(), - project: &domain.Project{ - Name: "project", - ProjectRoleAssertion: true, - ProjectRoleCheck: true, - HasProjectCheck: true, - PrivateLabelingSetting: domain.PrivateLabelingSettingAllowLoginUserResourceOwnerPolicy, - }, - resourceOwner: "globalorg", - ownerID: "user1", - }, - res: res{ - want: &domain.Project{ - ObjectRoot: models.ObjectRoot{ - ResourceOwner: "globalorg", - AggregateID: "project1", - }, - Name: "project", - ProjectRoleAssertion: true, - ProjectRoleCheck: true, - HasProjectCheck: true, - PrivateLabelingSetting: domain.PrivateLabelingSettingAllowLoginUserResourceOwnerPolicy, - }, - }, - }, { name: "org with project owner, ok", fields: fields{ eventstore: eventstoreExpect( t, - expectFilter( - eventFromEventPusher( - instance.NewGlobalOrgSetEventEvent(context.Background(), - &instance.NewAggregate().Aggregate, - "globalorg", - ), - ), - ), expectPush( []*repository.Event{ eventFromEventPusher(project.NewProjectAddedEvent( diff --git a/internal/command/setup.go b/internal/command/setup.go deleted file mode 100644 index 9b7fff81c3..0000000000 --- a/internal/command/setup.go +++ /dev/null @@ -1,105 +0,0 @@ -package command - -import ( - "context" - - "github.com/caos/logging" - "github.com/caos/zitadel/internal/eventstore" - - "github.com/caos/zitadel/internal/api/authz" - "github.com/caos/zitadel/internal/domain" - caos_errs "github.com/caos/zitadel/internal/errors" - "github.com/caos/zitadel/internal/eventstore/v1/models" - iam_repo "github.com/caos/zitadel/internal/repository/instance" -) - -type Step interface { - Step() domain.Step - execute(context.Context, *Commands) error -} - -const ( - SetupUser = "SETUP" -) - -func (c *Commands) ExecuteSetupSteps(ctx context.Context, steps []Step) error { - iam, err := c.GetInstance(ctx) - if err != nil && !caos_errs.IsNotFound(err) { - return err - } - if iam != nil && (iam.SetUpDone == domain.StepCount-1 || iam.SetUpStarted != iam.SetUpDone) { - logging.Log("COMMA-dgd2z").Info("all steps done") - return nil - } - - if iam == nil { - iam = &domain.Instance{ObjectRoot: models.ObjectRoot{}} - } - - ctx = setSetUpContextData(ctx) - - for _, step := range steps { - iam, err = c.StartSetup(ctx, step.Step()) - if err != nil { - return err - } - - err = step.execute(ctx, c) - if err != nil { - return err - } - } - return nil -} - -func setSetUpContextData(ctx context.Context) context.Context { - return authz.SetCtxData(ctx, authz.CtxData{UserID: SetupUser}) -} - -func (c *Commands) StartSetup(ctx context.Context, step domain.Step) (*domain.Instance, error) { - logging.Log("COMMA-3M9fs").Infof("start setup step %v", step) - iamWriteModel, err := c.getIAMWriteModel(ctx) - if err != nil && !caos_errs.IsNotFound(err) { - return nil, err - } - if iamWriteModel.SetUpStarted >= step || iamWriteModel.SetUpStarted != iamWriteModel.SetUpDone { - return nil, caos_errs.ThrowPreconditionFailed(nil, "EVENT-9so34", "setup error") - } - aggregate := InstanceAggregateFromWriteModel(&iamWriteModel.WriteModel) - pushedEvents, err := c.eventstore.Push(ctx, iam_repo.NewSetupStepStartedEvent(ctx, aggregate, step)) - if err != nil { - return nil, caos_errs.ThrowPreconditionFailed(nil, "EVENT-Grgh1", "Setup start failed") - } - err = AppendAndReduce(iamWriteModel, pushedEvents...) - if err != nil { - return nil, err - } - logging.LogWithFields("SETUP-fhh21", "step", step).Info("setup step started") - return writeModelToInstance(iamWriteModel), nil -} - -func (c *Commands) setup(ctx context.Context, step Step, iamAggregateProvider func(*InstanceWriteModel) ([]eventstore.Command, error)) error { - iam, err := c.getIAMWriteModel(ctx) - if err != nil && !caos_errs.IsNotFound(err) { - return err - } - if iam.SetUpStarted != step.Step() && iam.SetUpDone+1 != step.Step() { - return caos_errs.ThrowPreconditionFailed(nil, "EVENT-Dge32", "wrong step") - } - events, err := iamAggregateProvider(iam) - if err != nil { - return err - } - iamAgg := InstanceAggregateFromWriteModel(&iam.WriteModel) - events = append(events, iam_repo.NewSetupStepDoneEvent(ctx, iamAgg, step.Step())) - - _, err = c.eventstore.Push(ctx, events...) - if caos_errs.IsErrorAlreadyExists(err) { - logging.LogWithFields("SETUP-4M9gsf", "step", step.Step()).WithError(err).Info("setup step already done") - } - if err != nil { - return caos_errs.ThrowPreconditionFailedf(nil, "EVENT-dbG31", "Setup %v failed", step.Step()) - } - logging.LogWithFields("SETUP-Sg1t1", "step", step.Step()).Info("setup step done") - return nil -} diff --git a/internal/command/sms_config.go b/internal/command/sms_config.go index 3a304f849e..63cc8987c8 100644 --- a/internal/command/sms_config.go +++ b/internal/command/sms_config.go @@ -10,12 +10,12 @@ import ( "github.com/caos/zitadel/internal/repository/instance" ) -func (c *Commands) AddSMSConfigTwilio(ctx context.Context, config *twilio.TwilioConfig) (string, *domain.ObjectDetails, error) { +func (c *Commands) AddSMSConfigTwilio(ctx context.Context, instanceID string, config *twilio.TwilioConfig) (string, *domain.ObjectDetails, error) { id, err := c.idGenerator.Next() if err != nil { return "", nil, err } - smsConfigWriteModel, err := c.getSMSConfig(ctx, id) + smsConfigWriteModel, err := c.getSMSConfig(ctx, instanceID, id) if err != nil { return "", nil, err } @@ -46,11 +46,11 @@ func (c *Commands) AddSMSConfigTwilio(ctx context.Context, config *twilio.Twilio return id, writeModelToObjectDetails(&smsConfigWriteModel.WriteModel), nil } -func (c *Commands) ChangeSMSConfigTwilio(ctx context.Context, id string, config *twilio.TwilioConfig) (*domain.ObjectDetails, error) { +func (c *Commands) ChangeSMSConfigTwilio(ctx context.Context, instanceID, id string, config *twilio.TwilioConfig) (*domain.ObjectDetails, error) { if id == "" { return nil, caos_errs.ThrowInvalidArgument(nil, "SMS-e9jwf", "Errors.IDMissing") } - smsConfigWriteModel, err := c.getSMSConfig(ctx, id) + smsConfigWriteModel, err := c.getSMSConfig(ctx, instanceID, id) if err != nil { return nil, err } @@ -82,8 +82,8 @@ func (c *Commands) ChangeSMSConfigTwilio(ctx context.Context, id string, config return writeModelToObjectDetails(&smsConfigWriteModel.WriteModel), nil } -func (c *Commands) ChangeSMSConfigTwilioToken(ctx context.Context, id, token string) (*domain.ObjectDetails, error) { - smsConfigWriteModel, err := c.getSMSConfig(ctx, id) +func (c *Commands) ChangeSMSConfigTwilioToken(ctx context.Context, instanceID, id, token string) (*domain.ObjectDetails, error) { + smsConfigWriteModel, err := c.getSMSConfig(ctx, instanceID, id) if err != nil { return nil, err } @@ -110,11 +110,11 @@ func (c *Commands) ChangeSMSConfigTwilioToken(ctx context.Context, id, token str return writeModelToObjectDetails(&smsConfigWriteModel.WriteModel), nil } -func (c *Commands) ActivateSMSConfigTwilio(ctx context.Context, id string) (*domain.ObjectDetails, error) { +func (c *Commands) ActivateSMSConfigTwilio(ctx context.Context, instanceID, id string) (*domain.ObjectDetails, error) { if id == "" { return nil, caos_errs.ThrowInvalidArgument(nil, "SMS-dn93n", "Errors.IDMissing") } - smsConfigWriteModel, err := c.getSMSConfig(ctx, id) + smsConfigWriteModel, err := c.getSMSConfig(ctx, instanceID, id) if err != nil { return nil, err } @@ -140,11 +140,11 @@ func (c *Commands) ActivateSMSConfigTwilio(ctx context.Context, id string) (*dom return writeModelToObjectDetails(&smsConfigWriteModel.WriteModel), nil } -func (c *Commands) DeactivateSMSConfigTwilio(ctx context.Context, id string) (*domain.ObjectDetails, error) { +func (c *Commands) DeactivateSMSConfigTwilio(ctx context.Context, instanceID, id string) (*domain.ObjectDetails, error) { if id == "" { return nil, caos_errs.ThrowInvalidArgument(nil, "SMS-frkwf", "Errors.IDMissing") } - smsConfigWriteModel, err := c.getSMSConfig(ctx, id) + smsConfigWriteModel, err := c.getSMSConfig(ctx, instanceID, id) if err != nil { return nil, err } @@ -170,11 +170,11 @@ func (c *Commands) DeactivateSMSConfigTwilio(ctx context.Context, id string) (*d return writeModelToObjectDetails(&smsConfigWriteModel.WriteModel), nil } -func (c *Commands) RemoveSMSConfigTwilio(ctx context.Context, id string) (*domain.ObjectDetails, error) { +func (c *Commands) RemoveSMSConfigTwilio(ctx context.Context, instanceID, id string) (*domain.ObjectDetails, error) { if id == "" { return nil, caos_errs.ThrowInvalidArgument(nil, "SMS-3j9fs", "Errors.IDMissing") } - smsConfigWriteModel, err := c.getSMSConfig(ctx, id) + smsConfigWriteModel, err := c.getSMSConfig(ctx, instanceID, id) if err != nil { return nil, err } @@ -196,8 +196,8 @@ func (c *Commands) RemoveSMSConfigTwilio(ctx context.Context, id string) (*domai } return writeModelToObjectDetails(&smsConfigWriteModel.WriteModel), nil } -func (c *Commands) getSMSConfig(ctx context.Context, id string) (_ *IAMSMSConfigWriteModel, err error) { - writeModel := NewIAMSMSConfigWriteModel(id) +func (c *Commands) getSMSConfig(ctx context.Context, instanceID, id string) (_ *IAMSMSConfigWriteModel, err error) { + writeModel := NewIAMSMSConfigWriteModel(instanceID, id) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/sms_config_model.go b/internal/command/sms_config_model.go index 746e38f5ac..c9099b1675 100644 --- a/internal/command/sms_config_model.go +++ b/internal/command/sms_config_model.go @@ -23,11 +23,11 @@ type TwilioConfig struct { SenderNumber string } -func NewIAMSMSConfigWriteModel(id string) *IAMSMSConfigWriteModel { +func NewIAMSMSConfigWriteModel(instanceID, id string) *IAMSMSConfigWriteModel { return &IAMSMSConfigWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: domain.IAMID, - ResourceOwner: domain.IAMID, + AggregateID: instanceID, + ResourceOwner: instanceID, }, ID: id, } diff --git a/internal/command/sms_config_test.go b/internal/command/sms_config_test.go index abc5f67d3f..850199b7f3 100644 --- a/internal/command/sms_config_test.go +++ b/internal/command/sms_config_test.go @@ -24,8 +24,9 @@ func TestCommandSide_AddSMSConfigTwilio(t *testing.T) { alg crypto.EncryptionAlgorithm } type args struct { - ctx context.Context - sms *twilio.TwilioConfig + ctx context.Context + instanceID string + sms *twilio.TwilioConfig } type res struct { want *domain.ObjectDetails @@ -47,7 +48,7 @@ func TestCommandSide_AddSMSConfigTwilio(t *testing.T) { []*repository.Event{ eventFromEventPusher(instance.NewSMSConfigTwilioAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", "sid", "senderName", @@ -66,7 +67,8 @@ func TestCommandSide_AddSMSConfigTwilio(t *testing.T) { alg: crypto.CreateMockEncryptionAlg(gomock.NewController(t)), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", sms: &twilio.TwilioConfig{ SID: "sid", Token: "token", @@ -75,7 +77,7 @@ func TestCommandSide_AddSMSConfigTwilio(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -87,7 +89,7 @@ func TestCommandSide_AddSMSConfigTwilio(t *testing.T) { idGenerator: tt.fields.idGenerator, smsCrypto: tt.fields.alg, } - _, got, err := r.AddSMSConfigTwilio(tt.args.ctx, tt.args.sms) + _, got, err := r.AddSMSConfigTwilio(tt.args.ctx, tt.args.instanceID, tt.args.sms) if tt.res.err == nil { assert.NoError(t, err) } @@ -106,9 +108,10 @@ func TestCommandSide_ChangeSMSConfigTwilio(t *testing.T) { eventstore *eventstore.Eventstore } type args struct { - ctx context.Context - id string - sms *twilio.TwilioConfig + ctx context.Context + instanceID string + id string + sms *twilio.TwilioConfig } type res struct { want *domain.ObjectDetails @@ -144,9 +147,10 @@ func TestCommandSide_ChangeSMSConfigTwilio(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - sms: &twilio.TwilioConfig{}, - id: "id", + ctx: context.Background(), + sms: &twilio.TwilioConfig{}, + instanceID: "INSTANCE", + id: "id", }, res: res{ err: caos_errs.IsNotFound, @@ -161,7 +165,7 @@ func TestCommandSide_ChangeSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigTwilioAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", "sid", "senderName", @@ -183,7 +187,8 @@ func TestCommandSide_ChangeSMSConfigTwilio(t *testing.T) { Token: "token", SenderNumber: "senderName", }, - id: "providerid", + instanceID: "INSTANCE", + id: "providerid", }, res: res{ err: caos_errs.IsPreconditionFailed, @@ -198,7 +203,7 @@ func TestCommandSide_ChangeSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigTwilioAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", "sid", "token", @@ -232,11 +237,12 @@ func TestCommandSide_ChangeSMSConfigTwilio(t *testing.T) { Token: "token2", SenderNumber: "senderName2", }, - id: "providerid", + instanceID: "INSTANCE", + id: "providerid", }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -246,7 +252,7 @@ func TestCommandSide_ChangeSMSConfigTwilio(t *testing.T) { r := &Commands{ eventstore: tt.fields.eventstore, } - got, err := r.ChangeSMSConfigTwilio(tt.args.ctx, tt.args.id, tt.args.sms) + got, err := r.ChangeSMSConfigTwilio(tt.args.ctx, tt.args.instanceID, tt.args.id, tt.args.sms) if tt.res.err == nil { assert.NoError(t, err) } @@ -265,8 +271,9 @@ func TestCommandSide_ActivateSMSConfigTwilio(t *testing.T) { eventstore *eventstore.Eventstore } type args struct { - ctx context.Context - id string + ctx context.Context + instanceID string + id string } type res struct { want *domain.ObjectDetails @@ -301,8 +308,9 @@ func TestCommandSide_ActivateSMSConfigTwilio(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - id: "id", + ctx: context.Background(), + instanceID: "INSTANCE", + id: "id", }, res: res{ err: caos_errs.IsNotFound, @@ -317,7 +325,7 @@ func TestCommandSide_ActivateSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigTwilioAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", "sid", "sender-name", @@ -330,7 +338,7 @@ func TestCommandSide_ActivateSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigTwilioActivatedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", ), ), @@ -339,12 +347,13 @@ func TestCommandSide_ActivateSMSConfigTwilio(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - id: "providerid", + ctx: context.Background(), + instanceID: "INSTANCE", + id: "providerid", }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -354,7 +363,7 @@ func TestCommandSide_ActivateSMSConfigTwilio(t *testing.T) { r := &Commands{ eventstore: tt.fields.eventstore, } - got, err := r.ActivateSMSConfigTwilio(tt.args.ctx, tt.args.id) + got, err := r.ActivateSMSConfigTwilio(tt.args.ctx, tt.args.instanceID, tt.args.id) if tt.res.err == nil { assert.NoError(t, err) } @@ -373,8 +382,9 @@ func TestCommandSide_DeactivateSMSConfigTwilio(t *testing.T) { eventstore *eventstore.Eventstore } type args struct { - ctx context.Context - id string + ctx context.Context + instanceID string + id string } type res struct { want *domain.ObjectDetails @@ -409,8 +419,9 @@ func TestCommandSide_DeactivateSMSConfigTwilio(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - id: "id", + ctx: context.Background(), + instanceID: "INSTANCE", + id: "id", }, res: res{ err: caos_errs.IsNotFound, @@ -425,7 +436,7 @@ func TestCommandSide_DeactivateSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigTwilioAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", "sid", "sender-name", @@ -435,7 +446,7 @@ func TestCommandSide_DeactivateSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigTwilioActivatedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", ), ), @@ -445,7 +456,7 @@ func TestCommandSide_DeactivateSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigDeactivatedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", ), ), @@ -454,12 +465,13 @@ func TestCommandSide_DeactivateSMSConfigTwilio(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - id: "providerid", + ctx: context.Background(), + instanceID: "INSTANCE", + id: "providerid", }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -469,7 +481,7 @@ func TestCommandSide_DeactivateSMSConfigTwilio(t *testing.T) { r := &Commands{ eventstore: tt.fields.eventstore, } - got, err := r.DeactivateSMSConfigTwilio(tt.args.ctx, tt.args.id) + got, err := r.DeactivateSMSConfigTwilio(tt.args.ctx, tt.args.instanceID, tt.args.id) if tt.res.err == nil { assert.NoError(t, err) } @@ -488,8 +500,9 @@ func TestCommandSide_RemoveSMSConfigTwilio(t *testing.T) { eventstore *eventstore.Eventstore } type args struct { - ctx context.Context - id string + ctx context.Context + instanceID string + id string } type res struct { want *domain.ObjectDetails @@ -524,8 +537,9 @@ func TestCommandSide_RemoveSMSConfigTwilio(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - id: "id", + ctx: context.Background(), + instanceID: "INSTANCE", + id: "id", }, res: res{ err: caos_errs.IsNotFound, @@ -540,7 +554,7 @@ func TestCommandSide_RemoveSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigTwilioAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", "sid", "sender-name", @@ -553,7 +567,7 @@ func TestCommandSide_RemoveSMSConfigTwilio(t *testing.T) { eventFromEventPusher( instance.NewSMSConfigRemovedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "providerid", ), ), @@ -562,12 +576,13 @@ func TestCommandSide_RemoveSMSConfigTwilio(t *testing.T) { ), }, args: args{ - ctx: context.Background(), - id: "providerid", + ctx: context.Background(), + instanceID: "INSTANCE", + id: "providerid", }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -577,7 +592,7 @@ func TestCommandSide_RemoveSMSConfigTwilio(t *testing.T) { r := &Commands{ eventstore: tt.fields.eventstore, } - got, err := r.RemoveSMSConfigTwilio(tt.args.ctx, tt.args.id) + got, err := r.RemoveSMSConfigTwilio(tt.args.ctx, tt.args.instanceID, tt.args.id) if tt.res.err == nil { assert.NoError(t, err) } @@ -597,7 +612,7 @@ func newSMSConfigTwilioChangedEvent(ctx context.Context, id, sid, senderName str instance.ChangeSMSConfigTwilioSenderNumber(senderName), } event, _ := instance.NewSMSConfigTwilioChangedEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, id, changes, ) diff --git a/internal/command/smtp.go b/internal/command/smtp.go index b02060d829..f62fc52b1d 100644 --- a/internal/command/smtp.go +++ b/internal/command/smtp.go @@ -10,8 +10,8 @@ import ( "github.com/caos/zitadel/internal/repository/instance" ) -func (c *Commands) AddSMTPConfig(ctx context.Context, config *smtp.EmailConfig) (*domain.ObjectDetails, error) { - smtpConfigWriteModel, err := c.getSMTPConfig(ctx) +func (c *Commands) AddSMTPConfig(ctx context.Context, instanceID string, config *smtp.EmailConfig) (*domain.ObjectDetails, error) { + smtpConfigWriteModel, err := c.getSMTPConfig(ctx, instanceID) if err != nil { return nil, err } @@ -46,8 +46,8 @@ func (c *Commands) AddSMTPConfig(ctx context.Context, config *smtp.EmailConfig) return writeModelToObjectDetails(&smtpConfigWriteModel.WriteModel), nil } -func (c *Commands) ChangeSMTPConfig(ctx context.Context, config *smtp.EmailConfig) (*domain.ObjectDetails, error) { - smtpConfigWriteModel, err := c.getSMTPConfig(ctx) +func (c *Commands) ChangeSMTPConfig(ctx context.Context, instanceID string, config *smtp.EmailConfig) (*domain.ObjectDetails, error) { + smtpConfigWriteModel, err := c.getSMTPConfig(ctx, instanceID) if err != nil { return nil, err } @@ -81,8 +81,8 @@ func (c *Commands) ChangeSMTPConfig(ctx context.Context, config *smtp.EmailConfi return writeModelToObjectDetails(&smtpConfigWriteModel.WriteModel), nil } -func (c *Commands) ChangeSMTPConfigPassword(ctx context.Context, password string) (*domain.ObjectDetails, error) { - smtpConfigWriteModel, err := c.getSMTPConfig(ctx) +func (c *Commands) ChangeSMTPConfigPassword(ctx context.Context, instanceID, password string) (*domain.ObjectDetails, error) { + smtpConfigWriteModel, err := c.getSMTPConfig(ctx, instanceID) if err != nil { return nil, err } @@ -108,8 +108,8 @@ func (c *Commands) ChangeSMTPConfigPassword(ctx context.Context, password string return writeModelToObjectDetails(&smtpConfigWriteModel.WriteModel), nil } -func (c *Commands) getSMTPConfig(ctx context.Context) (_ *InstanceSMTPConfigWriteModel, err error) { - writeModel := NewInstanceSMTPConfigWriteModel() +func (c *Commands) getSMTPConfig(ctx context.Context, instanceID string) (_ *InstanceSMTPConfigWriteModel, err error) { + writeModel := NewInstanceSMTPConfigWriteModel(instanceID) err = c.eventstore.FilterToQueryReducer(ctx, writeModel) if err != nil { return nil, err diff --git a/internal/command/smtp_test.go b/internal/command/smtp_test.go index 258f02e472..e0b4720297 100644 --- a/internal/command/smtp_test.go +++ b/internal/command/smtp_test.go @@ -22,8 +22,9 @@ func TestCommandSide_AddSMTPConfig(t *testing.T) { alg crypto.EncryptionAlgorithm } type args struct { - ctx context.Context - smtp *smtp.EmailConfig + ctx context.Context + instanceID string + smtp *smtp.EmailConfig } type res struct { want *domain.ObjectDetails @@ -43,7 +44,7 @@ func TestCommandSide_AddSMTPConfig(t *testing.T) { expectFilter( eventFromEventPusher( instance.NewSMTPConfigAddedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, "from", "name", @@ -56,7 +57,8 @@ func TestCommandSide_AddSMTPConfig(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", smtp: &smtp.EmailConfig{ Tls: true, }, @@ -75,7 +77,7 @@ func TestCommandSide_AddSMTPConfig(t *testing.T) { []*repository.Event{ eventFromEventPusher(instance.NewSMTPConfigAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, "from", "name", @@ -95,7 +97,8 @@ func TestCommandSide_AddSMTPConfig(t *testing.T) { alg: crypto.CreateMockEncryptionAlg(gomock.NewController(t)), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", smtp: &smtp.EmailConfig{ Tls: true, From: "from", @@ -109,7 +112,7 @@ func TestCommandSide_AddSMTPConfig(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -120,7 +123,7 @@ func TestCommandSide_AddSMTPConfig(t *testing.T) { eventstore: tt.fields.eventstore, smtpPasswordCrypto: tt.fields.alg, } - got, err := r.AddSMTPConfig(tt.args.ctx, tt.args.smtp) + got, err := r.AddSMTPConfig(tt.args.ctx, tt.args.instanceID, tt.args.smtp) if tt.res.err == nil { assert.NoError(t, err) } @@ -139,8 +142,9 @@ func TestCommandSide_ChangeSMTPConfig(t *testing.T) { eventstore *eventstore.Eventstore } type args struct { - ctx context.Context - smtp *smtp.EmailConfig + ctx context.Context + instanceID string + smtp *smtp.EmailConfig } type res struct { want *domain.ObjectDetails @@ -178,7 +182,7 @@ func TestCommandSide_ChangeSMTPConfig(t *testing.T) { eventFromEventPusher( instance.NewSMTPConfigAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, "from", "name", @@ -191,7 +195,8 @@ func TestCommandSide_ChangeSMTPConfig(t *testing.T) { ), }, args: args{ - ctx: context.Background(), + ctx: context.Background(), + instanceID: "INSTANCE", smtp: &smtp.EmailConfig{ Tls: true, From: "from", @@ -215,7 +220,7 @@ func TestCommandSide_ChangeSMTPConfig(t *testing.T) { eventFromEventPusher( instance.NewSMTPConfigAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, "from", "name", @@ -255,7 +260,7 @@ func TestCommandSide_ChangeSMTPConfig(t *testing.T) { }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -265,7 +270,7 @@ func TestCommandSide_ChangeSMTPConfig(t *testing.T) { r := &Commands{ eventstore: tt.fields.eventstore, } - got, err := r.ChangeSMTPConfig(tt.args.ctx, tt.args.smtp) + got, err := r.ChangeSMTPConfig(tt.args.ctx, tt.args.instanceID, tt.args.smtp) if tt.res.err == nil { assert.NoError(t, err) } @@ -285,8 +290,9 @@ func TestCommandSide_ChangeSMTPConfigPassword(t *testing.T) { alg crypto.EncryptionAlgorithm } type args struct { - ctx context.Context - password string + ctx context.Context + instanceID string + password string } type res struct { want *domain.ObjectDetails @@ -323,7 +329,7 @@ func TestCommandSide_ChangeSMTPConfigPassword(t *testing.T) { eventFromEventPusher( instance.NewSMTPConfigAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, "from", "name", @@ -337,7 +343,7 @@ func TestCommandSide_ChangeSMTPConfigPassword(t *testing.T) { []*repository.Event{ eventFromEventPusher(instance.NewSMTPConfigPasswordChangedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, &crypto.CryptoValue{ CryptoType: crypto.TypeEncryption, Algorithm: "enc", @@ -352,12 +358,13 @@ func TestCommandSide_ChangeSMTPConfigPassword(t *testing.T) { alg: crypto.CreateMockEncryptionAlg(gomock.NewController(t)), }, args: args{ - ctx: context.Background(), - password: "password", + ctx: context.Background(), + instanceID: "INSTANCE", + password: "password", }, res: res{ want: &domain.ObjectDetails{ - ResourceOwner: "IAM", + ResourceOwner: "INSTANCE", }, }, }, @@ -368,7 +375,7 @@ func TestCommandSide_ChangeSMTPConfigPassword(t *testing.T) { eventstore: tt.fields.eventstore, smtpPasswordCrypto: tt.fields.alg, } - got, err := r.ChangeSMTPConfigPassword(tt.args.ctx, tt.args.password) + got, err := r.ChangeSMTPConfigPassword(tt.args.ctx, tt.args.instanceID, tt.args.password) if tt.res.err == nil { assert.NoError(t, err) } @@ -391,7 +398,7 @@ func newSMTPConfigChangedEvent(ctx context.Context, tls bool, fromAddress, fromN instance.ChangeSMTPConfigSMTPUser(user), } event, _ := instance.NewSMTPConfigChangeEvent(ctx, - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, changes, ) return event diff --git a/internal/command/user.go b/internal/command/user.go index 7ff30cc2fd..e4e0735722 100644 --- a/internal/command/user.go +++ b/internal/command/user.go @@ -197,7 +197,7 @@ func (c *Commands) RemoveUser(ctx context.Context, userID, resourceOwner string, for _, grantID := range cascadingGrantIDs { removeEvent, _, err := c.removeUserGrant(ctx, grantID, "", true) if err != nil { - logging.LogWithFields("COMMAND-5m9oL", "usergrantid", grantID).WithError(err).Warn("could not cascade remove role on user grant") + logging.WithFields("usergrantid", grantID).WithError(err).Warn("could not cascade remove role on user grant") continue } events = append(events, removeEvent) diff --git a/internal/command/user_human_init.go b/internal/command/user_human_init.go index 8a72b5c7d4..49bfbb08dc 100644 --- a/internal/command/user_human_init.go +++ b/internal/command/user_human_init.go @@ -69,7 +69,7 @@ func (c *Commands) HumanVerifyInitCode(ctx context.Context, userID, resourceOwne err = crypto.VerifyCode(existingCode.CodeCreationDate, existingCode.CodeExpiry, existingCode.Code, code, initCodeGenerator) if err != nil { _, err = c.eventstore.Push(ctx, user.NewHumanInitializedCheckFailedEvent(ctx, userAgg)) - logging.LogWithFields("COMMAND-Dg2z5", "userID", userAgg.ID).OnError(err).Error("NewHumanInitializedCheckFailedEvent push failed") + logging.WithFields("userID", userAgg.ID).OnError(err).Error("NewHumanInitializedCheckFailedEvent push failed") return caos_errs.ThrowInvalidArgument(err, "COMMAND-11v6G", "Errors.User.Code.Invalid") } events := []eventstore.Command{ diff --git a/internal/command/user_membership.go b/internal/command/user_membership.go index 69016dcb6d..cefac34c47 100644 --- a/internal/command/user_membership.go +++ b/internal/command/user_membership.go @@ -14,7 +14,7 @@ func (c *Commands) removeUserMemberships(ctx context.Context, memberships []*que events := make([]eventstore.Command, 0) for _, membership := range memberships { if membership.IAM != nil { - iamAgg := instance.NewAggregate() + iamAgg := instance.NewAggregate(membership.IAM.IAMID) removeEvent := c.removeInstanceMember(ctx, &iamAgg.Aggregate, membership.UserID, true) events = append(events, removeEvent) } else if membership.Org != nil { diff --git a/internal/command/user_test.go b/internal/command/user_test.go index 913440ea26..c11f85580b 100644 --- a/internal/command/user_test.go +++ b/internal/command/user_test.go @@ -5,6 +5,9 @@ import ( "testing" "time" + "github.com/caos/zitadel/internal/repository/member" + "github.com/caos/zitadel/internal/repository/org" + "github.com/caos/zitadel/internal/repository/project" "github.com/stretchr/testify/assert" "golang.org/x/text/language" @@ -15,9 +18,6 @@ import ( "github.com/caos/zitadel/internal/id" "github.com/caos/zitadel/internal/query" "github.com/caos/zitadel/internal/repository/instance" - "github.com/caos/zitadel/internal/repository/member" - "github.com/caos/zitadel/internal/repository/org" - "github.com/caos/zitadel/internal/repository/project" "github.com/caos/zitadel/internal/repository/user" ) @@ -919,6 +919,7 @@ func TestCommandSide_RemoveUser(t *testing.T) { type ( args struct { ctx context.Context + instanceID string orgID string userID string cascadeUserMemberships []*query.Membership @@ -1165,7 +1166,7 @@ func TestCommandSide_RemoveUser(t *testing.T) { ), eventFromEventPusher( instance.NewMemberCascadeRemovedEvent(context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, "user1", ), ), @@ -1190,7 +1191,7 @@ func TestCommandSide_RemoveUser(t *testing.T) { ), }, uniqueConstraintsFromEventConstraint(user.NewRemoveUsernameUniqueConstraint("username", "org1", true)), - uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint(domain.IAMID, "user1")), + uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint("INSTANCE", "user1")), uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint("org1", "user1")), uniqueConstraintsFromEventConstraint(member.NewRemoveMemberUniqueConstraint("project1", "user1")), uniqueConstraintsFromEventConstraint(project.NewRemoveProjectGrantMemberUniqueConstraint("project1", "user1", "grant1")), @@ -1204,7 +1205,7 @@ func TestCommandSide_RemoveUser(t *testing.T) { cascadeUserMemberships: []*query.Membership{ { IAM: &query.IAMMembership{ - IAMID: "IAM", + IAMID: "INSTANCE", }, UserID: "user1", ResourceOwner: "org1", diff --git a/internal/command/v2/instance.go b/internal/command/v2/instance.go index d733a55f5b..60b2f66055 100644 --- a/internal/command/v2/instance.go +++ b/internal/command/v2/instance.go @@ -142,12 +142,11 @@ func (s *InstanceSetup) generateIDs() (err error) { } func (command *Command) SetUpInstance(ctx context.Context, setup *InstanceSetup) (*domain.ObjectDetails, error) { - // TODO - // instanceID, err := id.SonyFlakeGenerator.Next() - // if err != nil { - // return nil, err - // } - ctx = authz.SetCtxData(authz.WithInstanceID(ctx, "system"), authz.CtxData{OrgID: domain.IAMID, ResourceOwner: domain.IAMID}) + instanceID, err := id.SonyFlakeGenerator.Next() + if err != nil { + return nil, err + } + ctx = authz.SetCtxData(authz.WithInstanceID(ctx, instanceID), authz.CtxData{OrgID: instanceID, ResourceOwner: instanceID}) orgID, err := id.SonyFlakeGenerator.Next() if err != nil { @@ -165,7 +164,7 @@ func (command *Command) SetUpInstance(ctx context.Context, setup *InstanceSetup) setup.Org.Human.PasswordChangeRequired = true - instanceAgg := instance.NewAggregate() + instanceAgg := instance.NewAggregate(instanceID) orgAgg := org.NewAggregate(orgID, orgID) userAgg := user.NewAggregate(userID, orgID) projectAgg := project.NewAggregate(setup.Zitadel.projectID, orgID) diff --git a/internal/command/v2/instance_email_template.go b/internal/command/v2/instance_email_template.go index 642bf4446e..036948da31 100644 --- a/internal/command/v2/instance_email_template.go +++ b/internal/command/v2/instance_email_template.go @@ -96,7 +96,7 @@ func SetInstanceCustomTexts( } func existingInstanceCustomMessageText(ctx context.Context, filter preparation.FilterToQueryReducer, textType string, lang language.Tag) (*command.InstanceCustomMessageTextWriteModel, error) { - writeModel := command.NewInstanceCustomMessageTextWriteModel(textType, lang) + writeModel := command.NewInstanceCustomMessageTextWriteModel(ctx, textType, lang) events, err := filter(ctx, writeModel.Query()) if err != nil { return nil, err diff --git a/internal/command/v2/user_domain_policy.go b/internal/command/v2/user_domain_policy.go index d93a059edf..cc6f5a06c7 100644 --- a/internal/command/v2/user_domain_policy.go +++ b/internal/command/v2/user_domain_policy.go @@ -36,7 +36,7 @@ func orgDomainPolicy(ctx context.Context, filter preparation.FilterToQueryReduce } func instanceDomainPolicy(ctx context.Context, filter preparation.FilterToQueryReducer) (*command.PolicyDomainWriteModel, error) { - policy := command.NewInstanceDomainPolicyWriteModel() + policy := command.NewInstanceDomainPolicyWriteModel(ctx) events, err := filter(ctx, policy.Query()) if err != nil { return nil, err diff --git a/internal/command/v2/user_domain_policy_test.go b/internal/command/v2/user_domain_policy_test.go index d3a75cb0c5..c02460c390 100644 --- a/internal/command/v2/user_domain_policy_test.go +++ b/internal/command/v2/user_domain_policy_test.go @@ -5,6 +5,7 @@ import ( "reflect" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/command" "github.com/caos/zitadel/internal/command/v2/preparation" "github.com/caos/zitadel/internal/domain" @@ -120,7 +121,7 @@ func Test_defaultDomainPolicy(t *testing.T) { return []eventstore.Event{ instance.NewDomainPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), }, nil @@ -128,8 +129,8 @@ func Test_defaultDomainPolicy(t *testing.T) { }, want: &command.PolicyDomainWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", Events: []eventstore.Event{}, }, UserLoginMustBeDomain: true, @@ -140,7 +141,7 @@ func Test_defaultDomainPolicy(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := instanceDomainPolicy(context.Background(), tt.args.filter) + got, err := instanceDomainPolicy(authz.WithInstanceID(context.Background(), "INSTANCE"), tt.args.filter) if (err != nil) != tt.wantErr { t.Errorf("defaultDomainPolicy() error = %v, wantErr %v", err, tt.wantErr) return @@ -222,7 +223,7 @@ func Test_DomainPolicy(t *testing.T) { return []eventstore.Event{ instance.NewDomainPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, true, ), }, nil @@ -231,8 +232,8 @@ func Test_DomainPolicy(t *testing.T) { }, want: &command.PolicyDomainWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", Events: []eventstore.Event{}, }, UserLoginMustBeDomain: true, @@ -253,7 +254,7 @@ func Test_DomainPolicy(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := domainPolicyWriteModel(context.Background(), tt.args.filter) + got, err := domainPolicyWriteModel(authz.WithInstanceID(context.Background(), "INSTANCE"), tt.args.filter) if (err != nil) != tt.wantErr { t.Errorf("defaultDomainPolicy() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/internal/command/v2/user_password_complexity_policy.go b/internal/command/v2/user_password_complexity_policy.go index 85c037833e..003c4eba5c 100644 --- a/internal/command/v2/user_password_complexity_policy.go +++ b/internal/command/v2/user_password_complexity_policy.go @@ -36,7 +36,7 @@ func customPasswordComplexityPolicy(ctx context.Context, filter preparation.Filt } func defaultPasswordComplexityPolicy(ctx context.Context, filter preparation.FilterToQueryReducer) (*command.PasswordComplexityPolicyWriteModel, error) { - policy := command.NewInstancePasswordComplexityPolicyWriteModel() + policy := command.NewInstancePasswordComplexityPolicyWriteModel(ctx) events, err := filter(ctx, policy.Query()) if err != nil { return nil, err diff --git a/internal/command/v2/user_password_complexity_policy_test.go b/internal/command/v2/user_password_complexity_policy_test.go index d1dad302bf..3ee8eb7adc 100644 --- a/internal/command/v2/user_password_complexity_policy_test.go +++ b/internal/command/v2/user_password_complexity_policy_test.go @@ -5,6 +5,7 @@ import ( "reflect" "testing" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/command" "github.com/caos/zitadel/internal/command/v2/preparation" "github.com/caos/zitadel/internal/domain" @@ -128,7 +129,7 @@ func Test_defaultPasswordComplexityPolicy(t *testing.T) { return []eventstore.Event{ instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, true, true, @@ -140,8 +141,8 @@ func Test_defaultPasswordComplexityPolicy(t *testing.T) { }, want: &command.PasswordComplexityPolicyWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", Events: []eventstore.Event{}, }, MinLength: 8, @@ -156,7 +157,7 @@ func Test_defaultPasswordComplexityPolicy(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := defaultPasswordComplexityPolicy(context.Background(), tt.args.filter) + got, err := defaultPasswordComplexityPolicy(authz.WithInstanceID(context.Background(), "INSTANCE"), tt.args.filter) if (err != nil) != tt.wantErr { t.Errorf("defaultPasswordComplexityPolicy() error = %v, wantErr %v", err, tt.wantErr) return @@ -246,7 +247,7 @@ func Test_passwordComplexityPolicy(t *testing.T) { return []eventstore.Event{ instance.NewPasswordComplexityPolicyAddedEvent( context.Background(), - &instance.NewAggregate().Aggregate, + &instance.NewAggregate("INSTANCE").Aggregate, 8, true, true, @@ -259,8 +260,8 @@ func Test_passwordComplexityPolicy(t *testing.T) { }, want: &command.PasswordComplexityPolicyWriteModel{ WriteModel: eventstore.WriteModel{ - AggregateID: "IAM", - ResourceOwner: "IAM", + AggregateID: "INSTANCE", + ResourceOwner: "INSTANCE", Events: []eventstore.Event{}, }, MinLength: 8, @@ -285,7 +286,7 @@ func Test_passwordComplexityPolicy(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := passwordComplexityPolicyWriteModel(context.Background(), tt.args.filter) + got, err := passwordComplexityPolicyWriteModel(authz.WithInstanceID(context.Background(), "INSTANCE"), tt.args.filter) if (err != nil) != tt.wantErr { t.Errorf("defaultPasswordComplexityPolicy() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/internal/domain/instance.go b/internal/domain/instance.go index f79edeb511..4a53cdc101 100644 --- a/internal/domain/instance.go +++ b/internal/domain/instance.go @@ -1,26 +1,19 @@ package domain -import ( - "github.com/caos/zitadel/internal/eventstore/v1/models" -) - const ( IAMID = "IAM" ) -type Instance struct { - models.ObjectRoot +type InstanceState int32 - GlobalOrgID string - IAMProjectID string - SetUpDone Step - SetUpStarted Step - Members []*Member - IDPs []*IDPConfig - DefaultLoginPolicy *LoginPolicy - DefaultLabelPolicy *LabelPolicy - DefaultDomainPolicy *DomainPolicy - DefaultPasswordComplexityPolicy *PasswordComplexityPolicy - DefaultPasswordAgePolicy *PasswordAgePolicy - DefaultPasswordLockoutPolicy *LockoutPolicy +const ( + InstanceStateUnspecified InstanceState = iota + InstanceStateActive + InstanceStateRemoved + + instanceStateCount +) + +func (f InstanceState) Valid() bool { + return f >= 0 && f < instanceStateCount } diff --git a/internal/domain/instance_domain.go b/internal/domain/instance_domain.go new file mode 100644 index 0000000000..5e3a7c1dde --- /dev/null +++ b/internal/domain/instance_domain.go @@ -0,0 +1,23 @@ +package domain + +import ( + "strings" +) + +type InstanceDomainState int32 + +const ( + InstanceDomainStateUnspecified InstanceDomainState = iota + InstanceDomainStateActive + InstanceDomainStateRemoved + + instanceDomainStateCount +) + +func (f InstanceDomainState) Valid() bool { + return f >= 0 && f < instanceDomainStateCount +} + +func NewGeneratedInstanceDomain(instanceName, iamDomain string) string { + return strings.ToLower(strings.ReplaceAll(instanceName, " ", "-") + "." + iamDomain) +} diff --git a/internal/notification/repository/eventsourcing/handler/notification.go b/internal/notification/repository/eventsourcing/handler/notification.go index 9b129a36cf..2f404259e5 100644 --- a/internal/notification/repository/eventsourcing/handler/notification.go +++ b/internal/notification/repository/eventsourcing/handler/notification.go @@ -145,13 +145,13 @@ func (n *Notification) handleInitUserCode(event *models.Event) (err error) { if err := initCode.SetData(event); err != nil { return err } - alreadyHandled, err := n.checkIfCodeAlreadyHandledOrExpired(event, initCode.Expiry, + ctx := getSetNotifyContextData(event.InstanceID, event.ResourceOwner) + alreadyHandled, err := n.checkIfCodeAlreadyHandledOrExpired(ctx, event, initCode.Expiry, user_repo.UserV1InitialCodeAddedType, user_repo.UserV1InitialCodeSentType, user_repo.HumanInitialCodeAddedType, user_repo.HumanInitialCodeSentType) if err != nil || alreadyHandled { return err } - ctx := getSetNotifyContextData(event.ResourceOwner) colors, err := n.getLabelPolicy(ctx) if err != nil { return err @@ -167,7 +167,7 @@ func (n *Notification) handleInitUserCode(event *models.Event) (err error) { return err } - translator, err := n.getTranslatorWithOrgTexts(user.ResourceOwner, domain.InitCodeMessageType) + translator, err := n.getTranslatorWithOrgTexts(ctx, user.ResourceOwner, domain.InitCodeMessageType) if err != nil { return err } @@ -184,13 +184,13 @@ func (n *Notification) handlePasswordCode(event *models.Event) (err error) { if err := pwCode.SetData(event); err != nil { return err } - alreadyHandled, err := n.checkIfCodeAlreadyHandledOrExpired(event, pwCode.Expiry, + ctx := getSetNotifyContextData(event.InstanceID, event.ResourceOwner) + alreadyHandled, err := n.checkIfCodeAlreadyHandledOrExpired(ctx, event, pwCode.Expiry, user_repo.UserV1PasswordCodeAddedType, user_repo.UserV1PasswordCodeSentType, user_repo.HumanPasswordCodeAddedType, user_repo.HumanPasswordCodeSentType) if err != nil || alreadyHandled { return err } - ctx := getSetNotifyContextData(event.ResourceOwner) colors, err := n.getLabelPolicy(ctx) if err != nil { return err @@ -206,7 +206,7 @@ func (n *Notification) handlePasswordCode(event *models.Event) (err error) { return err } - translator, err := n.getTranslatorWithOrgTexts(user.ResourceOwner, domain.PasswordResetMessageType) + translator, err := n.getTranslatorWithOrgTexts(ctx, user.ResourceOwner, domain.PasswordResetMessageType) if err != nil { return err } @@ -222,13 +222,13 @@ func (n *Notification) handleEmailVerificationCode(event *models.Event) (err err if err := emailCode.SetData(event); err != nil { return err } - alreadyHandled, err := n.checkIfCodeAlreadyHandledOrExpired(event, emailCode.Expiry, + ctx := getSetNotifyContextData(event.InstanceID, event.ResourceOwner) + alreadyHandled, err := n.checkIfCodeAlreadyHandledOrExpired(ctx, event, emailCode.Expiry, user_repo.UserV1EmailCodeAddedType, user_repo.UserV1EmailCodeSentType, user_repo.HumanEmailCodeAddedType, user_repo.HumanEmailCodeSentType) if err != nil || alreadyHandled { return nil } - ctx := getSetNotifyContextData(event.ResourceOwner) colors, err := n.getLabelPolicy(ctx) if err != nil { return err @@ -244,7 +244,7 @@ func (n *Notification) handleEmailVerificationCode(event *models.Event) (err err return err } - translator, err := n.getTranslatorWithOrgTexts(user.ResourceOwner, domain.VerifyEmailMessageType) + translator, err := n.getTranslatorWithOrgTexts(ctx, user.ResourceOwner, domain.VerifyEmailMessageType) if err != nil { return err } @@ -261,7 +261,8 @@ func (n *Notification) handlePhoneVerificationCode(event *models.Event) (err err if err := phoneCode.SetData(event); err != nil { return err } - alreadyHandled, err := n.checkIfCodeAlreadyHandledOrExpired(event, phoneCode.Expiry, + ctx := getSetNotifyContextData(event.InstanceID, event.ResourceOwner) + alreadyHandled, err := n.checkIfCodeAlreadyHandledOrExpired(ctx, event, phoneCode.Expiry, user_repo.UserV1PhoneCodeAddedType, user_repo.UserV1PhoneCodeSentType, user_repo.HumanPhoneCodeAddedType, user_repo.HumanPhoneCodeSentType) if err != nil || alreadyHandled { @@ -271,19 +272,20 @@ func (n *Notification) handlePhoneVerificationCode(event *models.Event) (err err if err != nil { return err } - translator, err := n.getTranslatorWithOrgTexts(user.ResourceOwner, domain.VerifyPhoneMessageType) + translator, err := n.getTranslatorWithOrgTexts(ctx, user.ResourceOwner, domain.VerifyPhoneMessageType) if err != nil { return err } - err = types.SendPhoneVerificationCode(context.Background(), translator, user, phoneCode, n.systemDefaults, n.getTwilioConfig, n.getFileSystemProvider, n.getLogProvider, n.userDataCrypto) + err = types.SendPhoneVerificationCode(ctx, translator, user, phoneCode, n.systemDefaults, n.getTwilioConfig, n.getFileSystemProvider, n.getLogProvider, n.userDataCrypto) if err != nil { return err } - return n.command.HumanPhoneVerificationCodeSent(getSetNotifyContextData(event.ResourceOwner), event.ResourceOwner, event.AggregateID) + return n.command.HumanPhoneVerificationCodeSent(ctx, event.ResourceOwner, event.AggregateID) } func (n *Notification) handleDomainClaimed(event *models.Event) (err error) { - alreadyHandled, err := n.checkIfAlreadyHandled(event.AggregateID, event.Sequence, user_repo.UserDomainClaimedType, user_repo.UserDomainClaimedSentType) + ctx := getSetNotifyContextData(event.InstanceID, event.ResourceOwner) + alreadyHandled, err := n.checkIfAlreadyHandled(ctx, event.AggregateID, event.Sequence, user_repo.UserDomainClaimedType, user_repo.UserDomainClaimedSentType) if err != nil || alreadyHandled { return nil } @@ -299,7 +301,6 @@ func (n *Notification) handleDomainClaimed(event *models.Event) (err error) { if user.LastEmail == "" { return nil } - ctx := getSetNotifyContextData(event.ResourceOwner) colors, err := n.getLabelPolicy(ctx) if err != nil { return err @@ -310,7 +311,7 @@ func (n *Notification) handleDomainClaimed(event *models.Event) (err error) { return err } - translator, err := n.getTranslatorWithOrgTexts(user.ResourceOwner, domain.DomainClaimedMessageType) + translator, err := n.getTranslatorWithOrgTexts(ctx, user.ResourceOwner, domain.DomainClaimedMessageType) if err != nil { return err } @@ -327,7 +328,8 @@ func (n *Notification) handlePasswordlessRegistrationLink(event *models.Event) ( if err := json.Unmarshal(event.Data, addedEvent); err != nil { return err } - events, err := n.getUserEvents(event.AggregateID, event.Sequence) + ctx := getSetNotifyContextData(event.InstanceID, event.ResourceOwner) + events, err := n.getUserEvents(ctx, event.AggregateID, event.Sequence) if err != nil { return err } @@ -346,7 +348,6 @@ func (n *Notification) handlePasswordlessRegistrationLink(event *models.Event) ( if err != nil { return err } - ctx := getSetNotifyContextData(event.ResourceOwner) colors, err := n.getLabelPolicy(ctx) if err != nil { return err @@ -357,7 +358,7 @@ func (n *Notification) handlePasswordlessRegistrationLink(event *models.Event) ( return err } - translator, err := n.getTranslatorWithOrgTexts(user.ResourceOwner, domain.PasswordlessRegistrationMessageType) + translator, err := n.getTranslatorWithOrgTexts(ctx, user.ResourceOwner, domain.PasswordlessRegistrationMessageType) if err != nil { return err } @@ -369,15 +370,15 @@ func (n *Notification) handlePasswordlessRegistrationLink(event *models.Event) ( return n.command.HumanPasswordlessInitCodeSent(ctx, event.AggregateID, event.ResourceOwner, addedEvent.ID) } -func (n *Notification) checkIfCodeAlreadyHandledOrExpired(event *models.Event, expiry time.Duration, eventTypes ...eventstore.EventType) (bool, error) { +func (n *Notification) checkIfCodeAlreadyHandledOrExpired(ctx context.Context, event *models.Event, expiry time.Duration, eventTypes ...eventstore.EventType) (bool, error) { if event.CreationDate.Add(expiry).Before(time.Now().UTC()) { return true, nil } - return n.checkIfAlreadyHandled(event.AggregateID, event.Sequence, eventTypes...) + return n.checkIfAlreadyHandled(ctx, event.AggregateID, event.Sequence, eventTypes...) } -func (n *Notification) checkIfAlreadyHandled(userID string, sequence uint64, eventTypes ...eventstore.EventType) (bool, error) { - events, err := n.getUserEvents(userID, sequence) +func (n *Notification) checkIfAlreadyHandled(ctx context.Context, userID string, sequence uint64, eventTypes ...eventstore.EventType) (bool, error) { + events, err := n.getUserEvents(ctx, userID, sequence) if err != nil { return false, err } @@ -391,13 +392,13 @@ func (n *Notification) checkIfAlreadyHandled(userID string, sequence uint64, eve return false, nil } -func (n *Notification) getUserEvents(userID string, sequence uint64) ([]*models.Event, error) { +func (n *Notification) getUserEvents(ctx context.Context, userID string, sequence uint64) ([]*models.Event, error) { query, err := view.UserByIDQuery(userID, sequence) if err != nil { return nil, err } - return n.es.FilterEvents(context.Background(), query) + return n.es.FilterEvents(ctx, query) } func (n *Notification) OnError(event *models.Event, err error) error { @@ -409,8 +410,9 @@ func (n *Notification) OnSuccess() error { return spooler.HandleSuccess(n.view.UpdateNotificationSpoolerRunTimestamp) } -func getSetNotifyContextData(orgID string) context.Context { - return authz.SetCtxData(context.Background(), authz.CtxData{UserID: NotifyUserID, OrgID: orgID}) +func getSetNotifyContextData(instanceID, orgID string) context.Context { + ctx := authz.WithInstanceID(context.Background(), instanceID) + return authz.SetCtxData(ctx, authz.CtxData{UserID: NotifyUserID, OrgID: orgID}) } // Read organization specific colors @@ -425,7 +427,7 @@ func (n *Notification) getMailTemplate(ctx context.Context) (*query.MailTemplate // Read iam smtp config func (n *Notification) getSMTPConfig(ctx context.Context) (*smtp.EmailConfig, error) { - config, err := n.queries.SMTPConfigByAggregateID(ctx, domain.IAMID) + config, err := n.queries.SMTPConfigByAggregateID(ctx, authz.GetInstance(ctx).InstanceID()) if err != nil { return nil, err } @@ -446,7 +448,7 @@ func (n *Notification) getSMTPConfig(ctx context.Context) (*smtp.EmailConfig, er // Read iam twilio config func (n *Notification) getTwilioConfig(ctx context.Context) (*twilio.TwilioConfig, error) { - config, err := n.queries.SMSProviderConfigByID(ctx, domain.IAMID) + config, err := n.queries.SMSProviderConfigByID(ctx, authz.GetInstance(ctx).InstanceID()) if err != nil { return nil, err } @@ -466,7 +468,7 @@ func (n *Notification) getTwilioConfig(ctx context.Context) (*twilio.TwilioConfi // Read iam filesystem provider config func (n *Notification) getFileSystemProvider(ctx context.Context) (*fs.FSConfig, error) { - config, err := n.queries.NotificationProviderByIDAndType(ctx, domain.IAMID, domain.NotificationProviderTypeFile) + config, err := n.queries.NotificationProviderByIDAndType(ctx, authz.GetInstance(ctx).InstanceID(), domain.NotificationProviderTypeFile) if err != nil { return nil, err } @@ -477,7 +479,7 @@ func (n *Notification) getFileSystemProvider(ctx context.Context) (*fs.FSConfig, // Read iam log provider config func (n *Notification) getLogProvider(ctx context.Context) (*log.LogConfig, error) { - config, err := n.queries.NotificationProviderByIDAndType(ctx, domain.IAMID, domain.NotificationProviderTypeLog) + config, err := n.queries.NotificationProviderByIDAndType(ctx, authz.GetInstance(ctx).InstanceID(), domain.NotificationProviderTypeLog) if err != nil { return nil, err } @@ -486,14 +488,13 @@ func (n *Notification) getLogProvider(ctx context.Context) (*log.LogConfig, erro }, nil } -func (n *Notification) getTranslatorWithOrgTexts(orgID, textType string) (*i18n.Translator, error) { - ctx := context.Background() +func (n *Notification) getTranslatorWithOrgTexts(ctx context.Context, orgID, textType string) (*i18n.Translator, error) { translator, err := i18n.NewTranslator(n.statikDir, i18n.TranslatorConfig{DefaultLanguage: n.queries.GetDefaultLanguage(ctx)}) if err != nil { return nil, err } - allCustomTexts, err := n.queries.CustomTextListByTemplate(ctx, domain.IAMID, textType) + allCustomTexts, err := n.queries.CustomTextListByTemplate(ctx, authz.GetInstance(ctx).InstanceID(), textType) if err != nil { return translator, nil } diff --git a/internal/query/custom_text.go b/internal/query/custom_text.go index be8753b9a0..3638a3210c 100644 --- a/internal/query/custom_text.go +++ b/internal/query/custom_text.go @@ -140,7 +140,7 @@ func (q *Queries) GetDefaultLoginTexts(ctx context.Context, lang string) (*domai return nil, errors.ThrowInternal(err, "TEXT-M0p4s", "Errors.TranslationFile.ReadError") } loginText.IsDefault = true - loginText.AggregateID = domain.IAMID + loginText.AggregateID = authz.GetInstance(ctx).InstanceID() return loginText, nil } @@ -149,7 +149,7 @@ func (q *Queries) GetCustomLoginTexts(ctx context.Context, aggregateID, lang str if err != nil { return nil, err } - return CustomTextsToLoginDomain(aggregateID, lang, texts), err + return CustomTextsToLoginDomain(authz.GetInstance(ctx).InstanceID(), aggregateID, lang, texts), err } func (q *Queries) IAMLoginTexts(ctx context.Context, lang string) (*domain.CustomLoginText, error) { @@ -161,7 +161,7 @@ func (q *Queries) IAMLoginTexts(ctx context.Context, lang string) (*domain.Custo if err := yaml.Unmarshal(contents, &loginTextMap); err != nil { return nil, errors.ThrowInternal(err, "QUERY-m0Jf3", "Errors.TranslationFile.ReadError") } - texts, err := q.CustomTextList(ctx, domain.IAMID, domain.LoginCustomText, lang) + texts, err := q.CustomTextList(ctx, authz.GetInstance(ctx).InstanceID(), domain.LoginCustomText, lang) if err != nil { return nil, err } @@ -181,7 +181,7 @@ func (q *Queries) IAMLoginTexts(ctx context.Context, lang string) (*domain.Custo if err := json.Unmarshal(jsonbody, &loginText); err != nil { return nil, errors.ThrowInternal(err, "QUERY-m93Jf", "Errors.TranslationFile.MergeError") } - loginText.AggregateID = domain.IAMID + loginText.AggregateID = authz.GetInstance(ctx).InstanceID() loginText.IsDefault = true return loginText, nil } @@ -276,7 +276,7 @@ func CustomTextToDomain(text *CustomText) *domain.CustomText { } } -func CustomTextsToLoginDomain(aggregateID, lang string, texts *CustomTexts) *domain.CustomLoginText { +func CustomTextsToLoginDomain(instanceID, aggregateID, lang string, texts *CustomTexts) *domain.CustomLoginText { langTag := language.Make(lang) result := &domain.CustomLoginText{ ObjectRoot: models.ObjectRoot{ @@ -285,7 +285,7 @@ func CustomTextsToLoginDomain(aggregateID, lang string, texts *CustomTexts) *dom Language: langTag, } if len(texts.CustomTexts) == 0 { - result.AggregateID = domain.IAMID + result.AggregateID = instanceID result.IsDefault = true } for _, text := range texts.CustomTexts { diff --git a/internal/query/features.go b/internal/query/features.go index 0b61e1f6f0..9f18b06a24 100644 --- a/internal/query/features.go +++ b/internal/query/features.go @@ -170,7 +170,7 @@ func (q *Queries) FeaturesByOrgID(ctx context.Context, orgID string) (*Features, FeatureColumnAggregateID.identifier(): orgID, }, sq.Eq{ - FeatureColumnAggregateID.identifier(): domain.IAMID, + FeatureColumnAggregateID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -187,7 +187,7 @@ func (q *Queries) FeaturesByOrgID(ctx context.Context, orgID string) (*Features, func (q *Queries) DefaultFeatures(ctx context.Context) (*Features, error) { query, scan := prepareFeaturesQuery() stmt, args, err := query.Where(sq.Eq{ - FeatureColumnAggregateID.identifier(): domain.IAMID, + FeatureColumnAggregateID.identifier(): authz.GetInstance(ctx).InstanceID(), FeatureColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }).ToSql() if err != nil { diff --git a/internal/query/idp.go b/internal/query/idp.go index 81bcbbac85..c109cf719b 100644 --- a/internal/query/idp.go +++ b/internal/query/idp.go @@ -193,7 +193,7 @@ func (q *Queries) IDPByIDAndResourceOwner(ctx context.Context, id, resourceOwner IDPResourceOwnerCol.identifier(): resourceOwner, }, sq.Eq{ - IDPResourceOwnerCol.identifier(): domain.IAMID, + IDPResourceOwnerCol.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }, diff --git a/internal/query/instance_domain.go b/internal/query/instance_domain.go new file mode 100644 index 0000000000..39c3d0dd6b --- /dev/null +++ b/internal/query/instance_domain.go @@ -0,0 +1,148 @@ +package query + +import ( + "context" + "database/sql" + "time" + + sq "github.com/Masterminds/squirrel" + + "github.com/caos/zitadel/internal/api/authz" + "github.com/caos/zitadel/internal/errors" + "github.com/caos/zitadel/internal/query/projection" +) + +type InstanceDomain struct { + CreationDate time.Time + ChangeDate time.Time + Sequence uint64 + Domain string + InstanceID string + IsGenerated bool +} + +type InstanceDomains struct { + SearchResponse + Domains []*InstanceDomain +} + +type InstanceDomainSearchQueries struct { + SearchRequest + Queries []SearchQuery +} + +func (q *InstanceDomainSearchQueries) toQuery(query sq.SelectBuilder) sq.SelectBuilder { + query = q.SearchRequest.toQuery(query) + for _, q := range q.Queries { + query = q.toQuery(query) + } + return query +} + +func NewInstanceDomainDomainSearchQuery(method TextComparison, value string) (SearchQuery, error) { + return NewTextQuery(InstanceDomainDomainCol, value, method) +} + +func NewInstanceDomainInstanceIDSearchQuery(value string) (SearchQuery, error) { + return NewTextQuery(InstanceDomainInstanceIDCol, value, TextEquals) +} + +func NewInstanceDomainGeneratedSearchQuery(verified bool) (SearchQuery, error) { + return NewBoolQuery(InstanceDomainIsGeneratedCol, verified) +} + +func (q *Queries) SearchInstanceDomains(ctx context.Context, queries *InstanceDomainSearchQueries) (domains *InstanceDomains, err error) { + query, scan := prepareInstanceDomainsQuery() + stmt, args, err := queries.toQuery(query). + Where(sq.Eq{ + InstanceDomainInstanceIDCol.identifier(): authz.GetInstance(ctx).InstanceID(), + }).ToSql() + if err != nil { + return nil, errors.ThrowInvalidArgument(err, "QUERY-inlsF", "Errors.Query.SQLStatement") + } + + rows, err := q.client.QueryContext(ctx, stmt, args...) + if err != nil { + return nil, errors.ThrowInternal(err, "QUERY-38Fni", "Errors.Internal") + } + domains, err = scan(rows) + if err != nil { + return nil, err + } + domains.LatestSequence, err = q.latestSequence(ctx, instanceDomainsTable) + return domains, err +} + +func prepareInstanceDomainsQuery() (sq.SelectBuilder, func(*sql.Rows) (*InstanceDomains, error)) { + return sq.Select( + InstanceDomainCreationDateCol.identifier(), + InstanceDomainChangeDateCol.identifier(), + InstanceDomainSequenceCol.identifier(), + InstanceDomainDomainCol.identifier(), + InstanceDomainInstanceIDCol.identifier(), + InstanceDomainIsGeneratedCol.identifier(), + countColumn.identifier(), + ).From(instanceDomainsTable.identifier()).PlaceholderFormat(sq.Dollar), + func(rows *sql.Rows) (*InstanceDomains, error) { + domains := make([]*InstanceDomain, 0) + var count uint64 + for rows.Next() { + domain := new(InstanceDomain) + err := rows.Scan( + &domain.CreationDate, + &domain.ChangeDate, + &domain.Sequence, + &domain.Domain, + &domain.InstanceID, + &domain.IsGenerated, + &count, + ) + if err != nil { + return nil, err + } + domains = append(domains, domain) + } + + if err := rows.Close(); err != nil { + return nil, errors.ThrowInternal(err, "QUERY-8nlWW", "Errors.Query.CloseRows") + } + + return &InstanceDomains{ + Domains: domains, + SearchResponse: SearchResponse{ + Count: count, + }, + }, nil + } +} + +var ( + instanceDomainsTable = table{ + name: projection.InstanceDomainTable, + } + + InstanceDomainCreationDateCol = Column{ + name: projection.InstanceDomainCreationDateCol, + table: instanceDomainsTable, + } + InstanceDomainChangeDateCol = Column{ + name: projection.InstanceDomainChangeDateCol, + table: instanceDomainsTable, + } + InstanceDomainSequenceCol = Column{ + name: projection.InstanceDomainSequenceCol, + table: instanceDomainsTable, + } + InstanceDomainDomainCol = Column{ + name: projection.InstanceDomainDomainCol, + table: instanceDomainsTable, + } + InstanceDomainInstanceIDCol = Column{ + name: projection.InstanceDomainInstanceIDCol, + table: instanceDomainsTable, + } + InstanceDomainIsGeneratedCol = Column{ + name: projection.InstanceDomainIsGeneratedCol, + table: instanceDomainsTable, + } +) diff --git a/internal/query/instance_domain_test.go b/internal/query/instance_domain_test.go new file mode 100644 index 0000000000..b8445701bc --- /dev/null +++ b/internal/query/instance_domain_test.go @@ -0,0 +1,188 @@ +package query + +import ( + "database/sql" + "database/sql/driver" + "errors" + "fmt" + "regexp" + "testing" +) + +func Test_InstanceDomainPrepares(t *testing.T) { + type want struct { + sqlExpectations sqlExpectation + err checkErr + } + tests := []struct { + name string + prepare interface{} + want want + object interface{} + }{ + { + name: "prepareDomainsQuery no result", + prepare: prepareInstanceDomainsQuery, + want: want{ + sqlExpectations: mockQueries( + regexp.QuoteMeta(`SELECT projections.instance_domains.creation_date,`+ + ` projections.instance_domains.change_date,`+ + ` projections.instance_domains.sequence,`+ + ` projections.instance_domains.domain,`+ + ` projections.instance_domains.instance_id,`+ + ` projections.instance_domains.is_generated,`+ + ` COUNT(*) OVER ()`+ + ` FROM projections.instance_domains`), + nil, + nil, + ), + }, + object: &InstanceDomains{Domains: []*InstanceDomain{}}, + }, + { + name: "prepareDomainsQuery one result", + prepare: prepareInstanceDomainsQuery, + want: want{ + sqlExpectations: mockQueries( + regexp.QuoteMeta(`SELECT projections.instance_domains.creation_date,`+ + ` projections.instance_domains.change_date,`+ + ` projections.instance_domains.sequence,`+ + ` projections.instance_domains.domain,`+ + ` projections.instance_domains.instance_id,`+ + ` projections.instance_domains.is_generated,`+ + ` COUNT(*) OVER ()`+ + ` FROM projections.instance_domains`), + []string{ + "creation_date", + "change_date", + "sequence", + "domain", + "instance_id", + "is_generated", + "count", + }, + [][]driver.Value{ + { + testNow, + testNow, + uint64(20211109), + "zitadel.ch", + "inst-id", + true, + }, + }, + ), + }, + object: &InstanceDomains{ + SearchResponse: SearchResponse{ + Count: 1, + }, + Domains: []*InstanceDomain{ + { + CreationDate: testNow, + ChangeDate: testNow, + Sequence: 20211109, + Domain: "zitadel.ch", + InstanceID: "inst-id", + IsGenerated: true, + }, + }, + }, + }, + { + name: "prepareDomainsQuery multiple result", + prepare: prepareInstanceDomainsQuery, + want: want{ + sqlExpectations: mockQueries( + regexp.QuoteMeta(`SELECT projections.instance_domains.creation_date,`+ + ` projections.instance_domains.change_date,`+ + ` projections.instance_domains.sequence,`+ + ` projections.instance_domains.domain,`+ + ` projections.instance_domains.instance_id,`+ + ` projections.instance_domains.is_generated,`+ + ` COUNT(*) OVER ()`+ + ` FROM projections.instance_domains`), + []string{ + "creation_date", + "change_date", + "sequence", + "domain", + "instance_id", + "is_generated", + "count", + }, + [][]driver.Value{ + { + testNow, + testNow, + uint64(20211109), + "zitadel.ch", + "inst-id", + true, + }, + { + testNow, + testNow, + uint64(20211109), + "zitadel.com", + "inst-id", + false, + }, + }, + ), + }, + object: &InstanceDomains{ + SearchResponse: SearchResponse{ + Count: 2, + }, + Domains: []*InstanceDomain{ + { + CreationDate: testNow, + ChangeDate: testNow, + Sequence: 20211109, + Domain: "zitadel.ch", + InstanceID: "inst-id", + IsGenerated: true, + }, + { + CreationDate: testNow, + ChangeDate: testNow, + Sequence: 20211109, + Domain: "zitadel.com", + InstanceID: "inst-id", + IsGenerated: false, + }, + }, + }, + }, + { + name: "prepareDomainsQuery sql err", + prepare: prepareInstanceDomainsQuery, + want: want{ + sqlExpectations: mockQueryErr( + regexp.QuoteMeta(`SELECT projections.instance_domains.creation_date,`+ + ` projections.instance_domains.change_date,`+ + ` projections.instance_domains.sequence,`+ + ` projections.instance_domains.domain,`+ + ` projections.instance_domains.instance_id,`+ + ` projections.instance_domains.is_generated,`+ + ` COUNT(*) OVER ()`+ + ` FROM projections.instance_domains`), + sql.ErrConnDone, + ), + err: func(err error) (error, bool) { + if !errors.Is(err, sql.ErrConnDone) { + return fmt.Errorf("err should be sql.ErrConnDone got: %w", err), false + } + return nil, true + }, + }, + object: nil, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assertPrepare(t, tt.prepare, tt.object, tt.want.sqlExpectations, tt.want.err) + }) + } +} diff --git a/internal/query/label_policy.go b/internal/query/label_policy.go index 77a8e6881f..c83602397c 100644 --- a/internal/query/label_policy.go +++ b/internal/query/label_policy.go @@ -49,7 +49,7 @@ func (q *Queries) ActiveLabelPolicyByOrg(ctx context.Context, orgID string) (*La LabelPolicyColID.identifier(): orgID, }, sq.Eq{ - LabelPolicyColID.identifier(): domain.IAMID, + LabelPolicyColID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, sq.Eq{ @@ -76,7 +76,7 @@ func (q *Queries) PreviewLabelPolicyByOrg(ctx context.Context, orgID string) (*L LabelPolicyColID.identifier(): orgID, }, sq.Eq{ - LabelPolicyColID.identifier(): domain.IAMID, + LabelPolicyColID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, sq.Eq{ @@ -97,7 +97,7 @@ func (q *Queries) PreviewLabelPolicyByOrg(ctx context.Context, orgID string) (*L func (q *Queries) DefaultActiveLabelPolicy(ctx context.Context) (*LabelPolicy, error) { stmt, scan := prepareLabelPolicyQuery() query, args, err := stmt.Where(sq.Eq{ - LabelPolicyColID.identifier(): domain.IAMID, + LabelPolicyColID.identifier(): authz.GetInstance(ctx).InstanceID(), LabelPolicyColState.identifier(): domain.LabelPolicyStateActive, LabelPolicyColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }). @@ -114,7 +114,7 @@ func (q *Queries) DefaultActiveLabelPolicy(ctx context.Context) (*LabelPolicy, e func (q *Queries) DefaultPreviewLabelPolicy(ctx context.Context) (*LabelPolicy, error) { stmt, scan := prepareLabelPolicyQuery() query, args, err := stmt.Where(sq.Eq{ - LabelPolicyColID.identifier(): domain.IAMID, + LabelPolicyColID.identifier(): authz.GetInstance(ctx).InstanceID(), LabelPolicyColState.identifier(): domain.LabelPolicyStatePreview, LabelPolicyColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }). diff --git a/internal/query/lockout_policy.go b/internal/query/lockout_policy.go index e526a396aa..ecc485e39c 100644 --- a/internal/query/lockout_policy.go +++ b/internal/query/lockout_policy.go @@ -87,7 +87,7 @@ func (q *Queries) LockoutPolicyByOrg(ctx context.Context, orgID string) (*Lockou LockoutColID.identifier(): orgID, }, sq.Eq{ - LockoutColID.identifier(): domain.IAMID, + LockoutColID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -104,7 +104,7 @@ func (q *Queries) LockoutPolicyByOrg(ctx context.Context, orgID string) (*Lockou func (q *Queries) DefaultLockoutPolicy(ctx context.Context) (*LockoutPolicy, error) { stmt, scan := prepareLockoutPolicyQuery() query, args, err := stmt.Where(sq.Eq{ - LockoutColID.identifier(): domain.IAMID, + LockoutColID.identifier(): authz.GetInstance(ctx).InstanceID(), LockoutColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }). OrderBy(LockoutColIsDefault.identifier()). diff --git a/internal/query/login_policy.go b/internal/query/login_policy.go index bb7ea90c9b..140aa0a6f9 100644 --- a/internal/query/login_policy.go +++ b/internal/query/login_policy.go @@ -141,7 +141,7 @@ func (q *Queries) LoginPolicyByID(ctx context.Context, orgID string) (*LoginPoli LoginPolicyColumnOrgID.identifier(): orgID, }, sq.Eq{ - LoginPolicyColumnOrgID.identifier(): domain.IAMID, + LoginPolicyColumnOrgID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -158,7 +158,7 @@ func (q *Queries) LoginPolicyByID(ctx context.Context, orgID string) (*LoginPoli func (q *Queries) DefaultLoginPolicy(ctx context.Context) (*LoginPolicy, error) { query, scan := prepareLoginPolicyQuery() stmt, args, err := query.Where(sq.Eq{ - LoginPolicyColumnOrgID.identifier(): domain.IAMID, + LoginPolicyColumnOrgID.identifier(): authz.GetInstance(ctx).InstanceID(), LoginPolicyColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }).OrderBy(LoginPolicyColumnIsDefault.identifier()).ToSql() if err != nil { @@ -181,7 +181,7 @@ func (q *Queries) SecondFactorsByOrg(ctx context.Context, orgID string) (*Second LoginPolicyColumnOrgID.identifier(): orgID, }, sq.Eq{ - LoginPolicyColumnOrgID.identifier(): domain.IAMID, + LoginPolicyColumnOrgID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -203,7 +203,7 @@ func (q *Queries) SecondFactorsByOrg(ctx context.Context, orgID string) (*Second func (q *Queries) DefaultSecondFactors(ctx context.Context) (*SecondFactors, error) { query, scan := prepareLoginPolicy2FAsQuery() stmt, args, err := query.Where(sq.Eq{ - LoginPolicyColumnOrgID.identifier(): domain.IAMID, + LoginPolicyColumnOrgID.identifier(): authz.GetInstance(ctx).InstanceID(), LoginPolicyColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }).OrderBy(LoginPolicyColumnIsDefault.identifier()).ToSql() if err != nil { @@ -231,7 +231,7 @@ func (q *Queries) MultiFactorsByOrg(ctx context.Context, orgID string) (*MultiFa LoginPolicyColumnOrgID.identifier(): orgID, }, sq.Eq{ - LoginPolicyColumnOrgID.identifier(): domain.IAMID, + LoginPolicyColumnOrgID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -253,7 +253,7 @@ func (q *Queries) MultiFactorsByOrg(ctx context.Context, orgID string) (*MultiFa func (q *Queries) DefaultMultiFactors(ctx context.Context) (*MultiFactors, error) { query, scan := prepareLoginPolicyMFAsQuery() stmt, args, err := query.Where(sq.Eq{ - LoginPolicyColumnOrgID.identifier(): domain.IAMID, + LoginPolicyColumnOrgID.identifier(): authz.GetInstance(ctx).InstanceID(), LoginPolicyColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }).OrderBy(LoginPolicyColumnIsDefault.identifier()).ToSql() if err != nil { diff --git a/internal/query/mail_template.go b/internal/query/mail_template.go index 8600a672c7..98898c634e 100644 --- a/internal/query/mail_template.go +++ b/internal/query/mail_template.go @@ -75,7 +75,7 @@ func (q *Queries) MailTemplateByOrg(ctx context.Context, orgID string) (*MailTem MailTemplateColAggregateID.identifier(): orgID, }, sq.Eq{ - MailTemplateColAggregateID.identifier(): domain.IAMID, + MailTemplateColAggregateID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -92,7 +92,7 @@ func (q *Queries) MailTemplateByOrg(ctx context.Context, orgID string) (*MailTem func (q *Queries) DefaultMailTemplate(ctx context.Context) (*MailTemplate, error) { stmt, scan := prepareMailTemplateQuery() query, args, err := stmt.Where(sq.Eq{ - MailTemplateColAggregateID.identifier(): domain.IAMID, + MailTemplateColAggregateID.identifier(): authz.GetInstance(ctx).InstanceID(), MailTemplateColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }). OrderBy(MailTemplateColIsDefault.identifier()). diff --git a/internal/query/message_text.go b/internal/query/message_text.go index 798dbe6aec..c6c91a563b 100644 --- a/internal/query/message_text.go +++ b/internal/query/message_text.go @@ -129,7 +129,7 @@ func (q *Queries) MessageTextByOrg(ctx context.Context, orgID string) (*MessageT MessageTextColAggregateID.identifier(): orgID, }, sq.Eq{ - MessageTextColAggregateID.identifier(): domain.IAMID, + MessageTextColAggregateID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -146,7 +146,7 @@ func (q *Queries) MessageTextByOrg(ctx context.Context, orgID string) (*MessageT func (q *Queries) DefaultMessageText(ctx context.Context) (*MessageText, error) { stmt, scan := prepareMessageTextQuery() query, args, err := stmt.Where(sq.Eq{ - MessageTextColAggregateID.identifier(): domain.IAMID, + MessageTextColAggregateID.identifier(): authz.GetInstance(ctx).InstanceID(), MessageTextColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }). Limit(1).ToSql() @@ -203,7 +203,7 @@ func (q *Queries) IAMMessageTextByTypeAndLanguage(ctx context.Context, messageTy if err := yaml.Unmarshal(contents, ¬ificationTextMap); err != nil { return nil, errors.ThrowInternal(err, "QUERY-ekjFF", "Errors.TranslationFile.ReadError") } - texts, err := q.CustomTextList(ctx, domain.IAMID, messageType, language) + texts, err := q.CustomTextList(ctx, authz.GetInstance(ctx).InstanceID(), messageType, language) if err != nil { return nil, err } @@ -225,7 +225,7 @@ func (q *Queries) IAMMessageTextByTypeAndLanguage(ctx context.Context, messageTy } result := notificationText.GetMessageTextByType(messageType) result.IsDefault = true - result.AggregateID = domain.IAMID + result.AggregateID = authz.GetInstance(ctx).InstanceID() return result, nil } diff --git a/internal/query/org_iam_policy.go b/internal/query/org_iam_policy.go index 8ce31406d6..e082f6a601 100644 --- a/internal/query/org_iam_policy.go +++ b/internal/query/org_iam_policy.go @@ -82,7 +82,7 @@ func (q *Queries) DomainPolicyByOrg(ctx context.Context, orgID string) (*DomainP DomainPolicyColID.identifier(): orgID, }, sq.Eq{ - DomainPolicyColID.identifier(): domain.IAMID, + DomainPolicyColID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -99,7 +99,7 @@ func (q *Queries) DomainPolicyByOrg(ctx context.Context, orgID string) (*DomainP func (q *Queries) DefaultDomainPolicy(ctx context.Context) (*DomainPolicy, error) { stmt, scan := prepareDomainPolicyQuery() query, args, err := stmt.Where(sq.Eq{ - DomainPolicyColID.identifier(): domain.IAMID, + DomainPolicyColID.identifier(): authz.GetInstance(ctx).InstanceID(), DomainPolicyColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }). OrderBy(DomainPolicyColIsDefault.identifier()). diff --git a/internal/query/password_age_policy.go b/internal/query/password_age_policy.go index 0f963e190c..d7d90f2550 100644 --- a/internal/query/password_age_policy.go +++ b/internal/query/password_age_policy.go @@ -86,7 +86,7 @@ func (q *Queries) PasswordAgePolicyByOrg(ctx context.Context, orgID string) (*Pa PasswordAgeColID.identifier(): orgID, }, sq.Eq{ - PasswordAgeColID.identifier(): domain.IAMID, + PasswordAgeColID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -103,7 +103,7 @@ func (q *Queries) PasswordAgePolicyByOrg(ctx context.Context, orgID string) (*Pa func (q *Queries) DefaultPasswordAgePolicy(ctx context.Context) (*PasswordAgePolicy, error) { stmt, scan := preparePasswordAgePolicyQuery() query, args, err := stmt.Where(sq.Eq{ - PasswordAgeColID.identifier(): domain.IAMID, + PasswordAgeColID.identifier(): authz.GetInstance(ctx).InstanceID(), }). OrderBy(PasswordAgeColIsDefault.identifier()). Limit(1).ToSql() diff --git a/internal/query/password_complexity_policy.go b/internal/query/password_complexity_policy.go index c3042187ec..90ae40499e 100644 --- a/internal/query/password_complexity_policy.go +++ b/internal/query/password_complexity_policy.go @@ -43,7 +43,7 @@ func (q *Queries) PasswordComplexityPolicyByOrg(ctx context.Context, orgID strin PasswordComplexityColID.identifier(): orgID, }, sq.Eq{ - PasswordComplexityColID.identifier(): domain.IAMID, + PasswordComplexityColID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -60,7 +60,7 @@ func (q *Queries) PasswordComplexityPolicyByOrg(ctx context.Context, orgID strin func (q *Queries) DefaultPasswordComplexityPolicy(ctx context.Context) (*PasswordComplexityPolicy, error) { stmt, scan := preparePasswordComplexityPolicyQuery() query, args, err := stmt.Where(sq.Eq{ - PasswordComplexityColID.identifier(): domain.IAMID, + PasswordComplexityColID.identifier(): authz.GetInstance(ctx).InstanceID(), PasswordComplexityColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }). OrderBy(PasswordComplexityColIsDefault.identifier()). diff --git a/internal/query/privacy_policy.go b/internal/query/privacy_policy.go index 135e9f16d1..3eb63b88eb 100644 --- a/internal/query/privacy_policy.go +++ b/internal/query/privacy_policy.go @@ -91,7 +91,7 @@ func (q *Queries) PrivacyPolicyByOrg(ctx context.Context, orgID string) (*Privac PrivacyColID.identifier(): orgID, }, sq.Eq{ - PrivacyColID.identifier(): domain.IAMID, + PrivacyColID.identifier(): authz.GetInstance(ctx).InstanceID(), }, }, }). @@ -108,7 +108,7 @@ func (q *Queries) PrivacyPolicyByOrg(ctx context.Context, orgID string) (*Privac func (q *Queries) DefaultPrivacyPolicy(ctx context.Context) (*PrivacyPolicy, error) { stmt, scan := preparePrivacyPolicyQuery() query, args, err := stmt.Where(sq.Eq{ - PrivacyColID.identifier(): domain.IAMID, + PrivacyColID.identifier(): authz.GetInstance(ctx).InstanceID(), PrivacyColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(), }). OrderBy(PrivacyColIsDefault.identifier()). diff --git a/internal/query/projection/instance_domain.go b/internal/query/projection/instance_domain.go new file mode 100644 index 0000000000..9610d45d27 --- /dev/null +++ b/internal/query/projection/instance_domain.go @@ -0,0 +1,96 @@ +package projection + +import ( + "context" + + "github.com/caos/zitadel/internal/errors" + "github.com/caos/zitadel/internal/eventstore" + "github.com/caos/zitadel/internal/eventstore/handler" + "github.com/caos/zitadel/internal/eventstore/handler/crdb" + "github.com/caos/zitadel/internal/repository/instance" +) + +const ( + InstanceDomainTable = "projections.instance_domains" + + InstanceDomainInstanceIDCol = "instance_id" + InstanceDomainCreationDateCol = "creation_date" + InstanceDomainChangeDateCol = "change_date" + InstanceDomainSequenceCol = "sequence" + InstanceDomainDomainCol = "domain" + InstanceDomainIsGeneratedCol = "is_generated" +) + +type InstanceDomainProjection struct { + crdb.StatementHandler +} + +func NewInstanceDomainProjection(ctx context.Context, config crdb.StatementHandlerConfig) *InstanceDomainProjection { + p := new(InstanceDomainProjection) + config.ProjectionName = InstanceDomainTable + config.Reducers = p.reducers() + config.InitCheck = crdb.NewTableCheck( + crdb.NewTable([]*crdb.Column{ + crdb.NewColumn(InstanceDomainInstanceIDCol, crdb.ColumnTypeText), + crdb.NewColumn(InstanceDomainCreationDateCol, crdb.ColumnTypeTimestamp), + crdb.NewColumn(InstanceDomainChangeDateCol, crdb.ColumnTypeTimestamp), + crdb.NewColumn(InstanceDomainSequenceCol, crdb.ColumnTypeInt64), + crdb.NewColumn(InstanceDomainDomainCol, crdb.ColumnTypeText), + crdb.NewColumn(InstanceDomainIsGeneratedCol, crdb.ColumnTypeBool), + }, + crdb.NewPrimaryKey(InstanceDomainInstanceIDCol, InstanceDomainDomainCol), + ), + ) + p.StatementHandler = crdb.NewStatementHandler(ctx, config) + return p +} + +func (p *InstanceDomainProjection) reducers() []handler.AggregateReducer { + return []handler.AggregateReducer{ + { + Aggregate: instance.AggregateType, + EventRedusers: []handler.EventReducer{ + { + Event: instance.InstanceDomainAddedEventType, + Reduce: p.reduceDomainAdded, + }, + { + Event: instance.InstanceDomainRemovedEventType, + Reduce: p.reduceDomainRemoved, + }, + }, + }, + } +} + +func (p *InstanceDomainProjection) reduceDomainAdded(event eventstore.Event) (*handler.Statement, error) { + e, ok := event.(*instance.DomainAddedEvent) + if !ok { + return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-38nNf", "reduce.wrong.event.type %s", instance.InstanceDomainAddedEventType) + } + return crdb.NewCreateStatement( + e, + []handler.Column{ + handler.NewCol(InstanceDomainCreationDateCol, e.CreationDate()), + handler.NewCol(InstanceDomainChangeDateCol, e.CreationDate()), + handler.NewCol(InstanceDomainSequenceCol, e.Sequence()), + handler.NewCol(InstanceDomainDomainCol, e.Domain), + handler.NewCol(InstanceDomainInstanceIDCol, e.Aggregate().ID), + handler.NewCol(InstanceDomainIsGeneratedCol, e.Generated), + }, + ), nil +} + +func (p *InstanceDomainProjection) reduceDomainRemoved(event eventstore.Event) (*handler.Statement, error) { + e, ok := event.(*instance.DomainRemovedEvent) + if !ok { + return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-388Nk", "reduce.wrong.event.type %s", instance.InstanceDomainRemovedEventType) + } + return crdb.NewDeleteStatement( + e, + []handler.Condition{ + handler.NewCond(InstanceDomainDomainCol, e.Domain), + handler.NewCond(InstanceDomainInstanceIDCol, e.Aggregate().ID), + }, + ), nil +} diff --git a/internal/query/projection/instance_domain_test.go b/internal/query/projection/instance_domain_test.go new file mode 100644 index 0000000000..772a18327a --- /dev/null +++ b/internal/query/projection/instance_domain_test.go @@ -0,0 +1,97 @@ +package projection + +import ( + "testing" + + "github.com/caos/zitadel/internal/errors" + "github.com/caos/zitadel/internal/eventstore" + "github.com/caos/zitadel/internal/eventstore/handler" + "github.com/caos/zitadel/internal/eventstore/repository" + "github.com/caos/zitadel/internal/repository/instance" +) + +func TestInstanceDomainProjection_reduces(t *testing.T) { + type args struct { + event func(t *testing.T) eventstore.Event + } + tests := []struct { + name string + args args + reduce func(event eventstore.Event) (*handler.Statement, error) + want wantReduce + }{ + { + name: "reduceDomainAdded", + args: args{ + event: getEvent(testEvent( + repository.EventType(instance.InstanceDomainAddedEventType), + instance.AggregateType, + []byte(`{"domain": "domain.new", "generated": true}`), + ), instance.DomainAddedEventMapper), + }, + reduce: (&InstanceDomainProjection{}).reduceDomainAdded, + want: wantReduce{ + projection: InstanceDomainTable, + aggregateType: eventstore.AggregateType("instance"), + sequence: 15, + previousSequence: 10, + executer: &testExecuter{ + executions: []execution{ + { + expectedStmt: "INSERT INTO projections.instance_domains (creation_date, change_date, sequence, domain, instance_id, is_generated) VALUES ($1, $2, $3, $4, $5, $6)", + expectedArgs: []interface{}{ + anyArg{}, + anyArg{}, + uint64(15), + "domain.new", + "agg-id", + true, + }, + }, + }, + }, + }, + }, + { + name: "reduceDomainRemoved", + args: args{ + event: getEvent(testEvent( + repository.EventType(instance.InstanceDomainRemovedEventType), + instance.AggregateType, + []byte(`{"domain": "domain.new"}`), + ), instance.DomainRemovedEventMapper), + }, + reduce: (&InstanceDomainProjection{}).reduceDomainRemoved, + want: wantReduce{ + projection: InstanceDomainTable, + aggregateType: eventstore.AggregateType("instance"), + sequence: 15, + previousSequence: 10, + executer: &testExecuter{ + executions: []execution{ + { + expectedStmt: "DELETE FROM projections.instance_domains WHERE (domain = $1) AND (instance_id = $2)", + expectedArgs: []interface{}{ + "domain.new", + "agg-id", + }, + }, + }, + }, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + event := baseEvent(t) + got, err := tt.reduce(event) + if _, ok := err.(errors.InvalidArgument); !ok { + t.Errorf("no wrong event mapping: %v, got: %v", err, got) + } + + event = tt.args.event(t) + got, err = tt.reduce(event) + assertReduce(t, got, err, tt.want) + }) + } +} diff --git a/internal/query/projection/projection.go b/internal/query/projection/projection.go index bdcb96e614..e5da1736e8 100644 --- a/internal/query/projection/projection.go +++ b/internal/query/projection/projection.go @@ -59,6 +59,7 @@ func Start(ctx context.Context, sqlClient *sql.DB, es *eventstore.Eventstore, co NewUserProjection(ctx, applyCustomConfig(projectionConfig, config.Customizations["users"])) NewLoginNameProjection(ctx, applyCustomConfig(projectionConfig, config.Customizations["login_names"])) NewOrgMemberProjection(ctx, applyCustomConfig(projectionConfig, config.Customizations["org_members"])) + NewInstanceDomainProjection(ctx, applyCustomConfig(projectionConfig, config.Customizations["instance_domains"])) NewInstanceMemberProjection(ctx, applyCustomConfig(projectionConfig, config.Customizations["iam_members"])) NewProjectMemberProjection(ctx, applyCustomConfig(projectionConfig, config.Customizations["project_members"])) NewProjectGrantMemberProjection(ctx, applyCustomConfig(projectionConfig, config.Customizations["project_grant_members"])) diff --git a/internal/query/zitadel_permission.go b/internal/query/zitadel_permission.go index 51261f749b..39488da934 100644 --- a/internal/query/zitadel_permission.go +++ b/internal/query/zitadel_permission.go @@ -3,6 +3,7 @@ package query import ( "context" + "github.com/caos/zitadel/internal/api/authz" "github.com/caos/zitadel/internal/domain" ) @@ -11,7 +12,7 @@ func (q *Queries) MyZitadelPermissions(ctx context.Context, orgID, userID string if err != nil { return nil, err } - orgIDsQuery, err := NewMembershipResourceOwnersSearchQuery(orgID, domain.IAMID) + orgIDsQuery, err := NewMembershipResourceOwnersSearchQuery(orgID, authz.GetInstance(ctx).InstanceID()) if err != nil { return nil, err } diff --git a/internal/repository/instance/aggregate.go b/internal/repository/instance/aggregate.go index f79c5b4433..d171b76009 100644 --- a/internal/repository/instance/aggregate.go +++ b/internal/repository/instance/aggregate.go @@ -1,7 +1,6 @@ package instance import ( - "github.com/caos/zitadel/internal/domain" "github.com/caos/zitadel/internal/eventstore" ) @@ -18,13 +17,13 @@ type Aggregate struct { eventstore.Aggregate } -func NewAggregate() *Aggregate { +func NewAggregate(instanceID string) *Aggregate { return &Aggregate{ Aggregate: eventstore.Aggregate{ Type: AggregateType, Version: AggregateVersion, - ID: domain.IAMID, - ResourceOwner: domain.IAMID, + ID: instanceID, + ResourceOwner: instanceID, }, } } diff --git a/internal/repository/instance/domain.go b/internal/repository/instance/domain.go new file mode 100644 index 0000000000..8d8a463dfe --- /dev/null +++ b/internal/repository/instance/domain.go @@ -0,0 +1,107 @@ +package instance + +import ( + "context" + "encoding/json" + + "github.com/caos/zitadel/internal/eventstore" + + "github.com/caos/zitadel/internal/errors" + "github.com/caos/zitadel/internal/eventstore/repository" +) + +const ( + UniqueInstanceDomain = "instance_domain" + domainEventPrefix = instanceEventTypePrefix + "domain." + InstanceDomainAddedEventType = domainEventPrefix + "added" + InstanceDomainRemovedEventType = domainEventPrefix + "removed" +) + +func NewAddInstanceDomainUniqueConstraint(orgDomain string) *eventstore.EventUniqueConstraint { + return eventstore.NewAddEventUniqueConstraint( + UniqueInstanceDomain, + orgDomain, + "Errors.Instance.Domain.AlreadyExists") +} + +func NewRemoveInstanceDomainUniqueConstraint(orgDomain string) *eventstore.EventUniqueConstraint { + return eventstore.NewRemoveEventUniqueConstraint( + UniqueInstanceDomain, + orgDomain) +} + +type DomainAddedEvent struct { + eventstore.BaseEvent `json:"-"` + + Domain string `json:"domain,omitempty"` + Generated bool `json:"generated,omitempty"` +} + +func (e *DomainAddedEvent) Data() interface{} { + return e +} + +func (e *DomainAddedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint { + return []*eventstore.EventUniqueConstraint{NewAddInstanceDomainUniqueConstraint(e.Domain)} +} + +func NewDomainAddedEvent(ctx context.Context, aggregate *eventstore.Aggregate, domain string, generated bool) *DomainAddedEvent { + return &DomainAddedEvent{ + BaseEvent: *eventstore.NewBaseEventForPush( + ctx, + aggregate, + InstanceDomainAddedEventType, + ), + Domain: domain, + Generated: generated, + } +} + +func DomainAddedEventMapper(event *repository.Event) (eventstore.Event, error) { + orgDomainAdded := &DomainAddedEvent{ + BaseEvent: *eventstore.BaseEventFromRepo(event), + } + err := json.Unmarshal(event.Data, orgDomainAdded) + if err != nil { + return nil, errors.ThrowInternal(err, "INSTANCE-3noij", "unable to unmarshal instance domain added") + } + + return orgDomainAdded, nil +} + +type DomainRemovedEvent struct { + eventstore.BaseEvent `json:"-"` + + Domain string `json:"domain,omitempty"` +} + +func (e *DomainRemovedEvent) Data() interface{} { + return e +} + +func (e *DomainRemovedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint { + return []*eventstore.EventUniqueConstraint{NewRemoveInstanceDomainUniqueConstraint(e.Domain)} +} + +func NewDomainRemovedEvent(ctx context.Context, aggregate *eventstore.Aggregate, domain string) *DomainRemovedEvent { + return &DomainRemovedEvent{ + BaseEvent: *eventstore.NewBaseEventForPush( + ctx, + aggregate, + InstanceDomainRemovedEventType, + ), + Domain: domain, + } +} + +func DomainRemovedEventMapper(event *repository.Event) (eventstore.Event, error) { + orgDomainRemoved := &DomainRemovedEvent{ + BaseEvent: *eventstore.BaseEventFromRepo(event), + } + err := json.Unmarshal(event.Data, orgDomainRemoved) + if err != nil { + return nil, errors.ThrowInternal(err, "INSTANCE-BngB2", "unable to unmarshal instance domain removed") + } + + return orgDomainRemoved, nil +} diff --git a/internal/repository/instance/eventstore.go b/internal/repository/instance/eventstore.go index 5ea7659afb..bb0113f515 100644 --- a/internal/repository/instance/eventstore.go +++ b/internal/repository/instance/eventstore.go @@ -85,5 +85,10 @@ func RegisterEventMappers(es *eventstore.Eventstore) { RegisterFilterEventMapper(CustomTextSetEventType, CustomTextSetEventMapper). RegisterFilterEventMapper(CustomTextRemovedEventType, CustomTextRemovedEventMapper). RegisterFilterEventMapper(CustomTextTemplateRemovedEventType, CustomTextTemplateRemovedEventMapper). - RegisterFilterEventMapper(FeaturesSetEventType, FeaturesSetEventMapper) + RegisterFilterEventMapper(FeaturesSetEventType, FeaturesSetEventMapper). + RegisterFilterEventMapper(InstanceDomainAddedEventType, DomainAddedEventMapper). + RegisterFilterEventMapper(InstanceDomainRemovedEventType, DomainRemovedEventMapper). + RegisterFilterEventMapper(InstanceAddedEventType, InstanceAddedEventMapper). + RegisterFilterEventMapper(InstanceChangedEventType, InstanceChangedEventMapper). + RegisterFilterEventMapper(InstanceRemovedEventType, InstanceRemovedEventMapper) } diff --git a/internal/repository/instance/instance.go b/internal/repository/instance/instance.go new file mode 100644 index 0000000000..69fb974f44 --- /dev/null +++ b/internal/repository/instance/instance.go @@ -0,0 +1,126 @@ +package instance + +import ( + "context" + "encoding/json" + + "github.com/caos/zitadel/internal/errors" + "github.com/caos/zitadel/internal/eventstore" + "github.com/caos/zitadel/internal/eventstore/repository" +) + +const ( + InstanceAddedEventType = instanceEventTypePrefix + "added" + InstanceChangedEventType = instanceEventTypePrefix + "changed" + InstanceRemovedEventType = instanceEventTypePrefix + "removed" +) + +type InstanceAddedEvent struct { + eventstore.BaseEvent `json:"-"` + + Name string `json:"name,omitempty"` +} + +func (e *InstanceAddedEvent) Data() interface{} { + return e +} + +func (e *InstanceAddedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint { + return nil +} + +func NewInstanceAddedEvent(ctx context.Context, aggregate *eventstore.Aggregate, name string) *InstanceAddedEvent { + return &InstanceAddedEvent{ + BaseEvent: *eventstore.NewBaseEventForPush( + ctx, + aggregate, + InstanceAddedEventType, + ), + Name: name, + } +} + +func InstanceAddedEventMapper(event *repository.Event) (eventstore.Event, error) { + instanceAdded := &InstanceAddedEvent{ + BaseEvent: *eventstore.BaseEventFromRepo(event), + } + err := json.Unmarshal(event.Data, instanceAdded) + if err != nil { + return nil, errors.ThrowInternal(err, "INSTANCE-s9l3F", "unable to unmarshal instance added") + } + + return instanceAdded, nil +} + +type InstanceChangedEvent struct { + eventstore.BaseEvent `json:"-"` + + Name string `json:"name,omitempty"` +} + +func (e *InstanceChangedEvent) Data() interface{} { + return e +} + +func (e *InstanceChangedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint { + return nil +} + +func NewInstanceChangedEvent(ctx context.Context, aggregate *eventstore.Aggregate, oldName, newName string) *InstanceChangedEvent { + return &InstanceChangedEvent{ + BaseEvent: *eventstore.NewBaseEventForPush( + ctx, + aggregate, + InstanceChangedEventType, + ), + Name: newName, + } +} + +func InstanceChangedEventMapper(event *repository.Event) (eventstore.Event, error) { + instanceChanged := &InstanceChangedEvent{ + BaseEvent: *eventstore.BaseEventFromRepo(event), + } + err := json.Unmarshal(event.Data, instanceChanged) + if err != nil { + return nil, errors.ThrowInternal(err, "INSTANCE-3hfo8", "unable to unmarshal instance changed") + } + + return instanceChanged, nil +} + +type InstanceRemovedEvent struct { + eventstore.BaseEvent `json:"-"` + name string +} + +func (e *InstanceRemovedEvent) Data() interface{} { + return e +} + +func (e *InstanceRemovedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint { + return nil +} + +func NewInstanceRemovedEvent(ctx context.Context, aggregate *eventstore.Aggregate, name string) *InstanceRemovedEvent { + return &InstanceRemovedEvent{ + BaseEvent: *eventstore.NewBaseEventForPush( + ctx, + aggregate, + InstanceRemovedEventType, + ), + name: name, + } +} + +func InstanceRemovedEventMapper(event *repository.Event) (eventstore.Event, error) { + instanceRemoved := &InstanceRemovedEvent{ + BaseEvent: *eventstore.BaseEventFromRepo(event), + } + err := json.Unmarshal(event.Data, instanceRemoved) + if err != nil { + return nil, errors.ThrowInternal(err, "INSTANCE-39jlW", "unable to unmarshal instance removed") + } + + return instanceRemoved, nil +}