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 (default false).
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_cert of 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 8176 amr value the factor reports: sc (smart card, the default) or hwk (a hardware-bound key).
keyStore - path of the key store with the server certificate of the dedicated port; with the dev profile 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 (default PKCS12).

@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 Details

    • enabled

      private final boolean enabled
      The field for the enabled record component.
    • forwardedHeader

      private final String forwardedHeader
      The field for the forwardedHeader record component.
    • trustedProxies

      private final List<String> trustedProxies
      The field for the trustedProxies record component.
    • port

      private final int port
      The field for the port record component.
    • amr

      private final String amr
      The field for the amr record component.
    • keyStore

      private final String keyStore
      The field for the keyStore record component.
    • keyStorePassword

      private final String keyStorePassword
      The field for the keyStorePassword record component.
    • keyStoreType

      private final String keyStoreType
      The field for the keyStoreType record component.
    • AMR_SMART_CARD

      public static final String AMR_SMART_CARD
      amr value of a smart card.
      See Also:
    • AMR_HARDWARE_KEY

      public static final String AMR_HARDWARE_KEY
      amr value of a key held in hardware.
      See Also:
    • MAX_PORT

      private static final int MAX_PORT
      Highest 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, the amr value is not sc or hwk, 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:
      true when a header name is configured.
    • tlsEnabled

      public boolean tlsEnabled()
      Tells whether the dedicated TLS connector is requested.
      Returns:
      true when a port is configured.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • forwardedHeader

      public String forwardedHeader()
      Returns the value of the forwardedHeader record component.
      Returns:
      the value of the forwardedHeader record component
    • trustedProxies

      public List<String> trustedProxies()
      Returns the value of the trustedProxies record component.
      Returns:
      the value of the trustedProxies record component
    • port

      public int port()
      Returns the value of the port record component.
      Returns:
      the value of the port record component
    • amr

      public String amr()
      Returns the value of the amr record component.
      Returns:
      the value of the amr record component
    • keyStore

      public String keyStore()
      Returns the value of the keyStore record component.
      Returns:
      the value of the keyStore record component
    • keyStorePassword

      public String keyStorePassword()
      Returns the value of the keyStorePassword record component.
      Returns:
      the value of the keyStorePassword record component
    • keyStoreType

      public String keyStoreType()
      Returns the value of the keyStoreType record component.
      Returns:
      the value of the keyStoreType record component