feat: Support multi-tenancy#419
Conversation
🧪 Code Coverage
Generated by coverage-comment.yml |
This comment was marked as outdated.
This comment was marked as outdated.
…bgralewicz/support_multi_tenancy
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive multi-tenancy support across the client and server components. Key updates include the addition of a tenant field to the ServerCallContext, the implementation of tenant-aware routing in REST, gRPC, and JSON-RPC transports, and the introduction of tenant-scoped data isolation in the in-memory task and push notification stores. While the implementation successfully enables multi-tenant workflows, the review identifies a critical vulnerability in the composite key generation logic used for storage. Specifically, the current key structure is susceptible to collisions between tenanted and global-scope identifiers, which could lead to unintended data overwrites and loss of isolation.
…y added to all requests when specified.
…is also updated to resolvePathTenant.
…disables are needed.
Description
Added support for multi-tenancy.
Multi-Tenancy
This handler supports multi-tenant deployments through the
tenantfield presenton all request objects (per A2A spec Sections 3.1.x and 4.4.6). The tenant value
flows through the system as follows:
Transport layer extracts tenant from the protocol-specific source:
/:tenant/...)params.tenantin the request bodytenantfield in the request messageServerCallContext.tenantcarries the tenant to all downstream components,including
TaskStore,PushNotificationStore, andAgentExecutor.InMemoryTaskStoreandInMemoryPushNotificationStoreusecontext.tenantto scope data with composite keys (
{tenant}:{id}), providing tenant isolation.Similar PR done in Python SDK: a2aproject/a2a-python#758
Fixes #325 🦕