Record Class TokenInfo

java.lang.Object
java.lang.Record
codes.grow.packages.vault.TokenInfo
Record Components:
id - the token itself (redacted)
accessor - token accessor
policies - policies
ttl - remaining TTL (zero = never expires)
creationTtl - TTL at creation
creationTime - creation time
expireTime - expiry time
issueTime - issue time
renewable - whether the token can be renewed
displayName - display name (token-<name>)
meta - token metadata
numUses - remaining uses (0 = unlimited)
orphan - whether the token has no parent
path - creation path, e.g. auth/approle/login
type - service or batch
explicitMaxTtl - explicit maximum TTL
entityId - identity entity id

public record TokenInfo(Secret id, Optional<Secret> accessor, List<String> policies, Duration ttl, Duration creationTtl, Optional<Instant> creationTime, Optional<Instant> expireTime, Optional<Instant> issueTime, boolean renewable, String displayName, Map<String,String> meta, int numUses, boolean orphan, String path, String type, Duration explicitMaxTtl, String entityId) extends Record
Properties of a token (auth/token/lookup-self).
  • Constructor Details

    • TokenInfo

      public TokenInfo(Secret id, Optional<Secret> accessor, List<String> policies, Duration ttl, Duration creationTtl, Optional<Instant> creationTime, Optional<Instant> expireTime, Optional<Instant> issueTime, boolean renewable, String displayName, Map<String,String> meta, int numUses, boolean orphan, String path, String type, Duration explicitMaxTtl, String entityId)
      Creates the record; collections are copied.
      Parameters:
      id - token
      accessor - accessor
      policies - policies
      ttl - TTL
      creationTtl - creation TTL
      creationTime - creation time
      expireTime - expiry time
      issueTime - issue time
      renewable - renewable flag
      displayName - display name
      meta - metadata
      numUses - remaining uses
      orphan - orphan flag
      path - creation path
      type - token type
      explicitMaxTtl - explicit max TTL
      entityId - entity id
  • 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.
    • id

      public Secret id()
      Returns the value of the id record component.
      Returns:
      the value of the id 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
    • ttl

      public Duration ttl()
      Returns the value of the ttl record component.
      Returns:
      the value of the ttl record component
    • creationTtl

      public Duration creationTtl()
      Returns the value of the creationTtl record component.
      Returns:
      the value of the creationTtl record component
    • creationTime

      public Optional<Instant> creationTime()
      Returns the value of the creationTime record component.
      Returns:
      the value of the creationTime record component
    • expireTime

      public Optional<Instant> expireTime()
      Returns the value of the expireTime record component.
      Returns:
      the value of the expireTime record component
    • issueTime

      public Optional<Instant> issueTime()
      Returns the value of the issueTime record component.
      Returns:
      the value of the issueTime record component
    • renewable

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

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • meta

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

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

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

      public String path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • explicitMaxTtl

      public Duration explicitMaxTtl()
      Returns the value of the explicitMaxTtl record component.
      Returns:
      the value of the explicitMaxTtl record component
    • entityId

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