mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-06 19:36:41 +00:00
feat: http provider signing key addition (#10641)
# Which Problems Are Solved
HTTP Request to HTTP providers for Email or SMS are not signed.
# How the Problems Are Solved
Add a Signing Key to the HTTP Provider resources, which is then used to
generate a header to sign the payload.
# Additional Changes
Additional tests for query side of the SMTP provider.
# Additional Context
Closes #10067
---------
Co-authored-by: Marco A. <marco@zitadel.com>
(cherry picked from commit 8909b9a2a6)
This commit is contained in:
committed by
Livio Spring
parent
d2d94ea088
commit
1a7cd6e1af
@@ -56,7 +56,8 @@ func SMSConfigToPb(config *query.SMSConfig) settings_pb.SMSConfig {
|
||||
func HTTPConfigToPb(http *query.HTTP) *settings_pb.SMSProvider_Http {
|
||||
return &settings_pb.SMSProvider_Http{
|
||||
Http: &settings_pb.HTTPConfig{
|
||||
Endpoint: http.Endpoint,
|
||||
Endpoint: http.Endpoint,
|
||||
SigningKey: http.SigningKey,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -73,6 +74,8 @@ func TwilioConfigToPb(twilio *query.Twilio) *settings_pb.SMSProvider_Twilio {
|
||||
|
||||
func smsStateToPb(state domain.SMSConfigState) settings_pb.SMSProviderConfigState {
|
||||
switch state {
|
||||
case domain.SMSConfigStateUnspecified, domain.SMSConfigStateRemoved:
|
||||
return settings_pb.SMSProviderConfigState_SMS_PROVIDER_CONFIG_INACTIVE
|
||||
case domain.SMSConfigStateInactive:
|
||||
return settings_pb.SMSProviderConfigState_SMS_PROVIDER_CONFIG_INACTIVE
|
||||
case domain.SMSConfigStateActive:
|
||||
@@ -113,10 +116,13 @@ func addSMSConfigHTTPToConfig(ctx context.Context, req *admin_pb.AddSMSProviderH
|
||||
}
|
||||
|
||||
func updateSMSConfigHTTPToConfig(ctx context.Context, req *admin_pb.UpdateSMSProviderHTTPRequest) *command.ChangeSMSHTTP {
|
||||
// TODO handle expiration, currently only immediate expiration is supported
|
||||
expirationSigningKey := req.GetExpirationSigningKey() != nil
|
||||
return &command.ChangeSMSHTTP{
|
||||
ResourceOwner: authz.GetInstance(ctx).InstanceID(),
|
||||
ID: req.Id,
|
||||
Description: gu.Ptr(req.Description),
|
||||
Endpoint: gu.Ptr(req.Endpoint),
|
||||
ResourceOwner: authz.GetInstance(ctx).InstanceID(),
|
||||
ID: req.Id,
|
||||
Description: gu.Ptr(req.Description),
|
||||
Endpoint: gu.Ptr(req.Endpoint),
|
||||
ExpirationSigningKey: expirationSigningKey,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user