mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-26 22:38:45 +00:00
Merge commit from fork
* Add DenyLists parsing * Remove unneeded returned error * Plug global denylist into Command * app creation: apply denylist to backchannel logout URI * Inject denylist to backchannel logout worker * webhook config: validate against blocked URLs * Add notificationsWebhook denylist target * command: Add SMTP endpoint validation against blocklist * command: Add SMS endpoint validation against blocklist * Validate webhook endpoint against denylist on channel notification * Remove unused tests * handle deprecated denylists * remove unintended denylist entry in deprecated list * use single http client * fix tests * update comments * fixes * cleanup * address comments * fix merge --------- Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
@@ -3,6 +3,7 @@ package notification
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
@@ -40,6 +41,7 @@ func Register(
|
||||
fileSystemPath string,
|
||||
userEncryption, smtpEncryption, smsEncryption crypto.EncryptionAlgorithm,
|
||||
queue *queue.Queue,
|
||||
httpClient *http.Client,
|
||||
) {
|
||||
if !notificationWorkerConfig.LegacyEnabled {
|
||||
queue.ShouldStart()
|
||||
@@ -48,7 +50,7 @@ func Register(
|
||||
// make sure the slice does not contain old values
|
||||
projections = nil
|
||||
|
||||
q := handlers.NewNotificationQueries(queries, es, externalDomain, externalPort, externalSecure, fileSystemPath, userEncryption, smtpEncryption, smsEncryption)
|
||||
q := handlers.NewNotificationQueries(queries, es, externalDomain, externalPort, externalSecure, fileSystemPath, userEncryption, smtpEncryption, smsEncryption, httpClient)
|
||||
c := newChannels(q)
|
||||
projections = append(projections, handlers.NewUserNotifier(ctx, projection.ApplyCustomConfig(userHandlerCustomConfig), commands, q, c, otpEmailTmpl, notificationWorkerConfig, queue))
|
||||
projections = append(projections, handlers.NewQuotaNotifier(ctx, projection.ApplyCustomConfig(quotaHandlerCustomConfig), commands, q, c))
|
||||
@@ -59,7 +61,16 @@ func Register(
|
||||
queue,
|
||||
backChannelLogoutWorkerConfig.MaxAttempts,
|
||||
))
|
||||
queue.AddWorkers(ctx, handlers.NewBackChannelLogoutWorker(commands, q, es, queue, c, backChannelLogoutWorkerConfig, id.SonyFlakeGenerator()))
|
||||
queue.AddWorkers(ctx, handlers.NewBackChannelLogoutWorker(
|
||||
commands,
|
||||
q,
|
||||
es,
|
||||
queue,
|
||||
c,
|
||||
backChannelLogoutWorkerConfig,
|
||||
id.SonyFlakeGenerator(),
|
||||
httpClient,
|
||||
))
|
||||
if telemetryCfg.Enabled {
|
||||
projections = append(projections, handlers.NewTelemetryPusher(ctx, telemetryCfg, projection.ApplyCustomConfig(telemetryHandlerCustomConfig), commands, q, c))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user