Skip to content

feat: flatten payment_required_header to kwargs; delete PaymentRequiredHeaderInput - #36

Merged
vvillait88 merged 1 commit into
mainfrom
feat/303d-payment-wwwauth-flatten
May 14, 2026
Merged

feat: flatten payment_required_header to kwargs; delete PaymentRequiredHeaderInput#36
vvillait88 merged 1 commit into
mainfrom
feat/303d-payment-wwwauth-flatten

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

Drops the wrapper for payment_required_header — the x402 PAYMENT-REQUIRED header builder.

Before After
payment_required_header(PaymentRequiredHeaderInput(x402_version=..., accepts=..., resource=...)) payment_required_header(*, x402_version, accepts, resource=None)

Also drops the wrapper-bridge respond_402 carried since #32 — its public x402: dict kwarg now flows straight to payment_required_header(**x402) without re-wrapping.

Internal callers updated

  • challenge/respond_402.py
  • payment/headers.py (build_payment_headers x402 branch)
  • discovery/probe.py (discovery probe PAYMENT-REQUIRED header)

Deleted from exports

PaymentRequiredHeaderInput.

Test plan

  • uv run pytest tests/ — 1031 passed / 3 skipped, 95.04% coverage
  • uv run ty check agentscore_commerce/ — clean
  • uv run ruff check . && uv run ruff format . — clean
  • uv run vulture agentscore_commerce/ --min-confidence 80 — only the known string-cast / Protocol-param false positives remain (unchanged from main)

…erInput

Drops the wrapper for the x402 PAYMENT-REQUIRED header builder:

- payment_required_header(PaymentRequiredHeaderInput(x402_version=..., accepts=..., resource=...))
    → payment_required_header(*, x402_version, accepts, resource=None)

Internal callers updated:
- challenge/respond_402.py — drops the wrapper-bridge introduced in 303a;
  respond_402's public `x402: dict` kwarg now flows straight through.
- payment/headers.py — build_payment_headers' x402 branch
- discovery/probe.py — discovery probe's PAYMENT-REQUIRED header

Deleted from public exports: PaymentRequiredHeaderInput.

Tests: 1031 passed / 3 skipped, 95.04% coverage. ty + ruff clean.
Vulture: only the known false positives remain (string-form cast + Protocol
method param in untouched modules).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit 4396e9b into main May 14, 2026
7 checks passed
@vvillait88
vvillait88 deleted the feat/303d-payment-wwwauth-flatten branch May 14, 2026 18:39
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