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

Allow maximum age of csrf cookie to be configured #9196

Merged
merged 2 commits into from Dec 9, 2020

Conversation

sedran
Copy link
Contributor

@sedran sedran commented Nov 8, 2020

Allows maxAge of the generated cookie by CookieCsrfTokenRepository
to be configurable.

Prior to this commit, maximum age was set with a value of -1.

After this commit, it will be configured by the user with an either
positive or negative value. If the user does not provide a value,
it will be set -1.

An IllegalArgumentException will be thrown when
this value is set to zero.

Closes gh-9195

Allows maxAge of the generated cookie by CookieCsrfTokenRepository
to be configurable.

Prior to this commit, maximum age was set with a value of -1.

After this commit, it will be configured by the user with an either
positive or negative value. If the user does not provide a value,
it will be set -1.

An IllegalArgumentException will be thrown when
this value is set to zero.

Closes spring-projectsgh-9195
Copy link
Member

@rwinch rwinch left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I've provided feedback inline.

@sedran
Copy link
Contributor Author

sedran commented Nov 14, 2020

The automated build fails because of a dependency error from spring maven repository. How can we solve that?

> Could not HEAD 'https://repo.spring.io/libs-snapshot/org/infinispan/infinispan-bom/11.0.5.Final/infinispan-bom-11.0.5.Final.pom'. 
Received status code 401 from server: Unauthorized

Changes assertion message format from 'X is not null' to
'X cannot be null' since this is more meaningful when the error
occurs and the message is printed in the logs.

Closes spring-projectsgh-9195
@jzheaux
Copy link
Contributor

jzheaux commented Nov 25, 2020

Sorry for the issue you experienced with the build, @sedran - it was due to an infrastructural change with Spring's Maven repositories.

If you rebase, then the error should be addressed.

@sedran
Copy link
Contributor Author

sedran commented Nov 28, 2020

Sorry for the issue you experienced with the build, @sedran - it was due to an infrastructural change with Spring's Maven repositories.

If you rebase, then the error should be addressed.

I have amend/force-pushed my branch to trigger auto build as soon as I see the CI status of the project is green.
Now I can see "All checks have passed" text and there is no conflict. I also implemented the requested changes by @rwinch .

Is there anything I can do for this PR to be merged? Please let me know.

Thanks.

@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 30, 2020
Copy link
Member

@rwinch rwinch left a comment

Choose a reason for hiding this comment

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

Thanks for the updates and the ping. The changes look good to me

@rwinch rwinch added this to the 5.5.0-M2 milestone Dec 9, 2020
@rwinch rwinch merged commit 48ef27b into spring-projects:master Dec 9, 2020
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) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maximum Age for the cookie created by CookieCsrfTokenRepository
4 participants