golf-mcp 0.2.7__py3-none-any.whl → 0.2.8__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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.7"
1
+ __version__ = "0.2.8"
2
2
 
3
3
  # Import endpoints with fallback for dev mode
4
4
  try:
golf/auth/__init__.py CHANGED
@@ -235,7 +235,7 @@ def configure_oauth_proxy(
235
235
  revocation_endpoint=revocation_endpoint,
236
236
  base_url=base_url,
237
237
  redirect_path=redirect_path,
238
- scopes_supported=scopes_supported or [],
238
+ scopes_supported=scopes_supported,
239
239
  token_verifier_config=token_verifier_config,
240
240
  )
241
241
  configure_auth(config)
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(default_factory=list, description="Scopes supported by this proxy")
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, got {type(self.token_verifier_config).__name__}"
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: golf-mcp
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Framework for building MCP servers
5
5
  Author-email: Antoni Gmitruk <antoni@golf.dev>
6
6
  License-Expression: Apache-2.0
@@ -1,12 +1,12 @@
1
- golf/__init__.py,sha256=6vytM_ZxcMhG5rXftdEzDMmvD941REm-UGAitD-fBss,306
1
+ golf/__init__.py,sha256=22iRBt6mUc1Eiq6uhr-REdh-_NN9o_9MFc7aHLsImkM,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=u-6_EFTvfs91B2Jko39swp3tCpHkj3r9wDQzQBmfxn0,8027
5
+ golf/auth/__init__.py,sha256=9VsuGjoP-MTY-CRiPfPKGuD096OMUpCQoAlMJU8RzIE,8021
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=qgybeHtrb0MojUsXZm813gzT4zBCNxCiSCWvxKG2iis,25950
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.7.dist-info/licenses/LICENSE,sha256=5_j2f6fTJmvfmUewzElhkpAaXg2grVoxKouOA8ihV6E,11348
52
- golf_mcp-0.2.7.dist-info/METADATA,sha256=5F9gLHC0HqScjtaPXvIWJ30JfX4CSFIkVRvXQYYl5cI,9370
53
- golf_mcp-0.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
- golf_mcp-0.2.7.dist-info/entry_points.txt,sha256=5y7rHYM8jGpU-nfwdknCm5XsApLulqsnA37MO6BUTYg,43
55
- golf_mcp-0.2.7.dist-info/top_level.txt,sha256=BQToHcBUufdyhp9ONGMIvPE40jMEtmI20lYaKb4hxOg,5
56
- golf_mcp-0.2.7.dist-info/RECORD,,
51
+ golf_mcp-0.2.8.dist-info/licenses/LICENSE,sha256=5_j2f6fTJmvfmUewzElhkpAaXg2grVoxKouOA8ihV6E,11348
52
+ golf_mcp-0.2.8.dist-info/METADATA,sha256=ebA3N_gR-sN6BRMP8j-2I-7VOn52L18Yih6C6vlK4cs,9370
53
+ golf_mcp-0.2.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
+ golf_mcp-0.2.8.dist-info/entry_points.txt,sha256=5y7rHYM8jGpU-nfwdknCm5XsApLulqsnA37MO6BUTYg,43
55
+ golf_mcp-0.2.8.dist-info/top_level.txt,sha256=BQToHcBUufdyhp9ONGMIvPE40jMEtmI20lYaKb4hxOg,5
56
+ golf_mcp-0.2.8.dist-info/RECORD,,