Skip to content

Missing reactive DelegatingRequestMatcherHeaderWriter #11073

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

Closed
Dav1dde opened this issue Apr 7, 2022 · 7 comments
Closed

Missing reactive DelegatingRequestMatcherHeaderWriter #11073

Dav1dde opened this issue Apr 7, 2022 · 7 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement
Milestone

Comments

@Dav1dde
Copy link
Contributor

Dav1dde commented Apr 7, 2022

Expected Behavior

Non-Reactive Spring Security has a DelegatingRequestMatcherHeaderWriter

Current Behavior

There is no implementation of ServerHttpHeadersWriter which allows the user to write certain headers for only certain paths.

Context

I am trying to not have one endpoint set X-Frame-Options, which you can do in non-reactive Spring Security using a DelegatingRequestMatcherHeaderWriter.

@Dav1dde Dav1dde added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Apr 7, 2022
@marcusdacoregio marcusdacoregio added in: web An issue in web modules (web, webmvc) status: ideal-for-contribution An issue that we actively are looking for someone to help us with and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 7, 2022
@marcusdacoregio
Copy link
Contributor

Hi @Dav1dde.

Are you interested in submitting a PR that adds the new implementation?

@Dav1dde
Copy link
Contributor Author

Dav1dde commented Apr 9, 2022

Yeah for sure, I can look into it. I pretty much already have an implementation in my project which just needs some cleaning up. I assume the reactive implementation would use a ServerWebExchangeMatcher? Does it make sense to have a 2nd version or an overloaded constructor that accepts a PathPattern directly?

@marcusdacoregio
Copy link
Contributor

You can pretty much follow the implementation of DelegatingRequestMatcherHeaderWriter. I think it makes more sense to use ServerWebExchangeMatcher and let folks decide which implementation they want.

@Dav1dde
Copy link
Contributor Author

Dav1dde commented Apr 14, 2022

@marcusdacoregio After many tries to configure the code style in IntelliJ correctly and failing I finally fixed the import order by hand and submitted the PR ;)

I tried to keep it as close as possible to the servlet version, implementation and test

@marcusdacoregio
Copy link
Contributor

What were the problems that you faced when working with the codebase?

@Dav1dde
Copy link
Contributor Author

Dav1dde commented Apr 19, 2022

I just couldnt get the auto formatting or syntax checking get to work. Another issue was that the gradlew from the cli always errored (with some weird errors in docstrings with non ascii characters), it worked from IntelliJ though.

I tried to get it to work by importing the eclipse settings, setting up checkstyle, neither worked. Also the gradle format just didnt format the imports properly.

@marcusdacoregio
Copy link
Contributor

Unfortunately, there's a limitation with the formatting tool that does not organize the imports properly. Thanks for your feedback, I'll try to make it easier for folks to set up their environment by following the CONTRIBUTING doc.

I have created #11157 to track the improvement in the CONTRIBUTING doc.

@marcusdacoregio marcusdacoregio added this to the 5.8.x milestone Apr 25, 2022
@marcusdacoregio marcusdacoregio modified the milestones: 5.8.x, 5.8.0-M1 May 6, 2022
marcusdacoregio pushed a commit that referenced this issue May 6, 2022
Servlet Spring Security has DelegatingRequestMatcherHeaderWriter
the reactive world of Spring Security was missing a class to
conditionally write headers.

Closes gh-11073
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants