Record Class TimeoutSessionPolicy.Config
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.session.TimeoutSessionPolicy.Config
- Record Components:
idleTimeout- maximum allowed time since the last observed activity before the session is treated as idle-timeoutabsoluteLifetime- maximum allowed time since session creation, regardless of activityrotateSessionAfterLogin- iftrue,onLoginreturnsInvalidateso the adapter rotates the HTTP session idloginRoute- route used for theInvalidatedecision in thebeforeNavigationcontext (ignored after login rotation)
- Enclosing class:
TimeoutSessionPolicy<U>
public static record TimeoutSessionPolicy.Config(Duration idleTimeout, Duration absoluteLifetime, boolean rotateSessionAfterLogin, String loginRoute)
extends Record
Tunable thresholds.
When rotateSessionAfterLogin is true,
TimeoutSessionPolicy.onLogin(SessionContext) returns
SessionDecision.Invalidate so the calling adapter rotates
the underlying session id. The Vaadin LoginView honours this
by calling VaadinService.reinitializeSession(VaadinRequest) —
the VaadinSession (and therefore the just-bound subject)
survives the rotation; only the HTTP session id changes. The
REST adapter has no equivalent — tokens themselves are the session,
and there is no fixation surface to mitigate.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theabsoluteLifetimerecord component.static TimeoutSessionPolicy.Configdefaults()Sensible defaults — 30 min idle, 12 h absolute, rotate after login, /login.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theidleTimeoutrecord component.Returns the value of theloginRouterecord component.booleanReturns the value of therotateSessionAfterLoginrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Config
public Config(Duration idleTimeout, Duration absoluteLifetime, boolean rotateSessionAfterLogin, String loginRoute) Creates an instance of aConfigrecord class.- Parameters:
idleTimeout- the value for theidleTimeoutrecord componentabsoluteLifetime- the value for theabsoluteLifetimerecord componentrotateSessionAfterLogin- the value for therotateSessionAfterLoginrecord componentloginRoute- the value for theloginRouterecord component
-
-
Method Details
-
defaults
Sensible defaults — 30 min idle, 12 h absolute, rotate after login, /login. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
idleTimeout
Returns the value of theidleTimeoutrecord component.- Returns:
- the value of the
idleTimeoutrecord component
-
absoluteLifetime
Returns the value of theabsoluteLifetimerecord component.- Returns:
- the value of the
absoluteLifetimerecord component
-
rotateSessionAfterLogin
public boolean rotateSessionAfterLogin()Returns the value of therotateSessionAfterLoginrecord component.- Returns:
- the value of the
rotateSessionAfterLoginrecord component
-
loginRoute
Returns the value of theloginRouterecord component.- Returns:
- the value of the
loginRouterecord component
-