Google A2A protocol bridge for Grantex — inject grant tokens into agent-to-agent communication
Project description
grantex-a2a
Google A2A protocol bridge for Grantex — inject grant tokens into agent-to-agent communication.
Installation
pip install grantex-a2a
Usage
Client — Send tasks to A2A agents with grant token auth
from grantex_a2a import A2AGrantexClient, A2AGrantexClientOptions, TaskSendParams, A2AMessage, A2APart
client = A2AGrantexClient(A2AGrantexClientOptions(
agent_url="https://agent.example.com/a2a",
grant_token="eyJ...",
))
task = client.send_task(TaskSendParams(
message=A2AMessage(role="user", parts=[A2APart(type="text", text="Hello")])
))
Server middleware — Validate incoming grant tokens
from grantex_a2a import create_a2a_auth_middleware, A2AAuthMiddlewareOptions
middleware = create_a2a_auth_middleware(
A2AAuthMiddlewareOptions(jwks_uri="https://grantex.dev/.well-known/jwks.json")
)
# In your request handler:
grant = middleware(dict(request.headers))
print(grant.principal_id, grant.scopes)
Agent Card — Build A2A-compliant agent cards
from grantex_a2a import build_grantex_agent_card, GrantexAgentCardOptions
card = build_grantex_agent_card(GrantexAgentCardOptions(
name="My Agent",
description="An agent",
url="https://my-agent.example.com/a2a",
jwks_uri="https://grantex.dev/.well-known/jwks.json",
issuer="https://grantex.dev",
))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
grantex_a2a-0.1.4.tar.gz
(8.2 kB
view details)
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 grantex_a2a-0.1.4.tar.gz.
File metadata
- Download URL: grantex_a2a-0.1.4.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3858b0a0ea1cd5ac0185c8326668b748ebb25f464e3c2dca0cfde9046cc9100
|
|
| MD5 |
fddf62981d857e71802665035e0d691c
|
|
| BLAKE2b-256 |
028e66b3952be5d3c6dfe7c112a57f54b6eed805ae8a93984fcf7b6a446f0b72
|
File details
Details for the file grantex_a2a-0.1.4-py3-none-any.whl.
File metadata
- Download URL: grantex_a2a-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4683a9ef3251f818e41791fcd3c730f504887fe49e45b382ddbfaf26294d25ca
|
|
| MD5 |
4983f6c5f013875a2fb058adcfe6e844
|
|
| BLAKE2b-256 |
45a778e4c9564c2528038b908cd20368ae30b6072592d6caa106debdbb284d19
|