2020-08-26 09:56:23 +02:00
|
|
|
package admin
|
|
|
|
|
|
|
|
|
|
import (
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
|
|
|
|
policy_grpc "github.com/zitadel/zitadel/internal/api/grpc/policy"
|
2022-10-17 21:19:15 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/command"
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
|
|
|
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
2020-08-26 09:56:23 +02:00
|
|
|
)
|
|
|
|
|
|
2022-10-17 21:19:15 +02:00
|
|
|
func updateLoginPolicyToCommand(p *admin_pb.UpdateLoginPolicyRequest) *command.ChangeLoginPolicy {
|
|
|
|
|
return &command.ChangeLoginPolicy{
|
2022-02-21 16:05:02 +01:00
|
|
|
AllowUsernamePassword: p.AllowUsernamePassword,
|
|
|
|
|
AllowRegister: p.AllowRegister,
|
|
|
|
|
AllowExternalIDP: p.AllowExternalIdp,
|
|
|
|
|
ForceMFA: p.ForceMfa,
|
|
|
|
|
PasswordlessType: policy_grpc.PasswordlessTypeToDomain(p.PasswordlessType),
|
|
|
|
|
HidePasswordReset: p.HidePasswordReset,
|
2022-05-16 15:39:09 +02:00
|
|
|
IgnoreUnknownUsernames: p.IgnoreUnknownUsernames,
|
2022-10-06 13:30:14 +02:00
|
|
|
AllowDomainDiscovery: p.AllowDomainDiscovery,
|
2022-10-17 21:19:15 +02:00
|
|
|
DisableLoginWithEmail: p.DisableLoginWithEmail,
|
|
|
|
|
DisableLoginWithPhone: p.DisableLoginWithPhone,
|
2022-05-16 15:39:09 +02:00
|
|
|
DefaultRedirectURI: p.DefaultRedirectUri,
|
2022-02-21 16:05:02 +01:00
|
|
|
PasswordCheckLifetime: p.PasswordCheckLifetime.AsDuration(),
|
|
|
|
|
ExternalLoginCheckLifetime: p.ExternalLoginCheckLifetime.AsDuration(),
|
|
|
|
|
MFAInitSkipLifetime: p.MfaInitSkipLifetime.AsDuration(),
|
|
|
|
|
SecondFactorCheckLifetime: p.SecondFactorCheckLifetime.AsDuration(),
|
|
|
|
|
MultiFactorCheckLifetime: p.MultiFactorCheckLifetime.AsDuration(),
|
2020-08-26 09:56:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-08 14:49:19 +01:00
|
|
|
func ListLoginPolicyIDPsRequestToQuery(req *admin_pb.ListLoginPolicyIDPsRequest) *query.IDPLoginPolicyLinksSearchQuery {
|
2021-03-11 09:40:40 +01:00
|
|
|
offset, limit, asc := object.ListQueryToModel(req.Query)
|
2021-12-08 14:49:19 +01:00
|
|
|
return &query.IDPLoginPolicyLinksSearchQuery{
|
|
|
|
|
SearchRequest: query.SearchRequest{
|
|
|
|
|
Offset: offset,
|
|
|
|
|
Limit: limit,
|
|
|
|
|
Asc: asc,
|
|
|
|
|
},
|
2020-11-04 11:26:10 +01:00
|
|
|
}
|
|
|
|
|
}
|