Record Class X509Properties
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.api.web.x509.X509Properties
- Record Components:
enabled- whether the sign-in with a client certificate exists at all (defaultfalse).forwardedHeader- name of the request header in which a trusted reverse proxy forwards the client certificate it verified (PEM, URL-encoded as$ssl_client_escaped_certof nginx does, or the base64 of the DER form); empty (the default) turns the forwarded transport off.trustedProxies- addresses or CIDR ranges of the proxies that may forward a certificate; required when the header is set, and a request from any other address never has its header read.port- port of the dedicated TLS connector that requests a client certificate;0(the default) turns the direct transport off.amr- RFC 8176amrvalue the factor reports:sc(smart card, the default) orhwk(a hardware-bound key).keyStore- path of the key store with the server certificate of the dedicated port; with thedevprofile and none configured, a self-signed one is generated at the first start under~/.irurueta-auth-server/.keyStorePassword- password of the key store (and of its key), from the environment, never from a file.keyStoreType- type of the key store (defaultPKCS12).
@ConfigurationProperties(prefix="authserver.x509")
public record X509Properties(boolean enabled, String forwardedHeader, List<String> trustedProxies, int port, String amr, String keyStore, String keyStorePassword, String keyStoreType)
extends Record
Configuration of the sign-in with a client certificate (
authserver.x509.*). It is off by default.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theamrrecord component.static final Stringamrvalue of a key held in hardware.static final Stringamrvalue of a smart card.private final booleanThe field for theenabledrecord component.private final StringThe field for theforwardedHeaderrecord component.private final StringThe field for thekeyStorerecord component.private final StringThe field for thekeyStorePasswordrecord component.private final StringThe field for thekeyStoreTyperecord component.private static final intHighest TCP port.private final intThe field for theportrecord component.The field for thetrustedProxiesrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionamr()Returns the value of theamrrecord component.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanTells whether the certificate may arrive in a header.Returns the value of theforwardedHeaderrecord component.final inthashCode()Returns a hash code value for this object.keyStore()Returns the value of thekeyStorerecord component.Returns the value of thekeyStorePasswordrecord component.Returns the value of thekeyStoreTyperecord component.intport()Returns the value of theportrecord component.booleanTells whether the dedicated TLS connector is requested.final StringtoString()Returns a string representation of this record class.Returns the value of thetrustedProxiesrecord component.
-
Field Details
-
enabled
private final boolean enabledThe field for theenabledrecord component. -
forwardedHeader
The field for theforwardedHeaderrecord component. -
trustedProxies
The field for thetrustedProxiesrecord component. -
port
private final int portThe field for theportrecord component. -
amr
The field for theamrrecord component. -
keyStore
The field for thekeyStorerecord component. -
keyStorePassword
The field for thekeyStorePasswordrecord component. -
keyStoreType
The field for thekeyStoreTyperecord component. -
AMR_SMART_CARD
amrvalue of a smart card.- See Also:
-
AMR_HARDWARE_KEY
amrvalue of a key held in hardware.- See Also:
-
MAX_PORT
private static final int MAX_PORTHighest TCP port.- See Also:
-
-
Constructor Details
-
X509Properties
public X509Properties(@DefaultValue("false") boolean enabled, @DefaultValue("") String forwardedHeader, @DefaultValue List<String> trustedProxies, @DefaultValue("0") int port, @DefaultValue("sc") String amr, @DefaultValue("") String keyStore, @DefaultValue("") String keyStorePassword, @DefaultValue("PKCS12") String keyStoreType) Validates the configuration and copies the list.- Throws:
IllegalArgumentException- if the port is out of range, theamrvalue is notscorhwk, a trusted proxy is not an address or a range, or a forwarded header is set without any trusted proxy.
-
-
Method Details
-
forwardedEnabled
public boolean forwardedEnabled()Tells whether the certificate may arrive in a header.- Returns:
truewhen a header name is configured.
-
tlsEnabled
public boolean tlsEnabled()Tells whether the dedicated TLS connector is requested.- Returns:
truewhen a port is configured.
-
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 '=='. -
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
forwardedHeader
Returns the value of theforwardedHeaderrecord component.- Returns:
- the value of the
forwardedHeaderrecord component
-
trustedProxies
Returns the value of thetrustedProxiesrecord component.- Returns:
- the value of the
trustedProxiesrecord component
-
port
public int port()Returns the value of theportrecord component.- Returns:
- the value of the
portrecord component
-
amr
Returns the value of theamrrecord component.- Returns:
- the value of the
amrrecord component
-
keyStore
Returns the value of thekeyStorerecord component.- Returns:
- the value of the
keyStorerecord component
-
keyStorePassword
Returns the value of thekeyStorePasswordrecord component.- Returns:
- the value of the
keyStorePasswordrecord component
-
keyStoreType
Returns the value of thekeyStoreTyperecord component.- Returns:
- the value of the
keyStoreTyperecord component
-