Skip to content

Commit 596e2aa

Browse files
rustyconoverclaude
andcommitted
Pass OAuth scopes_supported through to PKCE middleware (v0.6.12)
Use the resource metadata's advertised scopes when initializing the OAuth PKCE middleware so authorization requests match what the server publishes, falling back to "openid email" when scopes are unset. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 50823b4 commit 596e2aa

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "vgi-rpc"
3-
version = "0.6.11"
3+
version = "0.6.12"
44
description = "Vector Gateway Interface - RPC framework based on Apache Arrow"
55
readme = "README.md"
66
requires-python = ">=3.13"

vgi_rpc/http/_server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,11 @@ def make_wsgi_app(
22342234
_pkce_client_id: str = _validated_oauth_metadata.client_id
22352235
_pkce_client_secret = _validated_oauth_metadata.client_secret
22362236
_pkce_use_id_token = _validated_oauth_metadata.use_id_token_as_bearer
2237+
_pkce_scope = (
2238+
" ".join(_validated_oauth_metadata.scopes_supported)
2239+
if _validated_oauth_metadata.scopes_supported
2240+
else "openid email"
2241+
)
22372242
_exempt_prefixes = (f"{prefix}/_oauth/",)
22382243
_pkce_active = True
22392244
_pkce_user_info_html = build_user_info_html(prefix)
@@ -2263,6 +2268,7 @@ def make_wsgi_app(
22632268
prefix=prefix,
22642269
secure_cookie=_pkce_secure,
22652270
redirect_uri=_pkce_redirect_uri,
2271+
scope=_pkce_scope,
22662272
)
22672273
)
22682274
if capability_headers:

0 commit comments

Comments
 (0)