mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 17:04:22 +00:00
44 lines
833 B
Go
44 lines
833 B
Go
![]() |
package policy
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/caos/zitadel/internal/eventstore/v2"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
PasswordAgePolicyAddedEventType = "policy.password.age.added"
|
||
|
)
|
||
|
|
||
|
type PasswordAgePolicyAddedEvent struct {
|
||
|
eventstore.BaseEvent `json:"-"`
|
||
|
|
||
|
ExpireWarnDays int `json:"expireWarnDays"`
|
||
|
MaxAgeDays int `json:"maxAgeDays"`
|
||
|
}
|
||
|
|
||
|
func (e *PasswordAgePolicyAddedEvent) CheckPrevious() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
func (e *PasswordAgePolicyAddedEvent) Data() interface{} {
|
||
|
return e
|
||
|
}
|
||
|
|
||
|
func NewPasswordAgePolicyAddedEvent(
|
||
|
ctx context.Context,
|
||
|
service string,
|
||
|
expireWarnDays,
|
||
|
maxAgeDays int,
|
||
|
) *PasswordAgePolicyAddedEvent {
|
||
|
return &PasswordAgePolicyAddedEvent{
|
||
|
BaseEvent: *eventstore.NewBaseEventForPush(
|
||
|
ctx,
|
||
|
service,
|
||
|
PasswordAgePolicyAddedEventType,
|
||
|
),
|
||
|
ExpireWarnDays: expireWarnDays,
|
||
|
MaxAgeDays: maxAgeDays,
|
||
|
}
|
||
|
}
|