feat: requires OAuth-only auth mode for MCP agents

This commit is contained in:
Anton
2026-04-29 15:08:18 +03:00
parent ad0b15cc6e
commit d20b4f396b
6 changed files with 31 additions and 17 deletions

View File

@@ -79,11 +79,11 @@ def mcp_protected_resource_metadata(settings: Settings) -> dict:
def _mcp_static_token_allowed(settings: Settings) -> bool:
return settings.mcp_auth_mode in {"token", "oauth_or_token"}
return settings.mcp_auth_mode == "token"
def _mcp_oauth_allowed(settings: Settings) -> bool:
return settings.mcp_auth_mode in {"oauth", "oauth_or_token"}
return settings.mcp_auth_mode == "oauth"
def _validate_mcp_oauth_token(token: str, settings: Settings) -> None: