Module quak.framework.security
Record Class SecurityConfig
java.lang.Object
java.lang.Record
io.john.amiscaray.quak.security.config.SecurityConfig
- Record Components:
authenticationStrategy- The authentication strategy to use for secured endpoints.securedEndpointRoles- A map representing the roles to use to secure a given endpoint.pathCorsConfigMap- A map of paths and their CORS config.jwtSecretKey- The JWT secret key to use if using the JWT authentication strategy.jwtSecretExpiryTime- The JWT expiry time to use if using the JWT authentication strategy.
public record SecurityConfig(AuthenticationStrategy authenticationStrategy, Map<EndpointMapping,List<Role>> securedEndpointRoles, Map<String,CORSConfig> pathCorsConfigMap, String jwtSecretKey, Long jwtSecretExpiryTime)
extends Record
The Application's security config.
-
Constructor Summary
ConstructorsConstructorDescriptionSecurityConfig(AuthenticationStrategy strategy, Map<EndpointMapping, List<Role>> securedEndpointRoles) Create a security config allowing all CORS and using JWT.SecurityConfig(AuthenticationStrategy authenticationStrategy, Map<EndpointMapping, List<Role>> securedEndpointRoles, Map<String, CORSConfig> pathCorsConfigMap, String jwtSecretKey, Long jwtSecretExpiryTime) Creates an instance of aSecurityConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theauthenticationStrategyrecord 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 thejwtSecretExpiryTimerecord component.Returns the value of thejwtSecretKeyrecord component.Returns the value of thepathCorsConfigMaprecord component.Returns the value of thesecuredEndpointRolesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SecurityConfig
public SecurityConfig(AuthenticationStrategy authenticationStrategy, Map<EndpointMapping, List<Role>> securedEndpointRoles, Map<String, CORSConfig> pathCorsConfigMap, String jwtSecretKey, Long jwtSecretExpiryTime) Creates an instance of aSecurityConfigrecord class.- Parameters:
authenticationStrategy- the value for theauthenticationStrategyrecord componentsecuredEndpointRoles- the value for thesecuredEndpointRolesrecord componentpathCorsConfigMap- the value for thepathCorsConfigMaprecord componentjwtSecretKey- the value for thejwtSecretKeyrecord componentjwtSecretExpiryTime- the value for thejwtSecretExpiryTimerecord component
-
SecurityConfig
public SecurityConfig(AuthenticationStrategy strategy, Map<EndpointMapping, List<Role>> securedEndpointRoles) Create a security config allowing all CORS and using JWT.- Parameters:
strategy- The authentication strategy.securedEndpointRoles- A map representing the roles to use to secure a given endpoint.
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
authenticationStrategy
Returns the value of theauthenticationStrategyrecord component.- Returns:
- the value of the
authenticationStrategyrecord component
-
securedEndpointRoles
Returns the value of thesecuredEndpointRolesrecord component.- Returns:
- the value of the
securedEndpointRolesrecord component
-
pathCorsConfigMap
Returns the value of thepathCorsConfigMaprecord component.- Returns:
- the value of the
pathCorsConfigMaprecord component
-
jwtSecretKey
Returns the value of thejwtSecretKeyrecord component.- Returns:
- the value of the
jwtSecretKeyrecord component
-
jwtSecretExpiryTime
Returns the value of thejwtSecretExpiryTimerecord component.- Returns:
- the value of the
jwtSecretExpiryTimerecord component
-