Skip to content

fix: make external OAuth authorization configurable - #157

Merged
FreeOnePlus merged 1 commit into
apache:masterfrom
FreeOnePlus:fix/issue-88-oauth-authorization-config
Jul 30, 2026
Merged

fix: make external OAuth authorization configurable#157
FreeOnePlus merged 1 commit into
apache:masterfrom
FreeOnePlus:fix/issue-88-oauth-authorization-config

Conversation

@FreeOnePlus

Copy link
Copy Markdown
Member

Summary

  • replace external OAuth role, permission, security-level, and trusted-domain
    hardcoding with validated configuration
  • add environment settings for default roles/permissions, role mappings,
    trusted domains, and fallback security levels
  • require email_verified=true before a trusted email domain can elevate a
    user's security classification
  • remove placeholder trusted domains and make permission output deterministic
  • replace the misleading Python-only README example with deployable
    environment configuration and Doris authorization boundaries

Configuration

The new settings are:

  • OAUTH_DEFAULT_ROLES
  • OAUTH_DEFAULT_SECURITY_LEVEL
  • OAUTH_DEFAULT_PERMISSIONS
  • OAUTH_TRUSTED_DOMAINS
  • OAUTH_TRUSTED_DOMAIN_SECURITY_LEVEL
  • OAUTH_ROLE_SECURITY_LEVELS_JSON
  • OAUTH_ROLE_PERMISSIONS_JSON

JSON mappings replace the complete built-in mapping when supplied. An explicit
empty permission array denies permissions for that mapped role, and an empty
OAUTH_DEFAULT_PERMISSIONS value makes unknown roles fail closed.

Root cause

The README described authorization as configurable, but the active external
OAuth provider embedded role mappings and placeholder trusted domains directly
in Python. Operators could not supply their own roles or safely disable the
implicit read_data fallback.

Validation

  • uv run pytest -q: 1090 passed, 68 skipped; coverage 58.11%
  • external OAuth configuration and validation suite: 49 passed
  • post-rebase OAuth/result-limit regression set: 62 passed
  • uv run ruff check .
  • uv run mypy doris_mcp_server
  • CI-equivalent Bandit scan
  • uv build

Fixes #88

@FreeOnePlus
FreeOnePlus force-pushed the fix/issue-88-oauth-authorization-config branch from 2f351f9 to 96f576f Compare July 30, 2026 10:44
@FreeOnePlus
FreeOnePlus merged commit 44e910a into apache:master Jul 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

关于Authorization & Security Levels部分的配置

1 participant