-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add filter to force WebSession::save. #166
Conversation
Codecov Report
@@ Coverage Diff @@
## master #166 +/- ##
==========================================
+ Coverage 67.07% 69.15% +2.07%
==========================================
Files 4 86 +82
Lines 243 1838 +1595
Branches 17 131 +114
==========================================
+ Hits 163 1271 +1108
- Misses 68 495 +427
- Partials 12 72 +60
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert import formatting and add docs
import org.springframework.cloud.gateway.filter.factory.SetRequestHeaderGatewayFilterFactory; | ||
import org.springframework.cloud.gateway.filter.factory.SetResponseHeaderGatewayFilterFactory; | ||
import org.springframework.cloud.gateway.filter.factory.SetStatusGatewayFilterFactory; | ||
import org.springframework.cloud.gateway.filter.factory.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No star imports please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, undo all import changes for this file except the one add line.
@@ -16,6 +16,8 @@ | |||
|
|||
package org.springframework.cloud.gateway.route.builder; | |||
|
|||
import static org.springframework.tuple.TupleBuilder.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, undo import cleanup.
.expectComplete() | ||
.verify(Duration.ofMinutes(10)); | ||
|
||
verify(mockWebSession, times(2)).getAttributes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is arbitrary, could change. Is it needed?
accb0b9
to
fd5cc2e
Compare
@spencergibb Polished all imports and removed superfluous assertions. |
In some scenarios, such as making a remote call while using Spring Session between two processes, forcing a WebSession::save before making the call ensures that session data is in place on the other side. Resolves spring-cloud#58.
fd5cc2e
to
3cdf9a4
Compare
- SaveSession | ||
---- | ||
|
||
If you are integrating http://projects.spring.io/spring-security/[Spring Security] with Spring Session, and want to ensure security details have been forwarded to the remote process, this is critical. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are integrating Spring Security with Spring Session, ..., this is critical
In this part, does it mean that adding SaveSession
filter is very important and it have to be applied, or adding this filter is dangerous and it should be avoided?
In some scenarios, such as making a remote call while using Spring Session between two processes, forcing a WebSession::save before making the call ensures that session data is in place on the other side.
Resolves #58.