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

Uploaded Python 3

File details

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

File metadata

  • Download URL: grantex_a2a-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 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.0.tar.gz
Algorithm Hash digest
SHA256 351be47a80c9572059bd75fdf6d2ff435db5cbfb1436423b7425d7acee1b4f0b
MD5 356d464284f704dfdae76ab54f9a652d
BLAKE2b-256 4c5365e5a8fb4f802d4c2eee329d8f2292e03645bc489f2fd9387cf898f0d657

See more details on using hashes here.

File details

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

File metadata

  • Download URL: grantex_a2a-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2e5d7ed33b1f3a15784b880fd08d9ba38883f459f4728498774e710cfe5a1c9
MD5 cb00a0dfa0ac836951cfadfe92f9f6d8
BLAKE2b-256 7f73116b344a99086ad29cb313eeeecd426a61304e6b45155c017120236f217c

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