zitadel/internal/v2/repository/iam/policy_password_complexity.go

37 lines
1.1 KiB
Go
Raw Normal View History

package iam
import (
"github.com/caos/zitadel/internal/eventstore/v2"
"github.com/caos/zitadel/internal/v2/repository/policy"
)
var (
PasswordComplexityPolicyAddedEventType = iamEventTypePrefix + policy.PasswordComplexityPolicyAddedEventType
PasswordComplexityPolicyChangedEventType = iamEventTypePrefix + policy.PasswordComplexityPolicyChangedEventType
)
type PasswordComplexityPolicyReadModel struct {
policy.PasswordComplexityPolicyReadModel
}
2020-11-25 13:12:44 +00:00
func (rm *PasswordComplexityPolicyReadModel) AppendEvents(events ...eventstore.EventReader) {
for _, event := range events {
switch e := event.(type) {
case *PasswordComplexityPolicyAddedEvent:
rm.ReadModel.AppendEvents(&e.PasswordComplexityPolicyAddedEvent)
case *PasswordComplexityPolicyChangedEvent:
rm.ReadModel.AppendEvents(&e.PasswordComplexityPolicyChangedEvent)
case *policy.PasswordComplexityPolicyAddedEvent, *policy.PasswordComplexityPolicyChangedEvent:
rm.ReadModel.AppendEvents(e)
}
}
}
type PasswordComplexityPolicyAddedEvent struct {
policy.PasswordComplexityPolicyAddedEvent
}
type PasswordComplexityPolicyChangedEvent struct {
policy.PasswordComplexityPolicyChangedEvent
}