Skip to main content

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.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grantex_a2a-0.1.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file grantex_a2a-0.1.3.tar.gz.

File metadata

  • Download URL: grantex_a2a-0.1.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for grantex_a2a-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f1bc67ac51328915fe83f25c6b1e28e38de03719792c99811ca8bfc599a52b3a
MD5 3f2a836cfcf2e681a93064c3e6b0d9e7
BLAKE2b-256 37317c1a2415b2f1d84c1bf81d7c267b3b9ef56510ca8ba43aeae8fa666a7923

See more details on using hashes here.

File details

Details for the file grantex_a2a-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: grantex_a2a-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for grantex_a2a-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3ad0a0223d785ad7ee6b77070df3787a5d0893d2141f22e8d99af9d68a6877ca
MD5 dba6f671f0593b735e2441c23a251942
BLAKE2b-256 49ddb08d638dc024dfeb3f697b4f6ad6c2fad15f6de8dfc3e6abf6ffcdaad6c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page