Skip to content

feat(core): migrate to allowedOriginPatterns for credentialed CORS#46

Open
OmarAitBenaissa wants to merge 1 commit intomainfrom
feat/Update-cors-configuration-to-allowedPatterns-origins
Open

feat(core): migrate to allowedOriginPatterns for credentialed CORS#46
OmarAitBenaissa wants to merge 1 commit intomainfrom
feat/Update-cors-configuration-to-allowedPatterns-origins

Conversation

@OmarAitBenaissa
Copy link
Copy Markdown
Collaborator

PR Description

This pull request updates the application's CORS configuration to use allowed-origin-patterns and allowed-origins, aligning with more flexible and modern Spring CORS configuration practices. The change ensures that origin matching can use patterns (such as wildcards), which is more robust for various deployment scenarios.

What this PR Provides

CORS Configuration Updates:

  • Changed the CorsProperties record to use allowedOriginPatterns and allowedOrigins, and updated the null check accordingly (CorsProperties.java).
  • Updated the corsConfigurationSource bean to call setAllowedOriginPatterns instead of setAllowedOrigins (SecurityConfiguration.java).

Configuration File Adjustments:

  • Modified application.yml to use the allowed-origin-patterns property and its corresponding environment variable, replacing allowed-origins (application.yml).… prevent wildcard + credentials conflicts and allows controlled subdomain matching.

Review

The reviewer must double-check these points:

  • The reviewer has tested the feature
  • The reviewer has reviewed the implementation of the feature
  • The documentation has been updated
  • The feature implementation respects the Technical Doc / ADR previously produced

… prevent wildcard + credentials conflicts and allows controlled subdomain matching.

Signed-off-by: OmarAitBenaissa <omar.aitbenaissa.partner@decathlon.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants