You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Track a follow-up identified by @halter73 during review of #1722.
Repeated AddAuthorizationFilters() registrations are intended to protect tools when an intervening ordinary call-tool filter changes RequestContext.MatchedPrimitive. The current post-configuration approach installs only one alternate authorization filter because TryAddEnumerable deduplicates the post-configurer. As a result, a primitive changed later in the ordinary filter pipeline is not reauthorized.
Proposed behavior
Keep one alternate authorization check outside Tasks so unauthorized task-backed calls are rejected before task creation.
Add an ordinary authorization filter for each AddAuthorizationFilters() registration so callers can reauthorize after filters that replace the matched primitive.
Consider caching the last authorized primitive in RequestContext.Items to avoid duplicate policy evaluation when the primitive has not changed.
Add regression coverage with two authorization registrations separated by an ordinary filter that changes the matched tool.
Summary
Track a follow-up identified by @halter73 during review of #1722.
Repeated
AddAuthorizationFilters()registrations are intended to protect tools when an intervening ordinary call-tool filter changesRequestContext.MatchedPrimitive. The current post-configuration approach installs only one alternate authorization filter becauseTryAddEnumerablededuplicates the post-configurer. As a result, a primitive changed later in the ordinary filter pipeline is not reauthorized.Proposed behavior
AddAuthorizationFilters()registration so callers can reauthorize after filters that replace the matched primitive.RequestContext.Itemsto avoid duplicate policy evaluation when the primitive has not changed.Context
Original finding by @halter73: #1722 (comment)
Note
This issue was drafted with GitHub Copilot.