Allow specifying extra webhooks with egress requests (#3597)

This commit is contained in:
Benjamin Pracht
2025-04-09 16:20:21 -07:00
committed by GitHub
parent 7e16106a0e
commit e5cbb22777
9 changed files with 126 additions and 77 deletions
+3 -5
View File
@@ -159,15 +159,13 @@ func createKeyProvider(conf *config.Config) (auth.KeyProvider, error) {
func createWebhookNotifier(conf *config.Config, provider auth.KeyProvider) (webhook.QueuedNotifier, error) {
wc := conf.WebHook
if len(wc.URLs) == 0 {
return nil, nil
}
secret := provider.GetSecret(wc.APIKey)
if secret == "" {
if secret == "" && len(wc.URLs) > 0 {
return nil, ErrWebHookMissingAPIKey
}
return webhook.NewDefaultNotifier(wc, secret), nil
return webhook.NewDefaultNotifier(wc, provider)
}
func createRedisClient(conf *config.Config) (redis.UniversalClient, error) {
+3 -5
View File
@@ -219,15 +219,13 @@ func createKeyProvider(conf *config.Config) (auth.KeyProvider, error) {
func createWebhookNotifier(conf *config.Config, provider auth.KeyProvider) (webhook.QueuedNotifier, error) {
wc := conf.WebHook
if len(wc.URLs) == 0 {
return nil, nil
}
secret := provider.GetSecret(wc.APIKey)
if secret == "" {
if secret == "" && len(wc.URLs) > 0 {
return nil, ErrWebHookMissingAPIKey
}
return webhook.NewDefaultNotifier(wc, secret), nil
return webhook.NewDefaultNotifier(wc, provider)
}
func createRedisClient(conf *config.Config) (redis.UniversalClient, error) {