golf-mcp 0.2.7__py3-none-any.whl → 0.2.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of golf-mcp might be problematic. Click here for more details.
- golf/__init__.py +1 -1
- golf/auth/__init__.py +6 -1
- golf/auth/providers.py +5 -29
- {golf_mcp-0.2.7.dist-info → golf_mcp-0.2.9.dist-info}/METADATA +1 -1
- {golf_mcp-0.2.7.dist-info → golf_mcp-0.2.9.dist-info}/RECORD +9 -9
- {golf_mcp-0.2.7.dist-info → golf_mcp-0.2.9.dist-info}/WHEEL +0 -0
- {golf_mcp-0.2.7.dist-info → golf_mcp-0.2.9.dist-info}/entry_points.txt +0 -0
- {golf_mcp-0.2.7.dist-info → golf_mcp-0.2.9.dist-info}/licenses/LICENSE +0 -0
- {golf_mcp-0.2.7.dist-info → golf_mcp-0.2.9.dist-info}/top_level.txt +0 -0
golf/__init__.py
CHANGED
golf/auth/__init__.py
CHANGED
|
@@ -206,6 +206,7 @@ def configure_oauth_proxy(
|
|
|
206
206
|
scopes_supported: list[str] | None = None,
|
|
207
207
|
revocation_endpoint: str | None = None,
|
|
208
208
|
redirect_path: str = "/oauth/callback",
|
|
209
|
+
**env_vars: str,
|
|
209
210
|
) -> None:
|
|
210
211
|
"""Configure OAuth proxy authentication for non-DCR providers.
|
|
211
212
|
|
|
@@ -223,6 +224,9 @@ def configure_oauth_proxy(
|
|
|
223
224
|
scopes_supported: Scopes to advertise to MCP clients
|
|
224
225
|
revocation_endpoint: Optional token revocation endpoint
|
|
225
226
|
redirect_path: OAuth callback path (default: /oauth/callback)
|
|
227
|
+
**env_vars: Environment variable names (authorization_endpoint_env_var,
|
|
228
|
+
token_endpoint_env_var, client_id_env_var, client_secret_env_var,
|
|
229
|
+
base_url_env_var, revocation_endpoint_env_var)
|
|
226
230
|
|
|
227
231
|
Note:
|
|
228
232
|
Requires golf-mcp-enterprise package for implementation.
|
|
@@ -235,8 +239,9 @@ def configure_oauth_proxy(
|
|
|
235
239
|
revocation_endpoint=revocation_endpoint,
|
|
236
240
|
base_url=base_url,
|
|
237
241
|
redirect_path=redirect_path,
|
|
238
|
-
scopes_supported=scopes_supported
|
|
242
|
+
scopes_supported=scopes_supported,
|
|
239
243
|
token_verifier_config=token_verifier_config,
|
|
244
|
+
**env_vars,
|
|
240
245
|
)
|
|
241
246
|
configure_auth(config)
|
|
242
247
|
|
golf/auth/providers.py
CHANGED
|
@@ -470,7 +470,9 @@ class OAuthProxyConfig(BaseModel):
|
|
|
470
470
|
redirect_path: str = Field("/oauth/callback", description="OAuth callback path (must match provider registration)")
|
|
471
471
|
|
|
472
472
|
# Scopes and token verification
|
|
473
|
-
scopes_supported: list[str] = Field(
|
|
473
|
+
scopes_supported: list[str] | None = Field(
|
|
474
|
+
None, description="Scopes supported by this proxy (optional, can be empty for intelligent fallback)"
|
|
475
|
+
)
|
|
474
476
|
token_verifier_config: JWTAuthConfig | StaticTokenConfig = Field(
|
|
475
477
|
..., description="Token verifier configuration for validating upstream tokens"
|
|
476
478
|
)
|
|
@@ -536,40 +538,14 @@ class OAuthProxyConfig(BaseModel):
|
|
|
536
538
|
|
|
537
539
|
return url
|
|
538
540
|
|
|
539
|
-
@field_validator("scopes_supported")
|
|
540
|
-
@classmethod
|
|
541
|
-
def validate_scopes_supported(cls, v: list[str]) -> list[str]:
|
|
542
|
-
"""Validate scopes_supported format and security."""
|
|
543
|
-
if not v:
|
|
544
|
-
return v
|
|
545
|
-
|
|
546
|
-
cleaned_scopes = []
|
|
547
|
-
for scope in v:
|
|
548
|
-
scope = scope.strip()
|
|
549
|
-
if not scope:
|
|
550
|
-
raise ValueError("Scopes cannot be empty or whitespace-only")
|
|
551
|
-
|
|
552
|
-
# OAuth 2.0 scope format validation (RFC 6749)
|
|
553
|
-
if not all(32 < ord(c) < 127 and c not in ' "\\' for c in scope):
|
|
554
|
-
raise ValueError(
|
|
555
|
-
f"Invalid scope format: '{scope}' - must be ASCII printable without spaces, quotes, or backslashes"
|
|
556
|
-
)
|
|
557
|
-
|
|
558
|
-
# Reasonable length limit to prevent abuse
|
|
559
|
-
if len(scope) > 128:
|
|
560
|
-
raise ValueError(f"Scope too long: '{scope}' - maximum 128 characters")
|
|
561
|
-
|
|
562
|
-
cleaned_scopes.append(scope)
|
|
563
|
-
|
|
564
|
-
return cleaned_scopes
|
|
565
|
-
|
|
566
541
|
@model_validator(mode="after")
|
|
567
542
|
def validate_oauth_proxy_config(self) -> "OAuthProxyConfig":
|
|
568
543
|
"""Validate OAuth proxy configuration consistency."""
|
|
569
544
|
# Validate token verifier config is compatible
|
|
570
545
|
if not isinstance(self.token_verifier_config, JWTAuthConfig | StaticTokenConfig):
|
|
571
546
|
raise ValueError(
|
|
572
|
-
f"token_verifier_config must be JWTAuthConfig or StaticTokenConfig,
|
|
547
|
+
f"token_verifier_config must be JWTAuthConfig or StaticTokenConfig, "
|
|
548
|
+
f"got {type(self.token_verifier_config).__name__}"
|
|
573
549
|
)
|
|
574
550
|
|
|
575
551
|
# Warn about HTTPS requirements in production
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
golf/__init__.py,sha256=
|
|
1
|
+
golf/__init__.py,sha256=CB9wu2mcYCSJopA-uO1-_87ebOSTDcXJ8uOktQ4va20,306
|
|
2
2
|
golf/_endpoints.py,sha256=-mvAmjx3YtqfAdajO13Kv7LKVBMdqsKqX0_3aCmCK4I,317
|
|
3
3
|
golf/_endpoints.py.in,sha256=MeqcSF6xinnPknpBGF26xA9FYmSYKSWqCFXOSDlXiOA,216
|
|
4
4
|
golf/_endpoints_fallback.py,sha256=CD6m45Ams1A9HVKowY8dCFUDMiFmJ8ZWSwHCENvU5u4,386
|
|
5
|
-
golf/auth/__init__.py,sha256=
|
|
5
|
+
golf/auth/__init__.py,sha256=gx62l8Z72eIldO2LtzKQ2OQVeobrhaSggTzJaZ0hcCo,8279
|
|
6
6
|
golf/auth/api_key.py,sha256=OonqTlG6USJxqK8TlPviJTv7sgYmTVfCxG_JsEjnEM4,2320
|
|
7
7
|
golf/auth/factory.py,sha256=3-il1GbjjZlQfvWUZs-09r61Y_-b5cYEegWF7sY_cUs,13128
|
|
8
8
|
golf/auth/helpers.py,sha256=WoYyjUAQwgDnLvJDvyhuEOmm8w0fQ-ZDqaYxs_lC8nw,8127
|
|
9
|
-
golf/auth/providers.py,sha256=
|
|
9
|
+
golf/auth/providers.py,sha256=f89WeQUrYopS0GBcTO3yXlqyPQvG7s7GpaiUK2tb2ME,25048
|
|
10
10
|
golf/auth/registry.py,sha256=Rjj7LnWvzEsI1GCnFbFcxpRllrVanD9bumWPaJ1giFQ,7960
|
|
11
11
|
golf/cli/__init__.py,sha256=R8Y8KdD2C8gDo24fXGq-fdWWNeaq3MYjrbaSB8Hb-Hg,45
|
|
12
12
|
golf/cli/branding.py,sha256=ndpy2kVxBzqr4fwsAlh_fbhxqgRPoF6kM3ufP9hg5QI,6896
|
|
@@ -48,9 +48,9 @@ golf/utilities/__init__.py,sha256=X9iY9yi3agz1GVcn8-qWeOCt8CSSsruHxqPNtiF63TY,53
|
|
|
48
48
|
golf/utilities/context.py,sha256=DGGvhVe---QMhy0wtdWhNp-_WVk1NvAcOFn0uBKBpYo,1579
|
|
49
49
|
golf/utilities/elicitation.py,sha256=MParZZZsY45s70-KXduHa6IvpWXnLW2FCPfrGijMaHs,5223
|
|
50
50
|
golf/utilities/sampling.py,sha256=88nDv-trBE4gZQbcnMjXl3LW6TiIhv5zR_cuEIGjaIM,7233
|
|
51
|
-
golf_mcp-0.2.
|
|
52
|
-
golf_mcp-0.2.
|
|
53
|
-
golf_mcp-0.2.
|
|
54
|
-
golf_mcp-0.2.
|
|
55
|
-
golf_mcp-0.2.
|
|
56
|
-
golf_mcp-0.2.
|
|
51
|
+
golf_mcp-0.2.9.dist-info/licenses/LICENSE,sha256=5_j2f6fTJmvfmUewzElhkpAaXg2grVoxKouOA8ihV6E,11348
|
|
52
|
+
golf_mcp-0.2.9.dist-info/METADATA,sha256=67-svZP_no-mw7BBDGwoQJJ_RCcqCQH5uEAk7jfqUF0,9370
|
|
53
|
+
golf_mcp-0.2.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
54
|
+
golf_mcp-0.2.9.dist-info/entry_points.txt,sha256=5y7rHYM8jGpU-nfwdknCm5XsApLulqsnA37MO6BUTYg,43
|
|
55
|
+
golf_mcp-0.2.9.dist-info/top_level.txt,sha256=BQToHcBUufdyhp9ONGMIvPE40jMEtmI20lYaKb4hxOg,5
|
|
56
|
+
golf_mcp-0.2.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|