mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-04 03:35:14 +00:00
45 lines
905 B
Go
45 lines
905 B
Go
![]() |
package policy
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/caos/zitadel/internal/eventstore/v2"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
PasswordLockoutPolicyAddedEventType = "policy.password.lockout.added"
|
||
|
)
|
||
|
|
||
|
type PasswordLockoutPolicyAddedEvent struct {
|
||
|
eventstore.BaseEvent `json:"-"`
|
||
|
|
||
|
MaxAttempts int `json:"maxAttempts"`
|
||
|
ShowLockOutFailures bool `json:"showLockOutFailures"`
|
||
|
}
|
||
|
|
||
|
func (e *PasswordLockoutPolicyAddedEvent) CheckPrevious() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
func (e *PasswordLockoutPolicyAddedEvent) Data() interface{} {
|
||
|
return e
|
||
|
}
|
||
|
|
||
|
func NewPasswordLockoutPolicyAddedEvent(
|
||
|
ctx context.Context,
|
||
|
service string,
|
||
|
maxAttempts int,
|
||
|
showLockOutFailures bool,
|
||
|
) *PasswordLockoutPolicyAddedEvent {
|
||
|
|
||
|
return &PasswordLockoutPolicyAddedEvent{
|
||
|
BaseEvent: *eventstore.NewBaseEventForPush(
|
||
|
ctx,
|
||
|
service,
|
||
|
LabelPolicyAddedEventType,
|
||
|
),
|
||
|
MaxAttempts: maxAttempts,
|
||
|
ShowLockOutFailures: showLockOutFailures,
|
||
|
}
|
||
|
}
|