2021-08-11 08:36:32 +02:00
|
|
|
package management
|
|
|
|
|
|
|
|
import (
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
|
|
mgmt "github.com/zitadel/zitadel/pkg/grpc/management"
|
2021-08-11 08:36:32 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func AddLockoutPolicyToDomain(p *mgmt.AddCustomLockoutPolicyRequest) *domain.LockoutPolicy {
|
|
|
|
return &domain.LockoutPolicy{
|
|
|
|
MaxPasswordAttempts: uint64(p.MaxPasswordAttempts),
|
2024-04-10 11:14:55 +02:00
|
|
|
MaxOTPAttempts: uint64(p.MaxOtpAttempts),
|
2021-08-11 08:36:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func UpdateLockoutPolicyToDomain(p *mgmt.UpdateCustomLockoutPolicyRequest) *domain.LockoutPolicy {
|
|
|
|
return &domain.LockoutPolicy{
|
|
|
|
MaxPasswordAttempts: uint64(p.MaxPasswordAttempts),
|
2024-04-10 11:14:55 +02:00
|
|
|
MaxOTPAttempts: uint64(p.MaxOtpAttempts),
|
2021-08-11 08:36:32 +02:00
|
|
|
}
|
|
|
|
}
|