Skip to content

Commit

Permalink
Warn about empty secret and skip the update in the webhook updater tool
Browse files Browse the repository at this point in the history
I was testing the webhook update locally and realized that it's too easy
to let the webhook update proceed with an empty secret. On the server
side we already have a similar check.
  • Loading branch information
jhrozek committed Apr 30, 2024
1 parent ef52a1d commit 2c5b5da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/server/app/webhook_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ func runCmdWebhookUpdate(cmd *cobra.Command, _ []string) error {
zerolog.Ctx(ctx).Err(err).Msg("cannot get webhook secret")
continue
}

if whSecret == "" {
zerolog.Ctx(ctx).Error().Msg("webhook secret is empty")
continue
}
updateErr = updateGithubWebhooks(ctx, ghCli, store, provider, webhookUrl.Host, whSecret)
} else {
updateErr = fmt.Errorf("provider type %s not supported", providerName)
Expand Down

0 comments on commit 2c5b5da

Please sign in to comment.