refactor(identity, payment): flatten LoadUCPSigningKeyOptions + drop dead CreateX402ServerOptions - #39
Merged
Conversation
…e dead CreateX402ServerOptions Last remaining wrapper dataclass in the SDK. load_ucp_signing_key_from_env now takes the 5 fields directly as kwargs; the env-var-name overrides remain on the public surface so multi-env-namespace merchants still pin once via a module-level dict + spread. While auditing, CreateX402ServerOptions surfaced as a leftover wrapper that no longer matched its function (create_x402_server was already kwarg-shaped); deleted along with its barrel export. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
load_ucp_signing_key_from_envnow takes the 5 fields (env_jwk_var,env_kid_var,env_alg_var,default_kid,default_alg) as kwargs; deletes theLoadUCPSigningKeyOptionsdataclass.CreateX402ServerOptionssurfaced as a dead wrapper (create_x402_serverwas already kwarg-shaped). Deleted with its barrel export.load_ucp_signing_key_from_env(**_OPTS)).examples/signed_ucp_merchant.pymigrated to the dict-spread pattern as the canonical recipe.After this PR every public callable in the SDK is fully flat — no wrapper dataclasses on any input surface.
Test plan
uv run pytest tests/ -q→ 1034 passed, 95.02% coverageuv run ruff check→ all checks passeduv run ty check agentscore_commerce/→ all checks passeduv run vultureon touched files → no findingsload_ucp_signing_key_from_envpreserved (env precedence, kid precedence, sanitized errors, cache + lock semantics)🤖 Generated with Claude Code