Skip to content

Commit de6d17a

Browse files
bokelleyclaude
andcommitted
fix(examples,docs): from_standard_webhooks_secret requires key_id kwarg
The hello_seller inline comment and the handler-authoring webhooks table both showed ``from_standard_webhooks_secret(secret)`` without the ``key_id=`` kwarg, which is required by the actual constructor signature. Adopters copy-pasting either snippet would hit a ``TypeError: missing 1 required keyword-only argument: 'key_id'``. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 53810da commit de6d17a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

docs/handler-authoring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ Pick one per `WebhookSender` instance. All three share the same
10551055
|---|---|---|
10561056
| `WebhookSender.from_jwk(jwk)` | RFC 9421 HTTP-signature | AdCP-conformant buyers; spec baseline (`kid`/`alg`/`adcp_use` live in the JWK dict) |
10571057
| `WebhookSender.from_bearer_token(token)` | `Authorization: Bearer` | Simplest; no key management; requires TLS |
1058-
| `WebhookSender.from_standard_webhooks_secret(secret)` | Standard Webhooks v1 | Svix / Resend / standardwebhooks.com receivers |
1058+
| `WebhookSender.from_standard_webhooks_secret(secret, key_id=...)` | Standard Webhooks v1 | Svix / Resend / standardwebhooks.com receivers |
10591059

10601060
### Sender vs. supervisor
10611061

examples/hello_seller.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ def _get_packages(req: Any) -> list[dict[str, Any]]:
352352
# sender = WebhookSender.from_bearer_token(os.environ["WEBHOOK_BEARER_TOKEN"])
353353
#
354354
# # Standard Webhooks v1 — Svix / Resend / standardwebhooks.com interop:
355-
# sender = WebhookSender.from_standard_webhooks_secret(os.environ["WHSEC"])
355+
# sender = WebhookSender.from_standard_webhooks_secret(
356+
# os.environ["WHSEC"], key_id="whsec_v1",
357+
# )
356358
#
357359
# supervisor = InMemoryWebhookDeliverySupervisor(sender=sender)
358360
# serve(HelloSeller(), name="hello-seller", webhook_supervisor=supervisor)

0 commit comments

Comments
 (0)