Record Class NrichCsrfProperties
java.lang.Object
java.lang.Record
net.croz.nrich.security.csrf.properties.NrichCsrfProperties
- Record Components:
active- Whether CSRF is active.tokenExpirationInterval- Duration of CSRF token.tokenFutureThreshold- Duration of how long token can be in the future (can happen when server and client time is not in sync).tokenKeyName- Name of CSRF token.cryptoKeyLength- Length of crypto key (128, 256...).initialTokenUrl- Initial application url (i.e. url that user is redirected after login). Token will be added to response from this url ascsrfInitialToken
parameter.csrfPingUri- Uri used for CSRF ping request.csrfExcludeConfigList- A list ofCsrfExcludeConfiginstances that contain urls or regexps excluded from CSRF check.
@ConfigurationProperties("nrich.security.csrf")
public record NrichCsrfProperties(@DefaultValue("true") boolean active, @DefaultValue("35m") Duration tokenExpirationInterval, @DefaultValue("1m") Duration tokenFutureThreshold, @DefaultValue("X-CSRF-Token") String tokenKeyName, @DefaultValue("128") Integer cryptoKeyLength, String initialTokenUrl, @DefaultValue("/nrich/csrf/ping") String csrfPingUri, List<net.croz.nrich.security.csrf.core.model.CsrfExcludeConfig> csrfExcludeConfigList)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionNrichCsrfProperties(boolean active, Duration tokenExpirationInterval, Duration tokenFutureThreshold, String tokenKeyName, Integer cryptoKeyLength, String initialTokenUrl, String csrfPingUri, List<net.croz.nrich.security.csrf.core.model.CsrfExcludeConfig> csrfExcludeConfigList) Creates an instance of aNrichCsrfPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Returns the value of theactiverecord component.Returns the value of thecryptoKeyLengthrecord component.List<net.croz.nrich.security.csrf.core.model.CsrfExcludeConfig>Returns the value of thecsrfExcludeConfigListrecord component.Returns the value of thecsrfPingUrirecord component.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 theinitialTokenUrlrecord component.Returns the value of thetokenExpirationIntervalrecord component.Returns the value of thetokenFutureThresholdrecord component.Returns the value of thetokenKeyNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NrichCsrfProperties
public NrichCsrfProperties(@DefaultValue("true") boolean active, @DefaultValue("35m") Duration tokenExpirationInterval, @DefaultValue("1m") Duration tokenFutureThreshold, @DefaultValue("X-CSRF-Token") String tokenKeyName, @DefaultValue("128") Integer cryptoKeyLength, String initialTokenUrl, @DefaultValue("/nrich/csrf/ping") String csrfPingUri, List<net.croz.nrich.security.csrf.core.model.CsrfExcludeConfig> csrfExcludeConfigList) Creates an instance of aNrichCsrfPropertiesrecord class.- Parameters:
active- the value for theactiverecord componenttokenExpirationInterval- the value for thetokenExpirationIntervalrecord componenttokenFutureThreshold- the value for thetokenFutureThresholdrecord componenttokenKeyName- the value for thetokenKeyNamerecord componentcryptoKeyLength- the value for thecryptoKeyLengthrecord componentinitialTokenUrl- the value for theinitialTokenUrlrecord componentcsrfPingUri- the value for thecsrfPingUrirecord componentcsrfExcludeConfigList- the value for thecsrfExcludeConfigListrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
active
public boolean active()Returns the value of theactiverecord component.- Returns:
- the value of the
activerecord component
-
tokenExpirationInterval
Returns the value of thetokenExpirationIntervalrecord component.- Returns:
- the value of the
tokenExpirationIntervalrecord component
-
tokenFutureThreshold
Returns the value of thetokenFutureThresholdrecord component.- Returns:
- the value of the
tokenFutureThresholdrecord component
-
tokenKeyName
Returns the value of thetokenKeyNamerecord component.- Returns:
- the value of the
tokenKeyNamerecord component
-
cryptoKeyLength
Returns the value of thecryptoKeyLengthrecord component.- Returns:
- the value of the
cryptoKeyLengthrecord component
-
initialTokenUrl
Returns the value of theinitialTokenUrlrecord component.- Returns:
- the value of the
initialTokenUrlrecord component
-
csrfPingUri
Returns the value of thecsrfPingUrirecord component.- Returns:
- the value of the
csrfPingUrirecord component
-
csrfExcludeConfigList
Returns the value of thecsrfExcludeConfigListrecord component.- Returns:
- the value of the
csrfExcludeConfigListrecord component
-