Server-side SDK for the YadaCoin KEL Agent Auth Protocol
Project description
yadacoin-agent-auth (Python)
Server-side Python SDK for the YadaCoin KEL Agent Auth Protocol.
Implements protocol version 1.2.
Install
# Core (uses public REST API for KEL lookup — no local node required)
pip install yadacoin-agent-auth[rest]
# With a locally running YadaCoin node
pip install yadacoin-agent-auth[node]
Quick start (Tornado)
import os
from yadacoin_agent_auth import AgentAuthValidator, YadaCoinRestKelProvider, AuthError
validator = AgentAuthValidator(
challenge_secret=os.environ["YADACOIN_AGENT_SECRET"].encode(),
kel_provider=YadaCoinRestKelProvider("https://yadacoin.io"),
)
# GET /challenge?public_key=<hex>
class ChallengeHandler(BaseHandler):
async def get(self):
public_key = self.get_argument("public_key")
self.write(validator.make_challenge(public_key))
# POST /action
class ActionHandler(BaseHandler):
async def post(self):
body = json.loads(self.request.body)
try:
auth = await validator.validate(
public_key=body["public_key"],
challenge=body["challenge"],
signature=body["signature"],
)
except AuthError as exc:
self.set_status(exc.http_status)
return self.write({"error": str(exc)})
# auth.scope — normalised from W3C VC 2.0 or legacy flat format
# auth.address — P2PKH address of the verified agent key
validator.enforce_scope(auth, services=body.get("services"), dest=body.get("dest"))
# ... your service logic ...
Credential status modes
VCs issued with credentialStatus.mode: "rotation" (default) are one-time-use —
the key is revoked once it appears in the KEL. VCs with mode: "temporal" survive
key rotations; the verifier instead checks that the VP is signed with the current
active key per the KEL.
See §5.1 of the spec for full semantics.
Related
- JS SDK —
@yadacoin/agent-auth - Protocol specification
- did:yadacoin method spec
- YadaCoin node
License
YadaCoin Open Source License (YOSL) v1.1 — Copyright © 2017-2026 Matthew Vogel, Inc.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yadacoin_agent_auth-1.3.0.tar.gz.
File metadata
- Download URL: yadacoin_agent_auth-1.3.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe6fc2baa32273b3f9d50799b44cf6287f31bad77e834227b811d40fd5c42377
|
|
| MD5 |
ecc058bc97f318df0d7dc1cd5ee0f884
|
|
| BLAKE2b-256 |
f6ff058429f3965061fad55afada2466b8faca8c5b53c251f79f47298918594a
|
Provenance
The following attestation bundles were made for yadacoin_agent_auth-1.3.0.tar.gz:
Publisher:
ci.yml on pdxwebdev/yadacoin-agent-auth-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yadacoin_agent_auth-1.3.0.tar.gz -
Subject digest:
fe6fc2baa32273b3f9d50799b44cf6287f31bad77e834227b811d40fd5c42377 - Sigstore transparency entry: 1437896526
- Sigstore integration time:
-
Permalink:
pdxwebdev/yadacoin-agent-auth-py@7179624c3647fdd3fbc3b864ae88a96e5632124e -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/pdxwebdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7179624c3647fdd3fbc3b864ae88a96e5632124e -
Trigger Event:
push
-
Statement type:
File details
Details for the file yadacoin_agent_auth-1.3.0-py3-none-any.whl.
File metadata
- Download URL: yadacoin_agent_auth-1.3.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e7c875af0002f37afa9e3077171d1cb1915d4585d2ba11994280309389a4165
|
|
| MD5 |
2d04557cce8f9262b804bb4730590ef7
|
|
| BLAKE2b-256 |
c5476f820c919dba6cde7980749fd889aabb59c4d6267c204535837f85dad7d1
|
Provenance
The following attestation bundles were made for yadacoin_agent_auth-1.3.0-py3-none-any.whl:
Publisher:
ci.yml on pdxwebdev/yadacoin-agent-auth-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yadacoin_agent_auth-1.3.0-py3-none-any.whl -
Subject digest:
8e7c875af0002f37afa9e3077171d1cb1915d4585d2ba11994280309389a4165 - Sigstore transparency entry: 1437896545
- Sigstore integration time:
-
Permalink:
pdxwebdev/yadacoin-agent-auth-py@7179624c3647fdd3fbc3b864ae88a96e5632124e -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/pdxwebdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7179624c3647fdd3fbc3b864ae88a96e5632124e -
Trigger Event:
push
-
Statement type: