Repository navigation
fix(task-store): preserve authorized task pagination - #1258
Merged
Merged
Conversation
Apply per-task read checks after the list-scope gate so builder-wired stores cannot return tasks the caller may not read. Keep the fail-closed path from querying a store when authorization is required but no provider is available. Add coverage for the list-scope check and for filtering individual returned tasks. Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Route authorized listings through the request handler provider so stores apply a consistent per-task read check before pagination. Add a bounded fallback for custom stores that do not implement the optimized path, including an exact authorized total and page-token loop detection. Update the JPA store to scan authorized candidates in configurable batches, return a safe partial page when its scan budget is exhausted, and avoid exposing inaccessible task counts. Document the default fallback scan cost and limits, and qualify exact counts when concurrent changes occur. Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com> Signed-off-by: Kabir Khan <kkhan@redhat.com>
jmesnil
reviewed
Nov 2, 2026
| throw new TaskStoreException("a2a.max-scanned-tasks must be greater than zero"); | ||
| } | ||
| if (provider != null && authorizationScanBatchSize <= 0) { | ||
| throw new TaskStoreException("a2a.authorization-scan-batch-size must be greater than zero"); |
Contributor
There was a problem hiding this comment.
should this validation (& a2a.max-scanned-tasks) be done in the initConfig method instead.
Reject nonpositive scan limits and authorization batch sizes in initConfig instead of waiting for an authorized listing. Cover zero, negative, and positive values without requiring an authorization provider, and document the initialization failure.
jmesnil
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task listings need to apply the request handler's authorization provider before pagination so page contents, continuation tokens, and totals describe the same set of readable tasks.
This change passes that provider to
TaskStore.listAuthorized, preserves the list-level access check, and validates returned tasks. In-memory and JPA stores filter authorized candidates before selecting a page. Custom stores inherit a bounded fallback with authorized totals and page-token loop detection.The JPA fallback uses configurable scan batches and limits. The documentation explains scan costs and consistency guarantees, with regression coverage for builder-wired handlers, pagination, totals, and scan limits.
Validation:
mvn -B -pl server-common,extras/task-store-database-jpa -am package -DskipDockerTests=falsepassed (1,868 tests, zero failures or errors, six skipped).