mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 03:54:21 +00:00
52 lines
894 B
Go
52 lines
894 B
Go
package policy
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/caos/zitadel/internal/eventstore/v2"
|
|
)
|
|
|
|
const (
|
|
OrgIAMPolicyAddedEventType = "policy.org.iam.added"
|
|
)
|
|
|
|
type OrgIAMPolicyAggregate struct {
|
|
eventstore.Aggregate
|
|
|
|
UserLoginMustBeDomain bool
|
|
}
|
|
|
|
type OrgIAMPolicyReadModel struct {
|
|
eventstore.ReadModel
|
|
|
|
UserLoginMustBeDomain bool
|
|
}
|
|
|
|
type OrgIAMPolicyAddedEvent struct {
|
|
eventstore.BaseEvent `json:"-"`
|
|
|
|
UserLoginMustBeDomain bool `json:"allowUsernamePassword"`
|
|
}
|
|
|
|
func (e *OrgIAMPolicyAddedEvent) CheckPrevious() bool {
|
|
return true
|
|
}
|
|
|
|
func (e *OrgIAMPolicyAddedEvent) Data() interface{} {
|
|
return e
|
|
}
|
|
|
|
func NewOrgIAMPolicyAddedEvent(
|
|
ctx context.Context,
|
|
userLoginMustBeDomain bool,
|
|
) *OrgIAMPolicyAddedEvent {
|
|
|
|
return &OrgIAMPolicyAddedEvent{
|
|
BaseEvent: *eventstore.NewBaseEventForPush(
|
|
ctx,
|
|
OrgIAMPolicyAddedEventType,
|
|
),
|
|
UserLoginMustBeDomain: userLoginMustBeDomain,
|
|
}
|
|
}
|