Conversation
…ller + new with_webhooks example Closes #546 Three changes to eliminate the silent-no-op trap for first-time DecisioningPlatform adopters: 1. docs/handler-authoring.md: adds a ## Webhooks section (sender constructors table, sender-vs-supervisor explanation, wiring snippet, link to migration guide) so the doc anchor used in example comments actually exists. 2. examples/hello_seller.py: expands the bare "wire webhook_sender= in production" note into a full three-constructor menu with import lines and a link to docs/handler-authoring.md#webhooks. 3. examples/hello_seller_with_webhooks.py: new ~40-LOC example showing the canonical bearer-token + InMemoryWebhookDeliverySupervisor wiring pattern — the first copy-paste-ready path to production webhooks. The boot-time fail-fast (validate_webhook_sender_for_platform) was already shipping as a hard raise; this PR closes the documentation gap that let adopters reach that error without knowing how to resolve it. https://claude.ai/code/session_01Ay2SJvRpBg8EP9nG9DgQMy
…OOK_BEARER_TOKEN Pre-PR review blockers: - from_jwk takes a JWK dict; kid/alg/adcp_use live inside the dict, not as separate kwargs. Fix the doc table and hello_seller.py comment accordingly. - hello_seller_with_webhooks.py now warns (instead of silently continuing) when WEBHOOK_BEARER_TOKEN is unset, so developers discover the dev-fixture default rather than running a production server with it. https://claude.ai/code/session_01Ay2SJvRpBg8EP9nG9DgQMy
de6d17a to
ba38f21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #546
Summary
Three non-breaking documentation and examples changes that together close the silent-no-op trap for first-time
DecisioningPlatformadopters:docs/handler-authoring.md: adds a new## Webhookssection covering the three sender constructors (comparison table), the sender-vs-supervisor distinction, a wiring snippet, and cross-links to the migration guide and the new example. The section makesdocs/handler-authoring.md#webhooksa live anchor (previously the issue proposed linking there but the section didn't exist).examples/hello_seller.py: expands the three-line "wire webhook_sender= in production" note into a full three-constructor menu with import lines, a JWK field reminder, and a link todocs/handler-authoring.md#webhooks.examples/hello_seller_with_webhooks.py(new): ~57-LOC runnable wiring example usingWebhookSender.from_bearer_token+InMemoryWebhookDeliverySupervisor, the first copy-paste-ready path from bare handler to production-grade webhooks.Note: the boot-time fail-fast (
validate_webhook_sender_for_platform) was already shipping as a hardAdcpErrorraise — this PR closes the documentation gap that let adopters reach that error without knowing how to resolve it.What was tested
pytest(3866 passed, 32 skipped, 1 pre-existing network test failure onsigning/test_ip_pinned_transport.py::test_real_tls_handshake_still_validates_hostname— unrelated to this PR, pre-exists onmain)mypy src/adcp/— 878 errors, identical tomain(no source files changed)ruff check src/— all checks passedPre-PR review
Two expert passes were run (blockers fixed before final sign-off):
dev-fixture-tokenfallback) resolved withwarnings.warn; 1 nit noted in PR bodyfrom_jwkkwargs mismatch) resolved;kid/alg/adcp_usenow correctly documented as JWK dict fieldsNits surfaced (not fixed):
examples/README.mddoes not listhello_seller_with_webhooks.py— consistent with how otherhello_seller_*.pyvariants are handled (none appear to be individually listed); can be addressed in a follow-on README update pass.Session: https://claude.ai/code/session_01Ay2SJvRpBg8EP9nG9DgQMy
Generated by Claude Code