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.2.tar.gz (7.3 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.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for grantex_a2a-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b6f23c76ed7fa0cf5bad139ba8696a5d5ee59c32b58bac05dcccfdb84be2cb1b
MD5 f4ca8fa981b9352a0be165b03ad7fb46
BLAKE2b-256 b7d71740c2064363df1883f466085a07590a713cae59ea7302c8b08ade6b2403

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for grantex_a2a-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d59a8ddc8e16118e2e42b70f508f591a0bddc154489ca3496f541cad7e50ca76
MD5 98a98353184cadf2ec68d2580e2ea536
BLAKE2b-256 b74205cb7aafe9ad917a0f78216b20a40cbdbb2b565942e8f1e6ca774c0e9b03

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