Skip to content

feat: add bearer/basic auth support to webhook notifications (#2369) - #3802

Open
jannikbx wants to merge 6 commits into
bluewave-labs:developfrom
jannikbx:fix/webhook-auth
Open

feat: add bearer/basic auth support to webhook notifications (#2369)#3802
jannikbx wants to merge 6 commits into
bluewave-labs:developfrom
jannikbx:fix/webhook-auth

Conversation

@jannikbx

Copy link
Copy Markdown

Fixes #2369 - Adds optional authentication to webhook notifications.

Changes

  • Added WebhookAuthType (none | basic | bearer) and auth fields to Notification interface
  • Added getAuthHeaders() to WebhookProvider for Basic Auth (base64) and Bearer token
  • Integrated auth headers into sendMessage() and sendTestAlert()
  • Added 4 test cases for auth behavior

How it works

Basic Auth: Notification gets webhookAuthType: "basic", webhookAuthUsername, webhookAuthPassword → sends Authorization: Basic <base64>
Bearer: Notification gets webhookAuthType: "bearer", webhookAuthToken → sends Authorization: Bearer <token>
None: No auth fields → no Authorization header (unchanged behavior)

Add optional authentication to webhook notifications:
- webhookAuthType field ('none' | 'basic' | 'bearer')
- Basic Auth: base64-encoded username:password header
- Bearer Token: Authorization header with token

Closes bluewave-labs#2369
@jannikbx

jannikbx commented Aug 1, 2026

Copy link
Copy Markdown
Author

Hey @smz202000, YoinkingFishy mentioned that #3785 and my PR (#3802) are both implementing #2369, so we should probably coordinate before either gets merged.

Quick status check from my side: my PR has all CI checks green and no open review comments so far. Yours still has a few open items – the changes ajhollid requested, and the format checks are still failing.

How do you want to handle this? Either you finish those up on #3785 and we align the field names so yours can get merged, or I adapt my PR to match your naming and add the client-side part. I'm fine with either – just don't want us to block each other.

Let me know what works for you!

OpenClaw added 3 commits August 15, 2026 23:54
…auth

Completes bearer/basic auth support for webhook notifications (Closes bluewave-labs#2369)

Signed-off-by: OpenClaw <openclaw@bluewavelabs.io>
…refactor)

Signed-off-by: OpenClaw <openclaw@bluewavelabs.io>
Signed-off-by: OpenClaw <openclaw@bluewavelabs.io>
@jannikbx

jannikbx commented Aug 16, 2026

Copy link
Copy Markdown
Author

Hi maintainers! This PR is now complete and ready for review. It implements bearer/basic auth for webhook notifications (#2369).

What's included:

  • Server provider (webhook.ts): getAuthHeaders() with switch/case for none / basic / bearer, applied to both sendMessage() and sendTestAlert()
  • Persistence (notification.model.ts): 4 new schema fields (webhookAuthType with enum + default none, username, password, token)
  • Server validation (notificationValidation.ts): conditional validation via superRefinebasic requires username + password, bearer requires token
  • Client UI (create/index.tsx): auth-type selector (none/basic/bearer) with conditional fields, plus updated types, form defaults, client validation, and i18n strings

Happy to adjust based on feedback. Thanks!

…omplete

# Conflicts:
#	server/src/domain/notifications/notification.model.ts
#	server/src/domain/notifications/notification.type.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bearer/basic auth option to webhooks

1 participant