Enum Class TokenSourceChain.Link

java.lang.Object
java.lang.Enum<TokenSourceChain.Link>
co.ankatech.ankasecure.sdk.auth.TokenSourceChain.Link
All Implemented Interfaces:
Serializable, Comparable<TokenSourceChain.Link>, Constable
Enclosing class:
TokenSourceChain

public static enum TokenSourceChain.Link extends Enum<TokenSourceChain.Link>
One resolvable credential configuration, in the order they are considered. Every fact about a credential kind is declared here, once - constituting setting, companions, mechanism, external source kind - so adding a kind is editing exactly one place. A second enumeration of these facts lived in the CLI and had already drifted on one constant's spelling; a guard that DETECTS the missed second edit is not the property of there being no second place to edit.
  • Enum Constant Details

  • Method Details

    • values

      public static TokenSourceChain.Link[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TokenSourceChain.Link valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • credential

      public AuthSetting credential()
      Returns:
      the setting whose presence constitutes this credential; never null
    • mechanism

      public AuthMechanism mechanism()
      Returns:
      the credential kind this link presents
    • requiredCompanions

      public List<AuthSetting> requiredCompanions()
      The settings this credential cannot be used without. Separate from optionalCompanions() rather than one list plus a boolean, because a link may carry both kinds and both encodings then fail: all-required makes an optional value mandatory, required-only leaves the optional one with no owner - neither refused as an orphan nor cleared when its credential is superseded.
      Returns:
      the required companions, possibly empty; never null
    • optionalCompanions

      public List<AuthSetting> optionalCompanions()
      Returns:
      the settings that qualify this credential without constituting it and without being demanded; possibly empty, never null
    • companions

      public List<AuthSetting> companions()
      Every companion, required first. Orphan detection and supersession clearing key on this union: both ask whether a value has an owner, not whether it is demanded.
      Returns:
      the union of both companion lists; never null
    • externalKind

      public Optional<ExternalTokenSourceKind> externalKind()
      Which external source kind this link names, if any - a declared mapping, never a name correspondence. ExternalTokenSourceKind is provider-side and consumer-extensible through ExternalTokenProvider.kind(); a Link is a configuration a deployment writes down. Their names differ for all four, so a guard asserting they matched would be red the day it was written - the mapping is what has to hold.
      Returns:
      the kind, or empty when this link names no externally minted token
    • isExternalTokenSource

      public boolean isExternalTokenSource()
      Returns:
      true when this link is one of the external-token spellings, among which simultaneous configuration is an error rather than a preference