mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
dc56e298ae
* fix: use domain models for v2 eventstore * fix: user domain model * Update internal/api/grpc/admin/login_policy_converter.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: converter Co-authored-by: Livio Amstutz <livio.a@gmail.com>
25 lines
685 B
Go
25 lines
685 B
Go
package admin
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/caos/zitadel/pkg/grpc/admin"
|
|
"github.com/golang/protobuf/ptypes/empty"
|
|
)
|
|
|
|
func (s *Server) GetDefaultLabelPolicy(ctx context.Context, _ *empty.Empty) (*admin.DefaultLabelPolicyView, error) {
|
|
result, err := s.iam.GetDefaultLabelPolicy(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return labelPolicyViewFromModel(result), nil
|
|
}
|
|
|
|
func (s *Server) UpdateDefaultLabelPolicy(ctx context.Context, policy *admin.DefaultLabelPolicyUpdate) (*admin.DefaultLabelPolicy, error) {
|
|
result, err := s.command.ChangeDefaultLabelPolicy(ctx, labelPolicyToDomain(policy))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return labelPolicyFromDomain(result), nil
|
|
}
|