8000 #12682 [CORS] Allow Access-Control-Allow-Headers customization by dteleguin · Pull Request #40011 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

#12682 [CORS] Allow Access-Control-Allow-Headers customization #40011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dteleguin
Copy link
Contributor
@dteleguin dteleguin commented May 28, 2025

This PR adds the ability to programmatically customize the Access-Control-Allow-Headers CORS header returned by Keycloak.

Highlights:

  • HeaderSet is a TreeSet<String> wrapper featuring fast clone operation (HeaderSet.copyOf()) and cached string representation. It is currently used for DefaultCors#allowedHeaders and Cors#DEFAULT_ALLOW_HEADERS only, but could be potentially used for other fields in the future;
  • the DefaultCors constructor is made public so that the extensions could reuse it.

Closes: #12682

@dteleguin dteleguin requested a review from a team as a code owner May 28, 2025 01:01
@dteleguin dteleguin force-pushed the feature/#12682-CORS-custom-headers-take3 branch from a1afb4c to d793a68 Compare May 28, 2025 01:02
Signed-off-by: Dmitry Telegin <demetrio@carretti.pro>
@dteleguin dteleguin force-pushed the feature/#12682-CORS-custom-headers-take3 branch from d793a68 to e59c284 Compare May 28, 2025 08:48
Copy link
@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.webauthn.account.WebAuthnSigningInTest#checkAuthenticatorTimeLocale

Keycloak CI - WebAuthn IT (chrome)

java.text.ParseException: Unparseable date: "May 28, 2025, 9:16 AM"
	at java.base/java.text.DateFormat.parse(DateFormat.java:399)
	at org.keycloak.testsuite.webauthn.account.WebAuthnSigningInTest.checkAuthenticatorTimeLocale(WebAuthnSigningInTest.java:320)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
...

Report flaky test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CORS] Allow Access-Control-Allow-Headers customization
1 participant
0