Skip to content

chore(refarch-gateway): restrict default cors config - #945

Open
darenegade wants to merge 1 commit into
mainfrom
chore/restrict-gateway-cors-defaults
Open

chore(refarch-gateway): restrict default cors config#945
darenegade wants to merge 1 commit into
mainfrom
chore/restrict-gateway-cors-defaults

Conversation

@darenegade

@darenegade darenegade commented Jul 20, 2026

Copy link
Copy Markdown
Member

Pull Request

Changes

  • add a restrictive global CORS default for all routes so cross-origin access is denied unless configured explicitly
  • make global, public and client CORS settings centrally overridable via environment variables with inherited defaults
  • document the new CORS defaults, override precedence and broader default scope in gateway docs and known issues

Reference

Issue: #internal&66

Checklist

General

  • Met all acceptance criteria of the issue
  • Added meaningful PR title and list of changes in the description
  • Created / Updated documentation (in English)

Code

  • Wrote code and comments in English
  • Removed waste on branch (for example console.log), see code quality tooling

@darenegade
darenegade requested a review from a team as a code owner July 20, 2026 11:11
@github-actions github-actions Bot added Component: API-Gateway Issues regarding the API Gateway Type: Documentation The issue contains work for the documentation Type: Maintenance The issue contains maintenance work. labels Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Gateway CORS rules now use environment-variable-driven defaults, including a catch-all path and specific overrides for /public/** and /clients/**. Documentation describes restrictive defaults, configuration aliases, CORS buckets, and override precedence.

Changes

Gateway CORS

Layer / File(s) Summary
Environment-driven CORS rules
refarch-gateway/src/main/resources/application.yml
Adds a catch-all CORS rule and parameterizes origins, headers, credentials, and methods for each configured path.
CORS routing guidance
docs/gateway.md, docs/support/known-issues.md
Documents default-deny behavior, environment-variable overrides, CORS buckets, and precedence for specific paths.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: devtobi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: restricting the default CORS configuration.
Description check ✅ Passed The description matches the template well with Changes, Reference, and Checklist sections filled in and relevant items marked.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/restrict-gateway-cors-defaults

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@darenegade darenegade self-assigned this Jul 20, 2026
Comment on lines -19 to -21
allowedHeaders: "*"
allowCredentials: true
allowedMethods: "*"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be breaking

@simonhir simonhir added the BREAKING Change may cause existing code to break label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING Change may cause existing code to break Component: API-Gateway Issues regarding the API Gateway Type: Documentation The issue contains work for the documentation Type: Maintenance The issue contains maintenance work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants