feat(sdk): add Python SDK — port TypeScript verify.ts to Python (#15)#22
Open
nanookclaw wants to merge 1 commit intoFransDevelopment:mainfrom
Open
feat(sdk): add Python SDK — port TypeScript verify.ts to Python (#15)#22nanookclaw wants to merge 1 commit intoFransDevelopment:mainfrom
nanookclaw wants to merge 1 commit intoFransDevelopment:mainfrom
Conversation
…sDevelopment#15) Implements the 14-step Verification Protocol from spec/03-verification.md in Python, matching the TypeScript SDK's API surface for native use in APS, AgentID, Agora, and other Python-based working group members. Structure: sdk/python/ src/open_agent_trust/ __init__.py — public API surface types.py — dataclass mirrors of TypeScript types (RegistryManifest, RevocationList, IssuerEntry, PublicKey, AttestationClaims, VerificationResult, ...) verify.py — 14-step verifyAttestation() implementation tests/ test_verify.py — 20 tests covering all acceptance criteria pyproject.toml — pip install open-agent-trust README.md Implementation notes: - Ed25519 signature via cryptography (PyCA) — same library WG members use - JWT decode via PyJWT with EdDSA algorithm support - Grace period enforcement: 90 days (spec/04-key-rotation.md) - Fast-path revocation list check before manifest lookup - All 14 steps mapped to spec/03-verification.md section references Test coverage (20/20 passing): - Valid attestation + nonce check - Unknown/revoked/suspended issuer - Unknown/revoked key (manifest + fast-path revocations list) - Invalid signature / tampered token / malformed JWS - Expired JWT token (step 13 exp claim) - Expired registry public key (step 10 expires_at) - Deprecated key within/past 90-day grace period (step 9) - Audience mismatch / nonce mismatch - Claims extraction (sub, aud, scope, constraints, user_pseudonym) - RegistryManifest.from_dict() round-trip Closes FransDevelopment#15
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
Implements Issue #15: Python port of the TypeScript SDK for native attestation verification in Python-based Working Group members (APS, AgentID, Agora all use PyCA per the WG thread).
What this adds
Usage
Implementation
cryptography(PyCA) — matches WG member toolingPyJWTwith EdDSA algorithm supportspec/03-verification.mdimplemented with matching comment referencesTests (20/20 passing)
Covers all acceptance criteria from Issue #15:
Dependencies
cryptography >= 41PyJWT >= 2.8