Skip to content
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

feat: Add configurable CORS Headers #3114

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

josiah-lunit
Copy link
Contributor

Overview

The CORS enforced endpoints only allow the Authorization header by default, and this behavior is not configurable. For some environments, it is desirable to allow configuration of which headers should be accepted (e.g. when using Swagger UI with a Dex IDP, which for instance inserts a x-requested-with header to the CORS preflight check).

What this PR does / why we need it

This PR allows the AllowedHeaders for CORS endpoints to be configurable, so that the host can decide if headers should be rejected or not. By default, the Authorization header will be accepted to not interfere with any existing setups of Dex if no allowedHeaders are defined in the config.yaml file.

Does this PR introduce a user-facing change?

Yes

Adds a configuration option `allowedHeaders` in the `web` section of `config.yaml` to change which headers are accepted on CORS requests.

Signed-off-by: Josiah Evans <josiah.evans@lunit.io>
@josiah-lunit josiah-lunit force-pushed the feature/add-config-headers branch from bc8c846 to 726a55e Compare September 21, 2023 06:23
Copy link
Member

@nabokihms nabokihms left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. LGTM.

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