mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-06 13:27:45 +00:00
fix: add missing custom message text requests (#1851)
* fix: add missing requests * fix: test
This commit is contained in:
parent
6830de6385
commit
2502f379d9
@ -993,7 +993,7 @@ This is an empty response
|
||||
|
||||
|
||||
### GetDefaultDomainClaimedMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -1032,7 +1032,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetDefaultInitMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -1054,7 +1054,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetDefaultPasswordResetMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -1076,7 +1076,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetDefaultVerifyEmailMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -1098,7 +1098,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetDefaultVerifyPhoneMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
|
@ -1722,6 +1722,16 @@ Returns the custom text for initial message
|
||||
|
||||
|
||||
|
||||
### GetDefaultInitMessageText
|
||||
|
||||
> **rpc** GetDefaultInitMessageText([GetDefaultInitMessageTextRequest](#getdefaultinitmessagetextrequest))
|
||||
[GetDefaultInitMessageTextResponse](#getdefaultinitmessagetextresponse)
|
||||
|
||||
Returns the default text for initial message
|
||||
|
||||
|
||||
|
||||
|
||||
### SetCustomInitMessageText
|
||||
|
||||
> **rpc** SetCustomInitMessageText([SetCustomInitMessageTextRequest](#setcustominitmessagetextrequest))
|
||||
@ -1756,6 +1766,16 @@ Returns the custom text for password reset message
|
||||
|
||||
|
||||
|
||||
### GetDefaultPasswordResetMessageText
|
||||
|
||||
> **rpc** GetDefaultPasswordResetMessageText([GetDefaultPasswordResetMessageTextRequest](#getdefaultpasswordresetmessagetextrequest))
|
||||
[GetDefaultPasswordResetMessageTextResponse](#getdefaultpasswordresetmessagetextresponse)
|
||||
|
||||
Returns the default text for password reset message
|
||||
|
||||
|
||||
|
||||
|
||||
### SetCustomPasswordResetMessageText
|
||||
|
||||
> **rpc** SetCustomPasswordResetMessageText([SetCustomPasswordResetMessageTextRequest](#setcustompasswordresetmessagetextrequest))
|
||||
@ -1790,6 +1810,16 @@ Returns the custom text for verify email message
|
||||
|
||||
|
||||
|
||||
### GetDefaultVerifyEmailMessageText
|
||||
|
||||
> **rpc** GetDefaultVerifyEmailMessageText([GetDefaultVerifyEmailMessageTextRequest](#getdefaultverifyemailmessagetextrequest))
|
||||
[GetDefaultVerifyEmailMessageTextResponse](#getdefaultverifyemailmessagetextresponse)
|
||||
|
||||
Returns the default text for verify email message
|
||||
|
||||
|
||||
|
||||
|
||||
### SetCustomVerifyEmailMessageText
|
||||
|
||||
> **rpc** SetCustomVerifyEmailMessageText([SetCustomVerifyEmailMessageTextRequest](#setcustomverifyemailmessagetextrequest))
|
||||
@ -1824,6 +1854,16 @@ Returns the custom text for verify email message
|
||||
|
||||
|
||||
|
||||
### GetDefaultVerifyPhoneMessageText
|
||||
|
||||
> **rpc** GetDefaultVerifyPhoneMessageText([GetDefaultVerifyPhoneMessageTextRequest](#getdefaultverifyphonemessagetextrequest))
|
||||
[GetDefaultVerifyPhoneMessageTextResponse](#getdefaultverifyphonemessagetextresponse)
|
||||
|
||||
Returns the custom text for verify email message
|
||||
|
||||
|
||||
|
||||
|
||||
### SetCustomVerifyPhoneMessageText
|
||||
|
||||
> **rpc** SetCustomVerifyPhoneMessageText([SetCustomVerifyPhoneMessageTextRequest](#setcustomverifyphonemessagetextrequest))
|
||||
@ -1858,6 +1898,16 @@ Returns the custom text for domain claimed message
|
||||
|
||||
|
||||
|
||||
### GetDefaultDomainClaimedMessageText
|
||||
|
||||
> **rpc** GetDefaultDomainClaimedMessageText([GetDefaultDomainClaimedMessageTextRequest](#getdefaultdomainclaimedmessagetextrequest))
|
||||
[GetDefaultDomainClaimedMessageTextResponse](#getdefaultdomainclaimedmessagetextresponse)
|
||||
|
||||
Returns the custom text for domain claimed message
|
||||
|
||||
|
||||
|
||||
|
||||
### SetCustomDomainClaimedMessageCustomText
|
||||
|
||||
> **rpc** SetCustomDomainClaimedMessageCustomText([SetCustomDomainClaimedMessageTextRequest](#setcustomdomainclaimedmessagetextrequest))
|
||||
@ -2929,7 +2979,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetCustomDomainClaimedMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -2951,7 +3001,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetCustomInitMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -2973,7 +3023,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetCustomPasswordResetMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -2995,7 +3045,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetCustomVerifyEmailMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -3017,7 +3067,7 @@ This is an empty request
|
||||
|
||||
|
||||
### GetCustomVerifyPhoneMessageTextRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -3038,6 +3088,50 @@ This is an empty request
|
||||
|
||||
|
||||
|
||||
### GetDefaultDomainClaimedMessageTextRequest
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| language | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultDomainClaimedMessageTextResponse
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| custom_text | zitadel.text.v1.MessageCustomText | - | |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultInitMessageTextRequest
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| language | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultInitMessageTextResponse
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| custom_text | zitadel.text.v1.MessageCustomText | - | |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultLabelPolicyRequest
|
||||
This is an empty request
|
||||
|
||||
@ -3123,6 +3217,72 @@ This is an empty request
|
||||
|
||||
|
||||
|
||||
### GetDefaultPasswordResetMessageTextRequest
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| language | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultPasswordResetMessageTextResponse
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| custom_text | zitadel.text.v1.MessageCustomText | - | |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultVerifyEmailMessageTextRequest
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| language | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultVerifyEmailMessageTextResponse
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| custom_text | zitadel.text.v1.MessageCustomText | - | |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultVerifyPhoneMessageTextRequest
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| language | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetDefaultVerifyPhoneMessageTextResponse
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| custom_text | zitadel.text.v1.MessageCustomText | - | |
|
||||
|
||||
|
||||
|
||||
|
||||
### GetFeaturesRequest
|
||||
|
||||
|
||||
@ -5275,7 +5435,7 @@ This is an empty request
|
||||
|
||||
|
||||
### ResetCustomInitMessageTextToDefaultRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -5297,7 +5457,7 @@ This is an empty request
|
||||
|
||||
|
||||
### ResetCustomPasswordResetMessageTextToDefaultRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -5319,7 +5479,7 @@ This is an empty request
|
||||
|
||||
|
||||
### ResetCustomVerifyEmailMessageTextToDefaultRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
@ -5341,7 +5501,7 @@ This is an empty request
|
||||
|
||||
|
||||
### ResetCustomVerifyPhoneMessageTextToDefaultRequest
|
||||
This is an empty request
|
||||
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
|
@ -3,6 +3,8 @@ package management
|
||||
import (
|
||||
"context"
|
||||
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"github.com/caos/zitadel/internal/api/authz"
|
||||
"github.com/caos/zitadel/internal/api/grpc/object"
|
||||
text_grpc "github.com/caos/zitadel/internal/api/grpc/text"
|
||||
@ -20,6 +22,16 @@ func (s *Server) GetCustomInitMessageText(ctx context.Context, req *mgmt_pb.GetC
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetDefaultInitMessageText(ctx context.Context, req *mgmt_pb.GetDefaultInitMessageTextRequest) (*mgmt_pb.GetDefaultInitMessageTextResponse, error) {
|
||||
msg, err := s.org.GetDefaultMessageText(ctx, domain.InitCodeMessageType, req.Language)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.GetDefaultInitMessageTextResponse{
|
||||
CustomText: text_grpc.ModelCustomMsgTextToPb(msg),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) SetCustomInitMessageText(ctx context.Context, req *mgmt_pb.SetCustomInitMessageTextRequest) (*mgmt_pb.SetCustomInitMessageTextResponse, error) {
|
||||
result, err := s.command.SetOrgMessageText(ctx, authz.GetCtxData(ctx).OrgID, SetInitCustomTextToDomain(req))
|
||||
if err != nil {
|
||||
@ -34,6 +46,20 @@ func (s *Server) SetCustomInitMessageText(ctx context.Context, req *mgmt_pb.SetC
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) ResetCustomInitMessageTextToDefault(ctx context.Context, req *mgmt_pb.ResetCustomInitMessageTextToDefaultRequest) (*mgmt_pb.ResetCustomInitMessageTextToDefaultResponse, error) {
|
||||
result, err := s.command.RemoveOrgMessageTexts(ctx, authz.GetCtxData(ctx).OrgID, domain.InitCodeMessageType, language.Make(req.Language))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ResetCustomInitMessageTextToDefaultResponse{
|
||||
Details: object.ChangeToDetailsPb(
|
||||
result.Sequence,
|
||||
result.EventDate,
|
||||
result.ResourceOwner,
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetCustomPasswordResetMessageText(ctx context.Context, req *mgmt_pb.GetCustomPasswordResetMessageTextRequest) (*mgmt_pb.GetCustomPasswordResetMessageTextResponse, error) {
|
||||
msg, err := s.org.GetMessageText(ctx, authz.GetCtxData(ctx).OrgID, domain.PasswordResetMessageType, req.Language)
|
||||
if err != nil {
|
||||
@ -44,6 +70,16 @@ func (s *Server) GetCustomPasswordResetMessageText(ctx context.Context, req *mgm
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetDefaultPasswordResetMessageText(ctx context.Context, req *mgmt_pb.GetDefaultPasswordResetMessageTextRequest) (*mgmt_pb.GetDefaultPasswordResetMessageTextResponse, error) {
|
||||
msg, err := s.org.GetDefaultMessageText(ctx, domain.PasswordResetMessageType, req.Language)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.GetDefaultPasswordResetMessageTextResponse{
|
||||
CustomText: text_grpc.ModelCustomMsgTextToPb(msg),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) SetCustomPasswordResetMessageText(ctx context.Context, req *mgmt_pb.SetCustomPasswordResetMessageTextRequest) (*mgmt_pb.SetCustomPasswordResetMessageTextResponse, error) {
|
||||
result, err := s.command.SetOrgMessageText(ctx, authz.GetCtxData(ctx).OrgID, SetPasswordResetCustomTextToDomain(req))
|
||||
if err != nil {
|
||||
@ -58,6 +94,20 @@ func (s *Server) SetCustomPasswordResetMessageText(ctx context.Context, req *mgm
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) ResetCustomPasswordResetMessageTextToDefault(ctx context.Context, req *mgmt_pb.ResetCustomPasswordResetMessageTextToDefaultRequest) (*mgmt_pb.ResetCustomPasswordResetMessageTextToDefaultResponse, error) {
|
||||
result, err := s.command.RemoveOrgMessageTexts(ctx, authz.GetCtxData(ctx).OrgID, domain.PasswordResetMessageType, language.Make(req.Language))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ResetCustomPasswordResetMessageTextToDefaultResponse{
|
||||
Details: object.ChangeToDetailsPb(
|
||||
result.Sequence,
|
||||
result.EventDate,
|
||||
result.ResourceOwner,
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetCustomVerifyEmailMessageText(ctx context.Context, req *mgmt_pb.GetCustomVerifyEmailMessageTextRequest) (*mgmt_pb.GetCustomVerifyEmailMessageTextResponse, error) {
|
||||
msg, err := s.org.GetMessageText(ctx, authz.GetCtxData(ctx).OrgID, domain.VerifyEmailMessageType, req.Language)
|
||||
if err != nil {
|
||||
@ -68,6 +118,16 @@ func (s *Server) GetCustomVerifyEmailMessageText(ctx context.Context, req *mgmt_
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetDefaultVerifyEmailMessageText(ctx context.Context, req *mgmt_pb.GetDefaultVerifyEmailMessageTextRequest) (*mgmt_pb.GetDefaultVerifyEmailMessageTextResponse, error) {
|
||||
msg, err := s.org.GetDefaultMessageText(ctx, domain.VerifyEmailMessageType, req.Language)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.GetDefaultVerifyEmailMessageTextResponse{
|
||||
CustomText: text_grpc.ModelCustomMsgTextToPb(msg),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) SetCustomVerifyEmailMessageText(ctx context.Context, req *mgmt_pb.SetCustomVerifyEmailMessageTextRequest) (*mgmt_pb.SetCustomVerifyEmailMessageTextResponse, error) {
|
||||
result, err := s.command.SetOrgMessageText(ctx, authz.GetCtxData(ctx).OrgID, SetVerifyEmailCustomTextToDomain(req))
|
||||
if err != nil {
|
||||
@ -82,6 +142,20 @@ func (s *Server) SetCustomVerifyEmailMessageText(ctx context.Context, req *mgmt_
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) ResetCustomVerifyEmailMessageTextToDefault(ctx context.Context, req *mgmt_pb.ResetCustomVerifyEmailMessageTextToDefaultRequest) (*mgmt_pb.ResetCustomVerifyEmailMessageTextToDefaultResponse, error) {
|
||||
result, err := s.command.RemoveOrgMessageTexts(ctx, authz.GetCtxData(ctx).OrgID, domain.VerifyEmailMessageType, language.Make(req.Language))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ResetCustomVerifyEmailMessageTextToDefaultResponse{
|
||||
Details: object.ChangeToDetailsPb(
|
||||
result.Sequence,
|
||||
result.EventDate,
|
||||
result.ResourceOwner,
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetCustomVerifyPhoneMessageText(ctx context.Context, req *mgmt_pb.GetCustomVerifyPhoneMessageTextRequest) (*mgmt_pb.GetCustomVerifyPhoneMessageTextResponse, error) {
|
||||
msg, err := s.org.GetMessageText(ctx, authz.GetCtxData(ctx).OrgID, domain.VerifyPhoneMessageType, req.Language)
|
||||
if err != nil {
|
||||
@ -92,6 +166,16 @@ func (s *Server) GetCustomVerifyPhoneMessageText(ctx context.Context, req *mgmt_
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetDefaultVerifyPhoneMessageText(ctx context.Context, req *mgmt_pb.GetDefaultVerifyPhoneMessageTextRequest) (*mgmt_pb.GetDefaultVerifyPhoneMessageTextResponse, error) {
|
||||
msg, err := s.org.GetDefaultMessageText(ctx, domain.VerifyPhoneMessageType, req.Language)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.GetDefaultVerifyPhoneMessageTextResponse{
|
||||
CustomText: text_grpc.ModelCustomMsgTextToPb(msg),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) SetCustomVerifyPhoneMessageText(ctx context.Context, req *mgmt_pb.SetCustomVerifyPhoneMessageTextRequest) (*mgmt_pb.SetCustomVerifyPhoneMessageTextResponse, error) {
|
||||
result, err := s.command.SetOrgMessageText(ctx, authz.GetCtxData(ctx).OrgID, SetVerifyPhoneCustomTextToDomain(req))
|
||||
if err != nil {
|
||||
@ -106,6 +190,20 @@ func (s *Server) SetCustomVerifyPhoneMessageText(ctx context.Context, req *mgmt_
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) ResetCustomVerifyPhoneMessageTextToDefault(ctx context.Context, req *mgmt_pb.ResetCustomVerifyPhoneMessageTextToDefaultRequest) (*mgmt_pb.ResetCustomVerifyPhoneMessageTextToDefaultResponse, error) {
|
||||
result, err := s.command.RemoveOrgMessageTexts(ctx, authz.GetCtxData(ctx).OrgID, domain.VerifyPhoneMessageType, language.Make(req.Language))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ResetCustomVerifyPhoneMessageTextToDefaultResponse{
|
||||
Details: object.ChangeToDetailsPb(
|
||||
result.Sequence,
|
||||
result.EventDate,
|
||||
result.ResourceOwner,
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetCustomDomainClaimedMessageText(ctx context.Context, req *mgmt_pb.GetCustomDomainClaimedMessageTextRequest) (*mgmt_pb.GetCustomDomainClaimedMessageTextResponse, error) {
|
||||
msg, err := s.org.GetMessageText(ctx, authz.GetCtxData(ctx).OrgID, domain.DomainClaimedMessageType, req.Language)
|
||||
if err != nil {
|
||||
@ -116,6 +214,16 @@ func (s *Server) GetCustomDomainClaimedMessageText(ctx context.Context, req *mgm
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetDefaultDomainClaimedMessageText(ctx context.Context, req *mgmt_pb.GetDefaultDomainClaimedMessageTextRequest) (*mgmt_pb.GetDefaultDomainClaimedMessageTextResponse, error) {
|
||||
msg, err := s.org.GetDefaultMessageText(ctx, domain.DomainClaimedMessageType, req.Language)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.GetDefaultDomainClaimedMessageTextResponse{
|
||||
CustomText: text_grpc.ModelCustomMsgTextToPb(msg),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) SetCustomDomainClaimedMessageText(ctx context.Context, req *mgmt_pb.SetCustomDomainClaimedMessageTextRequest) (*mgmt_pb.SetCustomDomainClaimedMessageTextResponse, error) {
|
||||
result, err := s.command.SetOrgMessageText(ctx, authz.GetCtxData(ctx).OrgID, SetDomainClaimedCustomTextToDomain(req))
|
||||
if err != nil {
|
||||
@ -129,3 +237,17 @@ func (s *Server) SetCustomDomainClaimedMessageText(ctx context.Context, req *mgm
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Server) ResetCustomDomainClaimedMessageTextToDefault(ctx context.Context, req *mgmt_pb.ResetCustomDomainClaimedMessageTextToDefaultRequest) (*mgmt_pb.ResetCustomDomainClaimedMessageTextToDefaultResponse, error) {
|
||||
result, err := s.command.RemoveOrgMessageTexts(ctx, authz.GetCtxData(ctx).OrgID, domain.DomainClaimedMessageType, language.Make(req.Language))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ResetCustomDomainClaimedMessageTextToDefaultResponse{
|
||||
Details: object.ChangeToDetailsPb(
|
||||
result.Sequence,
|
||||
result.EventDate,
|
||||
result.ResourceOwner,
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
@ -93,23 +93,30 @@ func (c *Commands) setOrgMessageText(ctx context.Context, orgAgg *eventstore.Agg
|
||||
return events, existingMessageText, nil
|
||||
}
|
||||
|
||||
func (c *Commands) RemoveOrgMessageTexts(ctx context.Context, resourceOwner, messageTextType string, lang language.Tag) error {
|
||||
func (c *Commands) RemoveOrgMessageTexts(ctx context.Context, resourceOwner, messageTextType string, lang language.Tag) (*domain.ObjectDetails, error) {
|
||||
if resourceOwner == "" {
|
||||
return caos_errs.ThrowInvalidArgument(nil, "Org-3mfsf", "Errors.ResourceOwnerMissing")
|
||||
return nil, caos_errs.ThrowInvalidArgument(nil, "Org-3mfsf", "Errors.ResourceOwnerMissing")
|
||||
}
|
||||
if messageTextType == "" || lang == language.Und {
|
||||
return caos_errs.ThrowInvalidArgument(nil, "Org-j59f", "Errors.CustomMessageText.Invalid")
|
||||
return nil, caos_errs.ThrowInvalidArgument(nil, "Org-j59f", "Errors.CustomMessageText.Invalid")
|
||||
}
|
||||
customText, err := c.orgCustomMessageTextWriteModelByID(ctx, resourceOwner, messageTextType, lang)
|
||||
if err != nil {
|
||||
return err
|
||||
return nil, err
|
||||
}
|
||||
if customText.State == domain.PolicyStateUnspecified || customText.State == domain.PolicyStateRemoved {
|
||||
return caos_errs.ThrowNotFound(nil, "Org-3b8Jf", "Errors.CustomMessageText.NotFound")
|
||||
return nil, caos_errs.ThrowNotFound(nil, "Org-3b8Jf", "Errors.CustomMessageText.NotFound")
|
||||
}
|
||||
orgAgg := OrgAggregateFromWriteModel(&customText.WriteModel)
|
||||
_, err = c.eventstore.PushEvents(ctx, org.NewCustomTextTemplateRemovedEvent(ctx, orgAgg, messageTextType, lang))
|
||||
return err
|
||||
pushedEvents, err := c.eventstore.PushEvents(ctx, org.NewCustomTextTemplateRemovedEvent(ctx, orgAgg, messageTextType, lang))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = AppendAndReduce(customText, pushedEvents...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return writeModelToObjectDetails(&customText.WriteModel), nil
|
||||
}
|
||||
|
||||
func (c *Commands) removeOrgMessageTextsIfExists(ctx context.Context, orgID string) ([]eventstore.EventPusher, error) {
|
||||
|
@ -502,7 +502,7 @@ func TestCommandSide_RemoveCustomMessageText(t *testing.T) {
|
||||
r := &Commands{
|
||||
eventstore: tt.fields.eventstore,
|
||||
}
|
||||
err := r.RemoveOrgMessageTexts(tt.args.ctx, tt.args.resourceOwner, tt.args.mailTextType, tt.args.lang)
|
||||
_, err := r.RemoveOrgMessageTexts(tt.args.ctx, tt.args.resourceOwner, tt.args.mailTextType, tt.args.lang)
|
||||
if tt.res.err == nil {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
@ -2891,7 +2891,6 @@ message UpdatePasswordLockoutPolicyResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetDefaultInitMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -2920,7 +2919,6 @@ message SetDefaultInitMessageTextResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetDefaultPasswordResetMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -2949,7 +2947,6 @@ message SetDefaultPasswordResetMessageTextResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetDefaultVerifyEmailMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -2978,7 +2975,6 @@ message SetDefaultVerifyEmailMessageTextResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetDefaultVerifyPhoneMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -3007,7 +3003,6 @@ message SetDefaultVerifyPhoneMessageTextResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetDefaultDomainClaimedMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
@ -2085,7 +2085,18 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.read";
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
//Returns the default text for initial message
|
||||
rpc GetDefaultInitMessageText(GetDefaultInitMessageTextRequest) returns (GetDefaultInitMessageTextResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/text/default/message/init/{language}";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
@ -2100,7 +2111,7 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.write";
|
||||
permission: "policy.write";
|
||||
feature: "custom_text"
|
||||
};
|
||||
}
|
||||
@ -2123,7 +2134,18 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.read";
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
//Returns the default text for password reset message
|
||||
rpc GetDefaultPasswordResetMessageText(GetDefaultPasswordResetMessageTextRequest) returns (GetDefaultPasswordResetMessageTextResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/text/default/message/passwordreset/{language}";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
@ -2138,12 +2160,12 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.write";
|
||||
permission: "policy.write";
|
||||
feature: "custom_text"
|
||||
};
|
||||
}
|
||||
|
||||
// Removes the custom init message text of the organisation
|
||||
// Removes the custom password reset message text of the organisation
|
||||
// The default text of the IAM will trigger after
|
||||
rpc ResetCustomPasswordResetMessageTextToDefault(ResetCustomPasswordResetMessageTextToDefaultRequest) returns (ResetCustomPasswordResetMessageTextToDefaultResponse) {
|
||||
option (google.api.http) = {
|
||||
@ -2162,7 +2184,18 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.read";
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
//Returns the default text for verify email message
|
||||
rpc GetDefaultVerifyEmailMessageText(GetDefaultVerifyEmailMessageTextRequest) returns (GetDefaultVerifyEmailMessageTextResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/text/default/message/verifyemail/{language}";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
@ -2177,12 +2210,12 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.write";
|
||||
permission: "policy.write";
|
||||
feature: "custom_text"
|
||||
};
|
||||
}
|
||||
|
||||
// Removes the custom init message text of the organisation
|
||||
// Removes the custom verify email message text of the organisation
|
||||
// The default text of the IAM will trigger after
|
||||
rpc ResetCustomVerifyEmailMessageTextToDefault(ResetCustomVerifyEmailMessageTextToDefaultRequest) returns (ResetCustomVerifyEmailMessageTextToDefaultResponse) {
|
||||
option (google.api.http) = {
|
||||
@ -2201,7 +2234,18 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.read";
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
//Returns the custom text for verify email message
|
||||
rpc GetDefaultVerifyPhoneMessageText(GetDefaultVerifyPhoneMessageTextRequest) returns (GetDefaultVerifyPhoneMessageTextResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/text/default/message/verifyphone/{language}";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
@ -2216,12 +2260,12 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.write";
|
||||
permission: "policy.write";
|
||||
feature: "custom_text"
|
||||
};
|
||||
}
|
||||
|
||||
// Removes the custom init message text of the organisation
|
||||
// Removes the custom verify phone text of the organisation
|
||||
// The default text of the IAM will trigger after
|
||||
rpc ResetCustomVerifyPhoneMessageTextToDefault(ResetCustomVerifyPhoneMessageTextToDefaultRequest) returns (ResetCustomVerifyPhoneMessageTextToDefaultResponse) {
|
||||
option (google.api.http) = {
|
||||
@ -2240,7 +2284,18 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.read";
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
//Returns the custom text for domain claimed message
|
||||
rpc GetDefaultDomainClaimedMessageText(GetDefaultDomainClaimedMessageTextRequest) returns (GetDefaultDomainClaimedMessageTextResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/text/default/message/domainclaimed/{language}";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "policy.read";
|
||||
};
|
||||
}
|
||||
|
||||
@ -2255,7 +2310,7 @@ service ManagementService {
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.policy.write";
|
||||
permission: "policy.write";
|
||||
feature: "custom_text"
|
||||
};
|
||||
}
|
||||
@ -4033,7 +4088,6 @@ message ResetLabelPolicyToDefaultResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetCustomInitMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4042,6 +4096,14 @@ message GetCustomInitMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message GetDefaultInitMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
message GetDefaultInitMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message SetCustomInitMessageTextRequest {
|
||||
string language = 1 [
|
||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||
@ -4062,7 +4124,6 @@ message SetCustomInitMessageTextResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message ResetCustomInitMessageTextToDefaultRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4071,7 +4132,6 @@ message ResetCustomInitMessageTextToDefaultResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetCustomPasswordResetMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4080,6 +4140,14 @@ message GetCustomPasswordResetMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message GetDefaultPasswordResetMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
message GetDefaultPasswordResetMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message SetCustomPasswordResetMessageTextRequest {
|
||||
string language = 1 [
|
||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||
@ -4100,7 +4168,6 @@ message SetCustomPasswordResetMessageTextResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message ResetCustomPasswordResetMessageTextToDefaultRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4109,7 +4176,6 @@ message ResetCustomPasswordResetMessageTextToDefaultResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetCustomVerifyEmailMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4118,6 +4184,14 @@ message GetCustomVerifyEmailMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message GetDefaultVerifyEmailMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
message GetDefaultVerifyEmailMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message SetCustomVerifyEmailMessageTextRequest {
|
||||
string language = 1 [
|
||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||
@ -4138,7 +4212,6 @@ message SetCustomVerifyEmailMessageTextResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message ResetCustomVerifyEmailMessageTextToDefaultRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4147,7 +4220,6 @@ message ResetCustomVerifyEmailMessageTextToDefaultResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetCustomVerifyPhoneMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4156,6 +4228,14 @@ message GetCustomVerifyPhoneMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message GetDefaultVerifyPhoneMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
message GetDefaultVerifyPhoneMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message SetCustomVerifyPhoneMessageTextRequest {
|
||||
string language = 1 [
|
||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||
@ -4176,7 +4256,6 @@ message SetCustomVerifyPhoneMessageTextResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message ResetCustomVerifyPhoneMessageTextToDefaultRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4185,7 +4264,6 @@ message ResetCustomVerifyPhoneMessageTextToDefaultResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetCustomDomainClaimedMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
@ -4194,6 +4272,14 @@ message GetCustomDomainClaimedMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message GetDefaultDomainClaimedMessageTextRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
message GetDefaultDomainClaimedMessageTextResponse {
|
||||
zitadel.text.v1.MessageCustomText custom_text = 1;
|
||||
}
|
||||
|
||||
message SetCustomDomainClaimedMessageTextRequest {
|
||||
string language = 1 [
|
||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||
|
Loading…
x
Reference in New Issue
Block a user