Skip to content

fix!: enforce read authorization on referenced task lookup - #1005

Merged
ehsavoie merged 2 commits into
a2aproject:mainfrom
ehsavoie:reference_tasks
Aug 4, 2026
Merged

fix!: enforce read authorization on referenced task lookup#1005
ehsavoie merged 2 commits into
a2aproject:mainfrom
ehsavoie:reference_tasks

Conversation

@ehsavoie

@ehsavoie ehsavoie commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Filter referenced tasks (referenceTaskIds) through TaskAuthorizationProvider before populating the RequestContext, so callers cannot read tasks they are not authorized to access.

Pass ServerCallContext to validateRequestedTask so the authorization decorator can check read permissions when streaming or subscribe requests reference an existing task. Without this, an unauthorized caller could probe for task existence via sendStreamingMessage or subscribeToTask.

  • Expose getServerCallContext() on RequestContext.Builder
  • Wire TaskAuthorizationProvider into SimpleRequestContextBuilder
  • Inject TaskAuthorizationProvider via CDI in DefaultRequestHandler
  • Propagate ServerCallContext through validateRequestedTask in all transports (JSON-RPC, REST) and decorators (OTel, auth)
  • Standardize fail-closed authorization in InMemoryTaskStore to match JpaDatabaseTaskStore (deny when auth is configured but no context)
  • Add unit and integration tests for reference task authorization

@ehsavoie
ehsavoie requested review from jmesnil and kabir August 3, 2026 10:25
@ehsavoie
ehsavoie force-pushed the reference_tasks branch 2 times, most recently from 054c9bf to 46c0960 Compare August 3, 2026 16:33
Comment thread server-common/src/main/resources/META-INF/a2a-defaults.properties Outdated
@ehsavoie
ehsavoie force-pushed the reference_tasks branch 3 times, most recently from e171bef to cc6c7ec Compare August 4, 2026 14:45
@ehsavoie

ehsavoie commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Should be all good @kabir

@kabir kabir changed the title fix(server-common): enforce read authorization on referenced task lookup fix!: enforce read authorization on referenced task lookup Aug 4, 2026
…okup

- Authorize referenceTaskIds through TaskAuthorizationProvider before
  populating RequestContext; fail with TaskNotFoundError on denial
- Rename validateRequestedTask → authorizeTaskAccess, passing
  ServerCallContext for auth checks in streaming/subscribe paths
- Replace DefaultRequestHandler.create() with Builder pattern
- Make populate-referred-tasks configurable (a2a.request-context)
- Standardize fail-closed authorization in both TaskStore impls

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Replace response.pipe() with response.body() for non-SSE responses in
executeAsyncSSE to prevent "Response already ended" when small error
bodies are fully received before pipe attaches.

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
@ehsavoie
ehsavoie merged commit fb4411f into a2aproject:main Aug 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants