mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-22 21:08:47 +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. <[email protected]>
This commit is contained in:
@@ -217,9 +217,10 @@ func (e *SMTPConfigPasswordChangedEvent) UniqueConstraints() []*eventstore.Uniqu
|
||||
type SMTPConfigHTTPAddedEvent struct {
|
||||
*eventstore.BaseEvent `json:"-"`
|
||||
|
||||
ID string `json:"id,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Endpoint string `json:"endpoint,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Endpoint string `json:"endpoint,omitempty"`
|
||||
SigningKey *crypto.CryptoValue `json:"signingKey"`
|
||||
}
|
||||
|
||||
func NewSMTPConfigHTTPAddedEvent(
|
||||
@@ -227,6 +228,7 @@ func NewSMTPConfigHTTPAddedEvent(
|
||||
aggregate *eventstore.Aggregate,
|
||||
id, description string,
|
||||
endpoint string,
|
||||
signingKey *crypto.CryptoValue,
|
||||
) *SMTPConfigHTTPAddedEvent {
|
||||
return &SMTPConfigHTTPAddedEvent{
|
||||
BaseEvent: eventstore.NewBaseEventForPush(
|
||||
@@ -237,6 +239,7 @@ func NewSMTPConfigHTTPAddedEvent(
|
||||
ID: id,
|
||||
Description: description,
|
||||
Endpoint: endpoint,
|
||||
SigningKey: signingKey,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,9 +257,10 @@ func (e *SMTPConfigHTTPAddedEvent) UniqueConstraints() []*eventstore.UniqueConst
|
||||
|
||||
type SMTPConfigHTTPChangedEvent struct {
|
||||
*eventstore.BaseEvent `json:"-"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Endpoint *string `json:"endpoint,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Endpoint *string `json:"endpoint,omitempty"`
|
||||
SigningKey *crypto.CryptoValue `json:"signingKey,omitempty"`
|
||||
}
|
||||
|
||||
func (e *SMTPConfigHTTPChangedEvent) SetBaseEvent(event *eventstore.BaseEvent) {
|
||||
@@ -314,6 +318,12 @@ func ChangeSMTPConfigHTTPEndpoint(endpoint string) func(event *SMTPConfigHTTPCha
|
||||
}
|
||||
}
|
||||
|
||||
func ChangeSMTPConfigHTTPSigningKey(signingKey *crypto.CryptoValue) func(event *SMTPConfigHTTPChangedEvent) {
|
||||
return func(e *SMTPConfigHTTPChangedEvent) {
|
||||
e.SigningKey = signingKey
|
||||
}
|
||||
}
|
||||
|
||||
type SMTPConfigActivatedEvent struct {
|
||||
*eventstore.BaseEvent `json:"-"`
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user