flexway
FRENParler à un expert

Agent A2A derrière la passerelle

ExempleExploitationDepuis la version 1.2.0

Markdown

Guide d'exploitation : configurer, déployer et observer la passerelle. Ce que fait la capacité côté produit : guide produit ; l'appeler : guide développeur.

# An A2A agent behind the gateway (1.2.0): its declared card is the contract - its
# methods served in JSON-RPC and HTTP+JSON at the gateway's addresses -, the agent always receives a
# token exchanged for it, the tenant is the identity's, writes are counted and reading a task is free,
# a push notification may target the declared hosts only.
version: 1
contracts:
  a2a: [./scoring.card.json]
upstreams:
  scoring:
    url: https://scoring.internal:8443
    protocol: a2a
    token_exchange:
      audience: scoring-agent                    # required: the agent binds each task to this identity
auth:
  tenant_header: X-Tenant                        # the identity's tenant, written toward the agent
  issuers:
    - name: customers
      discovery: https://login.example.net/.well-known/openid-configuration
      audience: api
      tenant_claim: org
      client:
        id: flexway
        secret: file:/etc/flexway/secrets/exchange-client
agents:
  delegation: { max_depth: 2, max_age: 15m }
  a2a:
    push:
      allowed_hosts: [hooks.partner-x.example, "*.callbacks.example.com"]   # absent: no push target at all
policies:
  definitions:
    per-caller:
      type: rate-limit
      config:
        key: caller
        classes:
          read: { rps: 20, burst: 40 }
          write: { rps: 2, burst: 5 }
  chains:
    routes:
      "/agents/**": [per-caller]
// extrait de examples/a2a-agent/scoring.card.json - les adresses sont celles de la passerelle
"supportedInterfaces": [
  { "url": "https://api.example.com/agents/scoring", "protocolBinding": "JSONRPC", "protocolVersion": "1.0" },
  { "url": "https://api.example.com/agents/scoring/v1", "protocolBinding": "HTTP+JSON", "protocolVersion": "1.0" } ],
"capabilities": { "streaming": true, "pushNotifications": true },
"securityRequirements": [ { "schemes": { "customers": { "list": ["scoring:invoke"] } } } ],
"x-flexway-a2a": { "upstream": "scoring", "verify": "none", "methods": { "CancelTask": "write" },
                   "max_streams": 5, "max_task_duration": "30m", "delegation": { "max_depth": 1, "max_age": "10m" } }

Étapes suivantes