Skip to content

Add GET /my_packages/:name/webhook status endpoint - #618

Open
AMDphreak wants to merge 1 commit into
dlang:masterfrom
AMDphreak:feature/webhook-status-endpoint
Open

Add GET /my_packages/:name/webhook status endpoint#618
AMDphreak wants to merge 1 commit into
dlang:masterfrom
AMDphreak:feature/webhook-status-endpoint

Conversation

@AMDphreak

Copy link
Copy Markdown

Summary

  • Add authenticated GET /my_packages/:packname/webhook returning JSON {package,configured} without regenerating the secret
  • Add hasPackageSecret on the DB/registry layers
  • Document the endpoint in api-docs/http-update.md

Fixes #617

Motivation

Owner tooling (e.g. dub-publish) needs to check whether webhooks are enabled. The only existing owner HTTP actions are regen_secret (destructive rotate) and unset_secret. Scraping the My packages HTML works but is fragile; calling regen_secret to check status invalidates forge webhook URLs.

Plaintext secrets remain one-shot after regenerate — this endpoint only exposes a boolean.

Test plan

  • As package admin, GET /my_packages/:name/webhook with session cookie returns configured:false before enable
  • After Enable Webhooks / regen_secret, same GET returns configured:true
  • Non-admin / unauthenticated requests are rejected
  • Response never includes the plaintext secret

Package admins can query GET /my_packages/:name/webhook for JSON {configured:bool}. Tooling previously had to scrape HTML or call regen_secret, which rotates the secret and breaks forge webhooks.

Co-authored-by: Cursor <cursoragent@cursor.com>
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 non-destructive webhook status endpoint for package admins

1 participant