Commit 31efa94
Inject tool annotations into context during list filtering (#4129)
The tools/list response filter calls AuthorizeWithJWTClaims for each
tool to decide whether to include it in the filtered response. However,
it was passing the original request context which has no tool
annotations. This caused Cedar policies with `when` clauses on resource
attributes (e.g. resource.readOnlyHint) to always fail, filtering out
all tools regardless of their annotations.
The fix injects each tool's annotations into the context before the
authorization check, matching what AnnotationEnrichmentMiddleware
already does for tools/call requests.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 0657df9 commit 31efa94
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
290 | 300 | | |
291 | 301 | | |
292 | | - | |
| 302 | + | |
293 | 303 | | |
294 | 304 | | |
295 | 305 | | |
| |||
0 commit comments