Skip to content

feat: added OAUTH_ALLOWED_REDIRECT_HOSTS whitelist for oauth redirects - #594

Merged
petruki merged 1 commit into
masterfrom
staging
Nov 1, 2026
Merged

petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki

@petruki petruki commented Nov 1, 2026

Copy link
Copy Markdown
Member

This pull request introduces a new environment variable, OAUTH_ALLOWED_REDIRECT_HOSTS, to restrict which hostnames can be used as OAuth client redirect URIs for registration and authorization. The change enhances security by allowing administrators to specify a comma-separated allow-list of hosts, with loopback addresses always permitted. The implementation includes code changes, documentation updates, and new tests to cover the feature.

OAuth Redirect Host Allow-List Feature:

  • Added the OAUTH_ALLOWED_REDIRECT_HOSTS environment variable to .env-cmdrc-template, config/.env.dev, and docker-compose.yml to configure allowed OAuth redirect hosts. [1] [2] [3]
  • Updated the OAuth service (src/services/oauth.js) to enforce the allow-list: only hosts in OAUTH_ALLOWED_REDIRECT_HOSTS or loopback addresses are accepted for redirect_uri during client registration and authorization. [1] [2]

Documentation:

  • Updated README.md to explain the usage and behavior of OAUTH_ALLOWED_REDIRECT_HOSTS, including default behavior and examples.

Testing:

  • Added tests in tests/oauth.test.js to verify correct enforcement of the allow-list during OAuth client registration and authorization flows.

@petruki petruki added this to the v1.4.1 milestone Nov 1, 2026
@petruki petruki self-assigned this Nov 1, 2026
@petruki petruki added the enhancement New feature or request label Nov 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

@petruki
petruki merged commit 44098f7 into master Nov 1, 2026
5 checks passed
@petruki
petruki deleted the staging branch November 1, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant