mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 19:44:21 +00:00
24 lines
809 B
Go
24 lines
809 B
Go
|
package admin
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"github.com/caos/zitadel/pkg/grpc/admin"
|
||
|
"github.com/golang/protobuf/ptypes/empty"
|
||
|
)
|
||
|
|
||
|
func (s *Server) GetDefaultPasswordComplexityPolicy(ctx context.Context, _ *empty.Empty) (*admin.DefaultPasswordComplexityPolicyView, error) {
|
||
|
result, err := s.iam.GetDefaultPasswordComplexityPolicy(ctx)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return passwordComplexityPolicyViewFromModel(result), nil
|
||
|
}
|
||
|
|
||
|
func (s *Server) UpdateDefaultPasswordComplexityPolicy(ctx context.Context, policy *admin.DefaultPasswordComplexityPolicyRequest) (*admin.DefaultPasswordComplexityPolicy, error) {
|
||
|
result, err := s.iam.ChangeDefaultPasswordComplexityPolicy(ctx, passwordComplexityPolicyToModel(policy))
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return passwordComplexityPolicyFromModel(result), nil
|
||
|
}
|