Record Class AuthInfo

java.lang.Object
java.lang.Record
codes.grow.packages.vault.AuthInfo
Record Components:
clientToken - the client token
accessor - token accessor, when returned
policies - all policies of the token
tokenPolicies - policies attached to the token itself
metadata - auth metadata (e.g. role_name, username)
leaseDuration - token TTL (zero = never expires)
renewable - whether the token can be renewed
entityId - identity entity id
tokenType - service or batch
orphan - whether the token has no parent
numUses - remaining uses (0 = unlimited)

public record AuthInfo(Secret clientToken, Optional<Secret> accessor, List<String> policies, List<String> tokenPolicies, Map<String,String> metadata, Duration leaseDuration, boolean renewable, String entityId, String tokenType, boolean orphan, int numUses) extends Record
The auth block of a login, token creation or renewal. Tokens are Secrets and never printed.
  • Constructor Details

    • AuthInfo

      public AuthInfo(Secret clientToken, Optional<Secret> accessor, List<String> policies, List<String> tokenPolicies, Map<String,String> metadata, Duration leaseDuration, boolean renewable, String entityId, String tokenType, boolean orphan, int numUses)
      Creates the record; collections are copied.
      Parameters:
      clientToken - token
      accessor - accessor
      policies - policies
      tokenPolicies - token policies
      metadata - metadata
      leaseDuration - TTL
      renewable - renewable flag
      entityId - entity id
      tokenType - token type
      orphan - orphan flag
      numUses - remaining uses
  • Method Details

    • 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.
    • clientToken

      public Secret clientToken()
      Returns the value of the clientToken record component.
      Returns:
      the value of the clientToken record component
    • accessor

      public Optional<Secret> accessor()
      Returns the value of the accessor record component.
      Returns:
      the value of the accessor record component
    • policies

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

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

      public Map<String,String> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • leaseDuration

      public Duration leaseDuration()
      Returns the value of the leaseDuration record component.
      Returns:
      the value of the leaseDuration record component
    • renewable

      public boolean renewable()
      Returns the value of the renewable record component.
      Returns:
      the value of the renewable record component
    • entityId

      public String entityId()
      Returns the value of the entityId record component.
      Returns:
      the value of the entityId record component
    • tokenType

      public String tokenType()
      Returns the value of the tokenType record component.
      Returns:
      the value of the tokenType record component
    • orphan

      public boolean orphan()
      Returns the value of the orphan record component.
      Returns:
      the value of the orphan record component
    • numUses

      public int numUses()
      Returns the value of the numUses record component.
      Returns:
      the value of the numUses record component