mcp: include scopes supported in the www-authenticate header#1608
mcp: include scopes supported in the www-authenticate header#1608nacx merged 1 commit intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Ignasi Barrera <nacx@apache.org>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1608 +/- ##
=======================================
Coverage 83.51% 83.52%
=======================================
Files 137 137
Lines 11934 11936 +2
=======================================
+ Hits 9967 9969 +2
Misses 1386 1386
Partials 581 581 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hi @nacx LGTM. Thanks!
It should be helpful to add a comment to the ScopeSupported API to highlight that it should be the minimal set of scopes necessary for basic functionality to avoid exposing all scopes in the session initialization stage.
The
scopes_supportedfield is intended to represent the minimal set of scopes necessary
for basic functionality (see Scope Minimization),
with additional scopes requested incrementally through the step-up authorization flow steps
described in the Scope Challenge Handling section.
…oxy#1608) **Description** Add the configured scopes to the `WWW-Authenticate` headers. At initialization time, which is when the first authentication will occur, we don't have enough information to provide a fine-grained list of scopes, so the best we can do is to default to the ones defined in the protected resource metadata. **Related Issues/PRs (if applicable)** Fixes envoyproxy#1578 The addition of the header on 403 requests is implemented in envoyproxy#1482, but this issue can be closed as soon as this PR is merged, because we'll be compatible with the latest spec. **Special notes for reviewers (if applicable)** cc @zhaohuabing can you take a look? Signed-off-by: Ignasi Barrera <nacx@apache.org> Signed-off-by: Erica Hughberg <erica.sundberg.90@gmail.com>
Description
Add the configured scopes to the
WWW-Authenticateheaders. At initialization time, which is when the first authentication will occur, we don't have enough information to provide a fine-grained list of scopes, so the best we can do is to default to the ones defined in the protected resource metadata.Related Issues/PRs (if applicable)
Fixes #1578
The addition of the header on 403 requests is implemented in #1482, but this issue can be closed as soon as this PR is merged, because we'll be compatible with the latest spec.
Special notes for reviewers (if applicable)
cc @zhaohuabing can you take a look?