mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-15 09:05:26 +00:00
feat: Privacy policy (#1957)
* feat: command side privacy policy * feat: add privacy policy to api * feat: add privacy policy query side * fix: add privacy policy to mgmt api * fix: add privacy policy to auth and base data * feat: use privacyPolicy in login gui * feat: use privacyPolicy in login gui * feat: test org fatures * feat: typos * feat: tos in register
This commit is contained in:
35
internal/command/setup_step17.go
Normal file
35
internal/command/setup_step17.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/logging"
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
"github.com/caos/zitadel/internal/eventstore"
|
||||
)
|
||||
|
||||
type Step17 struct {
|
||||
PrivacyPolicy domain.PrivacyPolicy
|
||||
}
|
||||
|
||||
func (s *Step17) Step() domain.Step {
|
||||
return domain.Step17
|
||||
}
|
||||
|
||||
func (s *Step17) execute(ctx context.Context, commandSide *Commands) error {
|
||||
return commandSide.SetupStep17(ctx, s)
|
||||
}
|
||||
|
||||
func (c *Commands) SetupStep17(ctx context.Context, step *Step17) error {
|
||||
fn := func(iam *IAMWriteModel) ([]eventstore.EventPusher, error) {
|
||||
iamAgg := IAMAggregateFromWriteModel(&iam.WriteModel)
|
||||
addedPolicy := NewIAMPrivacyPolicyWriteModel()
|
||||
events, err := c.addDefaultPrivacyPolicy(ctx, iamAgg, addedPolicy, &step.PrivacyPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logging.Log("SETUP-N9sq2").Info("default privacy policy set up")
|
||||
return []eventstore.EventPusher{events}, nil
|
||||
}
|
||||
return c.setup(ctx, step, fn)
|
||||
}
|
||||
Reference in New Issue
Block a user