mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-02 20:32:19 +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:
@@ -0,0 +1,27 @@
|
||||
package setup
|
||||
|
||||
import (
|
||||
"context"
|
||||
_ "embed"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/database"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed 62.sql
|
||||
addHTTPProviderSigningKey string
|
||||
)
|
||||
|
||||
type HTTPProviderAddSigningKey struct {
|
||||
dbClient *database.DB
|
||||
}
|
||||
|
||||
func (mig *HTTPProviderAddSigningKey) Execute(ctx context.Context, _ eventstore.Event) error {
|
||||
_, err := mig.dbClient.ExecContext(ctx, addHTTPProviderSigningKey)
|
||||
return err
|
||||
}
|
||||
|
||||
func (mig *HTTPProviderAddSigningKey) String() string {
|
||||
return "62_http_provider_add_signing_key"
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE IF EXISTS projections.sms_configs3_http ADD COLUMN IF NOT EXISTS signing_key TEXT NULL;
|
||||
ALTER TABLE IF EXISTS projections.smtp_configs5_http ADD COLUMN IF NOT EXISTS signing_key TEXT NULL;
|
||||
@@ -158,6 +158,7 @@ type Steps struct {
|
||||
s59SetupWebkeys *SetupWebkeys
|
||||
s60GenerateSystemID *GenerateSystemID
|
||||
s61IDPTemplate6SAMLSignatureAlgorithm *IDPTemplate6SAMLSignatureAlgorithm
|
||||
s62HTTPProviderAddSigningKey *HTTPProviderAddSigningKey
|
||||
}
|
||||
|
||||
func MustNewSteps(v *viper.Viper) *Steps {
|
||||
|
||||
@@ -219,6 +219,7 @@ func Setup(ctx context.Context, config *Config, steps *Steps, masterKey string)
|
||||
steps.s58ReplaceLoginNames3View = &ReplaceLoginNames3View{dbClient: dbClient}
|
||||
steps.s60GenerateSystemID = &GenerateSystemID{eventstore: eventstoreClient}
|
||||
steps.s61IDPTemplate6SAMLSignatureAlgorithm = &IDPTemplate6SAMLSignatureAlgorithm{dbClient: dbClient}
|
||||
steps.s62HTTPProviderAddSigningKey = &HTTPProviderAddSigningKey{dbClient: dbClient}
|
||||
|
||||
err = projection.Create(ctx, dbClient, eventstoreClient, config.Projections, nil, nil, nil)
|
||||
logging.OnError(err).Fatal("unable to start projections")
|
||||
@@ -268,6 +269,7 @@ func Setup(ctx context.Context, config *Config, steps *Steps, masterKey string)
|
||||
steps.s58ReplaceLoginNames3View,
|
||||
steps.s60GenerateSystemID,
|
||||
steps.s61IDPTemplate6SAMLSignatureAlgorithm,
|
||||
steps.s62HTTPProviderAddSigningKey,
|
||||
} {
|
||||
setupErr = executeMigration(ctx, eventstoreClient, step, "migration failed")
|
||||
if setupErr != nil {
|
||||
@@ -471,6 +473,8 @@ func startCommandsQueries(
|
||||
keys.OIDC,
|
||||
keys.SAML,
|
||||
keys.Target,
|
||||
keys.SMS,
|
||||
keys.SMTP,
|
||||
config.InternalAuthZ.RolePermissionMappings,
|
||||
sessionTokenVerifier,
|
||||
func(q *query.Queries) domain.PermissionCheck {
|
||||
|
||||
Reference in New Issue
Block a user