Skip to content

Let a bot's API key manage its own webhooks; external_ref on account events - #20

Merged
iamfarhad merged 1 commit into
mainfrom
feat/webhooks-api-keys
Oct 29, 2026
Merged

iamfarhad merged 1 commit into
mainfrom
feat/webhooks-api-keys

Conversation

@iamfarhad

Copy link
Copy Markdown
Owner

A sales bot only holds an API key, so it had no way to register the URL where the panel should push its accounts' events.

  • New webhooks permission: an API key with it can manage webhooks in its own namespace. That is the same namespace its accounts' events carry, so the bot receives only events for accounts it created. The reseller rules apply: account.* and reseller.* events only, and the SSRF guard is always on.
  • external_ref on account events: the bot can match an event to its order without a lookup.
  • Docs and UI: OpenAPI and the API Keys page now include the permission.
  • Tests: a new integration test covers a key without the permission (403), creating a webhook in the key's own namespace, refused infrastructure events and private targets, isolation from staff and other keys' webhooks, and secret rotation. The full suite passes against TimescaleDB and Redis.

🤖 Generated with Claude Code

…unt events

A sales bot only holds an API key, so it could not register where the panel
should push its accounts' events. A key with the new 'webhooks' permission can
now manage webhooks in its own namespace - the namespace its accounts' events
carry - under the reseller rules (account.*/reseller.* only, SSRF guard always
on). Account events also carry external_ref so the bot can match one to its
order without a lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iamfarhad
iamfarhad merged commit e9950b8 into main Oct 29, 2026
6 checks passed
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.

1 participant