feat: validate org domains (#3387)

* feat: validate org domain command side

* feat: validate org domain query side

* fix: create domain policy

* feat: add reading domain policy on addorg domain
This commit is contained in:
Fabi
2022-04-13 11:24:03 +02:00
committed by GitHub
parent db554536a1
commit 820a21dce3
33 changed files with 223 additions and 39 deletions
+3 -1
View File
@@ -10,7 +10,8 @@ import (
func AddDefaultDomainPolicy(
a *instance.Aggregate,
userLoginMustBeDomain bool,
userLoginMustBeDomain,
validateOrgDomains bool,
) preparation.Validation {
return func() (preparation.CreateCommands, error) {
return func(ctx context.Context, filter preparation.FilterToQueryReducer) ([]eventstore.Command, error) {
@@ -18,6 +19,7 @@ func AddDefaultDomainPolicy(
return []eventstore.Command{
instance.NewDomainPolicyAddedEvent(ctx, &a.Aggregate,
userLoginMustBeDomain,
validateOrgDomains,
),
}, nil
}, nil