mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:57:33 +00:00
feat: mail tempaltes/texts and step 10 (#1266)
* feat: mail template/text events * feat: mail template/text events * feat: mail template/text on iam and org * feat: setup step 10 * fix: add template event * fix: add unique constraints * Update internal/static/i18n/de.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/static/i18n/de.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/static/i18n/de.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/static/i18n/de.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/iam_policy_mail_template.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/org_policy_mail_text.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/iam_policy_mail_template.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/iam_policy_mail_text.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/iam_policy_mail_text.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/org_policy_mail_template.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/org_policy_mail_template.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/org_policy_mail_text.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: org iam policy Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -65,7 +65,7 @@ func (s *Server) GetOrgIamPolicy(ctx context.Context, in *admin.OrgIamPolicyID)
|
||||
}
|
||||
|
||||
func (s *Server) CreateOrgIamPolicy(ctx context.Context, in *admin.OrgIamPolicyRequest) (_ *admin.OrgIamPolicy, err error) {
|
||||
policy, err := s.command.AddOrgIAMPolicy(ctx, orgIAMPolicyRequestToDomain(in))
|
||||
policy, err := s.command.AddOrgIAMPolicy(ctx, in.OrgId, orgIAMPolicyRequestToDomain(in))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -73,7 +73,7 @@ func (s *Server) CreateOrgIamPolicy(ctx context.Context, in *admin.OrgIamPolicyR
|
||||
}
|
||||
|
||||
func (s *Server) UpdateOrgIamPolicy(ctx context.Context, in *admin.OrgIamPolicyRequest) (_ *admin.OrgIamPolicy, err error) {
|
||||
policy, err := s.command.ChangeOrgIAMPolicy(ctx, orgIAMPolicyRequestToDomain(in))
|
||||
policy, err := s.command.ChangeOrgIAMPolicy(ctx, in.OrgId, orgIAMPolicyRequestToDomain(in))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@@ -16,9 +16,9 @@ func (s *Server) GetDefaultMailTemplate(ctx context.Context, _ *empty.Empty) (*a
|
||||
}
|
||||
|
||||
func (s *Server) UpdateDefaultMailTemplate(ctx context.Context, policy *admin.DefaultMailTemplateUpdate) (*admin.DefaultMailTemplate, error) {
|
||||
result, err := s.iam.ChangeDefaultMailTemplate(ctx, templateToModel(policy))
|
||||
result, err := s.command.ChangeDefaultMailTemplate(ctx, templateToDomain(policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return templateFromModel(result), nil
|
||||
return templateFromDomain(result), nil
|
||||
}
|
||||
|
@@ -1,42 +1,30 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"github.com/caos/logging"
|
||||
iam_model "github.com/caos/zitadel/internal/iam/model"
|
||||
"github.com/caos/zitadel/internal/v2/domain"
|
||||
"github.com/caos/zitadel/pkg/grpc/admin"
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
func templateToModel(policy *admin.DefaultMailTemplateUpdate) *iam_model.MailTemplate {
|
||||
return &iam_model.MailTemplate{
|
||||
func templateToDomain(policy *admin.DefaultMailTemplateUpdate) *domain.MailTemplate {
|
||||
return &domain.MailTemplate{
|
||||
Template: policy.Template,
|
||||
}
|
||||
}
|
||||
|
||||
func templateFromModel(policy *iam_model.MailTemplate) *admin.DefaultMailTemplate {
|
||||
creationDate, err := ptypes.TimestampProto(policy.CreationDate)
|
||||
logging.Log("ADMIN-CAA7T").OnError(err).Debug("date parse failed")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(policy.ChangeDate)
|
||||
logging.Log("ADMIN-H52Zx").OnError(err).Debug("date parse failed")
|
||||
|
||||
func templateFromDomain(policy *domain.MailTemplate) *admin.DefaultMailTemplate {
|
||||
return &admin.DefaultMailTemplate{
|
||||
Template: policy.Template,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
CreationDate: timestamppb.New(policy.CreationDate),
|
||||
ChangeDate: timestamppb.New(policy.ChangeDate),
|
||||
}
|
||||
}
|
||||
|
||||
func templateViewFromModel(policy *iam_model.MailTemplateView) *admin.DefaultMailTemplateView {
|
||||
creationDate, err := ptypes.TimestampProto(policy.CreationDate)
|
||||
logging.Log("ADMIN-yWFs5").OnError(err).Debug("date parse failed")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(policy.ChangeDate)
|
||||
logging.Log("ADMIN-JRpIO").OnError(err).Debug("date parse failed")
|
||||
|
||||
return &admin.DefaultMailTemplateView{
|
||||
Template: policy.Template,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
CreationDate: timestamppb.New(policy.CreationDate),
|
||||
ChangeDate: timestamppb.New(policy.ChangeDate),
|
||||
}
|
||||
}
|
||||
|
@@ -24,9 +24,9 @@ func (s *Server) GetDefaultMailText(ctx context.Context, textType string, langua
|
||||
}
|
||||
|
||||
func (s *Server) UpdateDefaultMailText(ctx context.Context, text *admin.DefaultMailTextUpdate) (*admin.DefaultMailText, error) {
|
||||
result, err := s.iam.ChangeDefaultMailText(ctx, textToModel(text))
|
||||
result, err := s.command.ChangeDefaultMailText(ctx, textToDomain(text))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return textFromModel(result), nil
|
||||
return textFromDomain(result), nil
|
||||
}
|
||||
|
@@ -1,14 +1,14 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"github.com/caos/logging"
|
||||
iam_model "github.com/caos/zitadel/internal/iam/model"
|
||||
"github.com/caos/zitadel/internal/v2/domain"
|
||||
"github.com/caos/zitadel/pkg/grpc/admin"
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
func textToModel(text *admin.DefaultMailTextUpdate) *iam_model.MailText {
|
||||
return &iam_model.MailText{
|
||||
func textToDomain(text *admin.DefaultMailTextUpdate) *domain.MailText {
|
||||
return &domain.MailText{
|
||||
MailTextType: text.MailTextType,
|
||||
Language: text.Language,
|
||||
Title: text.Title,
|
||||
@@ -20,13 +20,7 @@ func textToModel(text *admin.DefaultMailTextUpdate) *iam_model.MailText {
|
||||
}
|
||||
}
|
||||
|
||||
func textFromModel(text *iam_model.MailText) *admin.DefaultMailText {
|
||||
creationDate, err := ptypes.TimestampProto(text.CreationDate)
|
||||
logging.Log("ADMIN-Jlzsj").OnError(err).Debug("date parse failed")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(text.ChangeDate)
|
||||
logging.Log("ADMIN-mw5b8").OnError(err).Debug("date parse failed")
|
||||
|
||||
func textFromDomain(text *domain.MailText) *admin.DefaultMailText {
|
||||
return &admin.DefaultMailText{
|
||||
MailTextType: text.MailTextType,
|
||||
Language: text.Language,
|
||||
@@ -36,8 +30,8 @@ func textFromModel(text *iam_model.MailText) *admin.DefaultMailText {
|
||||
Greeting: text.Greeting,
|
||||
Text: text.Text,
|
||||
ButtonText: text.ButtonText,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
CreationDate: timestamppb.New(text.CreationDate),
|
||||
ChangeDate: timestamppb.New(text.ChangeDate),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,12 +51,6 @@ func textsViewToModel(queries []*iam_model.MailTextView) []*admin.DefaultMailTex
|
||||
}
|
||||
|
||||
func textViewFromModel(text *iam_model.MailTextView) *admin.DefaultMailTextView {
|
||||
creationDate, err := ptypes.TimestampProto(text.CreationDate)
|
||||
logging.Log("ADMIN-7RyJc").OnError(err).Debug("date parse failed")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(text.ChangeDate)
|
||||
logging.Log("ADMIN-fTFgY").OnError(err).Debug("date parse failed")
|
||||
|
||||
return &admin.DefaultMailTextView{
|
||||
MailTextType: text.MailTextType,
|
||||
Language: text.Language,
|
||||
@@ -72,7 +60,7 @@ func textViewFromModel(text *iam_model.MailTextView) *admin.DefaultMailTextView
|
||||
Greeting: text.Greeting,
|
||||
Text: text.Text,
|
||||
ButtonText: text.ButtonText,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
CreationDate: timestamppb.New(text.CreationDate),
|
||||
ChangeDate: timestamppb.New(text.ChangeDate),
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ func (s *Server) GetDefaultLoginPolicy(ctx context.Context, _ *empty.Empty) (*ma
|
||||
}
|
||||
|
||||
func (s *Server) CreateLoginPolicy(ctx context.Context, policy *management.LoginPolicyRequest) (*management.LoginPolicy, error) {
|
||||
result, err := s.command.AddLoginPolicy(ctx, loginPolicyRequestToDomain(ctx, policy))
|
||||
result, err := s.command.AddLoginPolicy(ctx, authz.GetCtxData(ctx).OrgID, loginPolicyRequestToDomain(ctx, policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func (s *Server) CreateLoginPolicy(ctx context.Context, policy *management.Login
|
||||
}
|
||||
|
||||
func (s *Server) UpdateLoginPolicy(ctx context.Context, policy *management.LoginPolicyRequest) (*management.LoginPolicy, error) {
|
||||
result, err := s.command.ChangeLoginPolicy(ctx, loginPolicyRequestToDomain(ctx, policy))
|
||||
result, err := s.command.ChangeLoginPolicy(ctx, authz.GetCtxData(ctx).OrgID, loginPolicyRequestToDomain(ctx, policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func (s *Server) GetLoginPolicyIdpProviders(ctx context.Context, request *manage
|
||||
}
|
||||
|
||||
func (s *Server) AddIdpProviderToLoginPolicy(ctx context.Context, provider *management.IdpProviderAdd) (*management.IdpProvider, error) {
|
||||
result, err := s.command.AddIDPProviderToLoginPolicy(ctx, idpProviderAddToDomain(ctx, provider))
|
||||
result, err := s.command.AddIDPProviderToLoginPolicy(ctx, authz.GetCtxData(ctx).OrgID, idpProviderAddToDomain(ctx, provider))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func (s *Server) RemoveIdpProviderFromLoginPolicy(ctx context.Context, provider
|
||||
if err != nil {
|
||||
return &empty.Empty{}, err
|
||||
}
|
||||
err = s.command.RemoveIDPProviderFromLoginPolicy(ctx, idpProviderIDToDomain(ctx, provider), externalIDPViewsToDomain(externalIDPs)...)
|
||||
err = s.command.RemoveIDPProviderFromLoginPolicy(ctx, authz.GetCtxData(ctx).OrgID, idpProviderIDToDomain(ctx, provider), externalIDPViewsToDomain(externalIDPs)...)
|
||||
return &empty.Empty{}, err
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,7 @@ package management
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/api/authz"
|
||||
|
||||
"github.com/caos/zitadel/pkg/grpc/management"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
@@ -24,22 +25,22 @@ func (s *Server) GetDefaultMailTemplate(ctx context.Context, _ *empty.Empty) (*m
|
||||
}
|
||||
|
||||
func (s *Server) CreateMailTemplate(ctx context.Context, template *management.MailTemplateUpdate) (*management.MailTemplate, error) {
|
||||
result, err := s.org.AddMailTemplate(ctx, mailTemplateRequestToModel(template))
|
||||
result, err := s.command.AddMailTemplate(ctx, authz.GetCtxData(ctx).OrgID, mailTemplateRequestToDomain(template))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return mailTemplateFromModel(result), nil
|
||||
return mailTemplateFromDomain(result), nil
|
||||
}
|
||||
|
||||
func (s *Server) UpdateMailTemplate(ctx context.Context, template *management.MailTemplateUpdate) (*management.MailTemplate, error) {
|
||||
result, err := s.org.ChangeMailTemplate(ctx, mailTemplateRequestToModel(template))
|
||||
result, err := s.command.ChangeMailTemplate(ctx, authz.GetCtxData(ctx).OrgID, mailTemplateRequestToDomain(template))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return mailTemplateFromModel(result), nil
|
||||
return mailTemplateFromDomain(result), nil
|
||||
}
|
||||
|
||||
func (s *Server) RemoveMailTemplate(ctx context.Context, _ *empty.Empty) (*empty.Empty, error) {
|
||||
err := s.org.RemoveMailTemplate(ctx)
|
||||
err := s.command.RemoveMailTemplate(ctx, authz.GetCtxData(ctx).OrgID)
|
||||
return &empty.Empty{}, err
|
||||
}
|
||||
|
@@ -1,42 +1,31 @@
|
||||
package management
|
||||
|
||||
import (
|
||||
"github.com/caos/logging"
|
||||
iam_model "github.com/caos/zitadel/internal/iam/model"
|
||||
"github.com/caos/zitadel/internal/v2/domain"
|
||||
"github.com/caos/zitadel/pkg/grpc/management"
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
func mailTemplateRequestToModel(mailTemplate *management.MailTemplateUpdate) *iam_model.MailTemplate {
|
||||
return &iam_model.MailTemplate{
|
||||
func mailTemplateRequestToDomain(mailTemplate *management.MailTemplateUpdate) *domain.MailTemplate {
|
||||
return &domain.MailTemplate{
|
||||
Template: mailTemplate.Template,
|
||||
}
|
||||
}
|
||||
|
||||
func mailTemplateFromModel(mailTemplate *iam_model.MailTemplate) *management.MailTemplate {
|
||||
creationDate, err := ptypes.TimestampProto(mailTemplate.CreationDate)
|
||||
logging.Log("MANAG-ULKZ6").OnError(err).Debug("date parse failed")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(mailTemplate.ChangeDate)
|
||||
logging.Log("MANAG-451rI").OnError(err).Debug("date parse failed")
|
||||
func mailTemplateFromDomain(mailTemplate *domain.MailTemplate) *management.MailTemplate {
|
||||
return &management.MailTemplate{
|
||||
Template: mailTemplate.Template,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
CreationDate: timestamppb.New(mailTemplate.CreationDate),
|
||||
ChangeDate: timestamppb.New(mailTemplate.ChangeDate),
|
||||
}
|
||||
}
|
||||
|
||||
func mailTemplateViewFromModel(mailTemplate *iam_model.MailTemplateView) *management.MailTemplateView {
|
||||
creationDate, err := ptypes.TimestampProto(mailTemplate.CreationDate)
|
||||
logging.Log("MANAG-koQnB").OnError(err).Debug("date parse failed")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(mailTemplate.ChangeDate)
|
||||
logging.Log("MANAG-ToDhD").OnError(err).Debug("date parse failed")
|
||||
|
||||
return &management.MailTemplateView{
|
||||
Default: mailTemplate.Default,
|
||||
Template: mailTemplate.Template,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
CreationDate: timestamppb.New(mailTemplate.CreationDate),
|
||||
ChangeDate: timestamppb.New(mailTemplate.ChangeDate),
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package management
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/api/authz"
|
||||
|
||||
"github.com/caos/zitadel/pkg/grpc/management"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
@@ -24,22 +25,22 @@ func (s *Server) GetDefaultMailTexts(ctx context.Context, _ *empty.Empty) (*mana
|
||||
}
|
||||
|
||||
func (s *Server) CreateMailText(ctx context.Context, mailText *management.MailTextUpdate) (*management.MailText, error) {
|
||||
result, err := s.org.AddMailText(ctx, mailTextRequestToModel(mailText))
|
||||
result, err := s.command.AddMailText(ctx, authz.GetCtxData(ctx).OrgID, mailTextRequestToDomain(mailText))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return mailTextFromModel(result), nil
|
||||
return mailTextFromDoamin(result), nil
|
||||
}
|
||||
|
||||
func (s *Server) UpdateMailText(ctx context.Context, mailText *management.MailTextUpdate) (*management.MailText, error) {
|
||||
result, err := s.org.ChangeMailText(ctx, mailTextRequestToModel(mailText))
|
||||
result, err := s.command.ChangeMailText(ctx, authz.GetCtxData(ctx).OrgID, mailTextRequestToDomain(mailText))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return mailTextFromModel(result), nil
|
||||
return mailTextFromDoamin(result), nil
|
||||
}
|
||||
|
||||
func (s *Server) RemoveMailText(ctx context.Context, mailText *management.MailTextRemove) (*empty.Empty, error) {
|
||||
err := s.org.RemoveMailText(ctx, mailTextRemoveToModel(mailText))
|
||||
err := s.command.RemoveMailText(ctx, authz.GetCtxData(ctx).OrgID, mailText.MailTextType, mailText.Language)
|
||||
return &empty.Empty{}, err
|
||||
}
|
||||
|
@@ -3,12 +3,14 @@ package management
|
||||
import (
|
||||
"github.com/caos/logging"
|
||||
iam_model "github.com/caos/zitadel/internal/iam/model"
|
||||
"github.com/caos/zitadel/internal/v2/domain"
|
||||
"github.com/caos/zitadel/pkg/grpc/management"
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
func mailTextRequestToModel(mailText *management.MailTextUpdate) *iam_model.MailText {
|
||||
return &iam_model.MailText{
|
||||
func mailTextRequestToDomain(mailText *management.MailTextUpdate) *domain.MailText {
|
||||
return &domain.MailText{
|
||||
MailTextType: mailText.MailTextType,
|
||||
Language: mailText.Language,
|
||||
Title: mailText.Title,
|
||||
@@ -20,20 +22,7 @@ func mailTextRequestToModel(mailText *management.MailTextUpdate) *iam_model.Mail
|
||||
}
|
||||
}
|
||||
|
||||
func mailTextRemoveToModel(mailText *management.MailTextRemove) *iam_model.MailText {
|
||||
return &iam_model.MailText{
|
||||
MailTextType: mailText.MailTextType,
|
||||
Language: mailText.Language,
|
||||
}
|
||||
}
|
||||
|
||||
func mailTextFromModel(mailText *iam_model.MailText) *management.MailText {
|
||||
creationDate, err := ptypes.TimestampProto(mailText.CreationDate)
|
||||
logging.Log("MANAG-ULKZ6").OnError(err).Debug("date parse failed")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(mailText.ChangeDate)
|
||||
logging.Log("MANAG-451rI").OnError(err).Debug("date parse failed")
|
||||
|
||||
func mailTextFromDoamin(mailText *domain.MailText) *management.MailText {
|
||||
return &management.MailText{
|
||||
MailTextType: mailText.MailTextType,
|
||||
Language: mailText.Language,
|
||||
@@ -43,8 +32,8 @@ func mailTextFromModel(mailText *iam_model.MailText) *management.MailText {
|
||||
Greeting: mailText.Greeting,
|
||||
Text: mailText.Text,
|
||||
ButtonText: mailText.ButtonText,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
CreationDate: timestamppb.New(mailText.CreationDate),
|
||||
ChangeDate: timestamppb.New(mailText.ChangeDate),
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,7 @@ func (s *Server) GetDefaultPasswordAgePolicy(ctx context.Context, _ *empty.Empty
|
||||
}
|
||||
|
||||
func (s *Server) CreatePasswordAgePolicy(ctx context.Context, policy *management.PasswordAgePolicyRequest) (*management.PasswordAgePolicy, error) {
|
||||
result, err := s.command.AddPasswordAgePolicy(ctx, passwordAgePolicyRequestToDomain(ctx, policy))
|
||||
result, err := s.command.AddPasswordAgePolicy(ctx, authz.GetCtxData(ctx).OrgID, passwordAgePolicyRequestToDomain(ctx, policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func (s *Server) CreatePasswordAgePolicy(ctx context.Context, policy *management
|
||||
}
|
||||
|
||||
func (s *Server) UpdatePasswordAgePolicy(ctx context.Context, policy *management.PasswordAgePolicyRequest) (*management.PasswordAgePolicy, error) {
|
||||
result, err := s.command.ChangePasswordAgePolicy(ctx, passwordAgePolicyRequestToDomain(ctx, policy))
|
||||
result, err := s.command.ChangePasswordAgePolicy(ctx, authz.GetCtxData(ctx).OrgID, passwordAgePolicyRequestToDomain(ctx, policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ func (s *Server) GetDefaultPasswordComplexityPolicy(ctx context.Context, _ *empt
|
||||
}
|
||||
|
||||
func (s *Server) CreatePasswordComplexityPolicy(ctx context.Context, policy *management.PasswordComplexityPolicyRequest) (*management.PasswordComplexityPolicy, error) {
|
||||
result, err := s.command.AddPasswordComplexityPolicy(ctx, passwordComplexityPolicyRequestToDomain(ctx, policy))
|
||||
result, err := s.command.AddPasswordComplexityPolicy(ctx, authz.GetCtxData(ctx).OrgID, passwordComplexityPolicyRequestToDomain(ctx, policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func (s *Server) CreatePasswordComplexityPolicy(ctx context.Context, policy *man
|
||||
}
|
||||
|
||||
func (s *Server) UpdatePasswordComplexityPolicy(ctx context.Context, policy *management.PasswordComplexityPolicyRequest) (*management.PasswordComplexityPolicy, error) {
|
||||
result, err := s.command.ChangePasswordComplexityPolicy(ctx, passwordComplexityPolicyRequestToDomain(ctx, policy))
|
||||
result, err := s.command.ChangePasswordComplexityPolicy(ctx, authz.GetCtxData(ctx).OrgID, passwordComplexityPolicyRequestToDomain(ctx, policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ func (s *Server) GetDefaultPasswordLockoutPolicy(ctx context.Context, _ *empty.E
|
||||
}
|
||||
|
||||
func (s *Server) CreatePasswordLockoutPolicy(ctx context.Context, policy *management.PasswordLockoutPolicyRequest) (*management.PasswordLockoutPolicy, error) {
|
||||
result, err := s.command.AddPasswordLockoutPolicy(ctx, passwordLockoutPolicyRequestToDomain(ctx, policy))
|
||||
result, err := s.command.AddPasswordLockoutPolicy(ctx, authz.GetCtxData(ctx).OrgID, passwordLockoutPolicyRequestToDomain(ctx, policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func (s *Server) CreatePasswordLockoutPolicy(ctx context.Context, policy *manage
|
||||
}
|
||||
|
||||
func (s *Server) UpdatePasswordLockoutPolicy(ctx context.Context, policy *management.PasswordLockoutPolicyRequest) (*management.PasswordLockoutPolicy, error) {
|
||||
result, err := s.command.ChangePasswordLockoutPolicy(ctx, passwordLockoutPolicyRequestToDomain(ctx, policy))
|
||||
result, err := s.command.ChangePasswordLockoutPolicy(ctx, authz.GetCtxData(ctx).OrgID, passwordLockoutPolicyRequestToDomain(ctx, policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user