Record Class SecurityScheme

java.lang.Object
java.lang.Record
dev.relism.flash.ext.security.SecurityScheme
Record Components:
definition - the OpenAPI Security Scheme Object, verbatim
issuer - the authorization server's issuer identifier — "/" when the application is its own, at whatever SecurityExtension.origin(dev.relism.flash.models.Request) it is reached by; null for anything else

public record SecurityScheme(String name, Map<String,Object> definition, String challenge, String issuer) extends Record
A credential as OpenAPI names and defines it, the WWW-Authenticate challenge an anonymous API call receives for it, and — for OAuth — the issuer that grants it.
  • Constructor Details

    • SecurityScheme

      public SecurityScheme(String name, Map<String,Object> definition, String challenge, String issuer)
      Creates an instance of a SecurityScheme record class.
      Parameters:
      name - the value for the name record component
      definition - the value for the definition record component
      challenge - the value for the challenge record component
      issuer - the value for the issuer record component
  • Method Details

    • bearer

      public static SecurityScheme bearer(String name, String bearerFormat)
    • openIdConnect

      public static SecurityScheme openIdConnect(String name, String issuer)
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • definition

      public Map<String,Object> definition()
      Returns the value of the definition record component.
      Returns:
      the value of the definition record component
    • challenge

      public String challenge()
      Returns the value of the challenge record component.
      Returns:
      the value of the challenge record component
    • issuer

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