Skip to content

Conversation

@mvitz
Copy link
Contributor

@mvitz mvitz commented Jul 11, 2018

Adds CookieVerificationFailureHandler which can be used to customise the behaviour for handling invalid cookies.

Closes #1

@mvitz mvitz force-pushed the feature/issue-1_invalid-cookie-failure-handling-strategy branch from c5e8562 to 83913ee Compare July 11, 2018 10:21
if (signatureAndPayload.length != 2) {
// TODO logging
return null;
return verificationFailureHandler.onInvalidValue(value);
Copy link
Member

Choose a reason for hiding this comment

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

What is the semantics of this failure, i.e. what went wrong? And is is worth distinguishing between onInvalidValue() and onInvalidSignature()? In both cases, the content of the cookie was not as expected.


List<FlashMap> onInvalidValue(String value);

List<FlashMap> onInvalidSignature(String payload, String signature);
Copy link
Member

Choose a reason for hiding this comment

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

Would it be legal to throw e.g. an IllegalStateException in case the signature is invalid? I assume that would lead to a 500 in Spring MVC, which would be good.

@mvitz mvitz force-pushed the feature/issue-1_invalid-cookie-failure-handling-strategy branch from 83913ee to f4923fc Compare November 7, 2019 10:41
mvitz added 2 commits April 11, 2020 13:15
This feature allows to customise the behaviour of what should be done in
case the cookie can not be verified.

By default the cookie is silently ignored, as before.

Closes #1
@mvitz mvitz force-pushed the feature/issue-1_invalid-cookie-failure-handling-strategy branch from f4923fc to 6d9bd90 Compare April 11, 2020 11:18
@mvitz mvitz changed the base branch from master to main June 15, 2020 20:08
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.

3 participants