Enum Class TokenSourceChain.Link
- All Implemented Interfaces:
Serializable,Comparable<TokenSourceChain.Link>,Constable
- Enclosing class:
- TokenSourceChain
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAuthSetting.EXTERNAL_ISSUER- the workload's own authorization server, at which this SDK performs the client-credentials grant with the workload's own secret.AuthSetting.EXTERNAL_TOKEN- the token, supplied verbatim.AuthSetting.EXTERNAL_TOKEN_COMMAND- a command that prints the token.AuthSetting.EXTERNAL_TOKEN_FILE- a file holding the current token.AuthSetting.CLIENT_SECRET- the platform's own credential. -
Method Summary
Modifier and TypeMethodDescriptionEvery companion, required first.Which external source kind this link names, if any - a declared mapping, never a name correspondence.booleanThe settings this credential cannot be used without.static TokenSourceChain.LinkReturns the enum constant of this class with the specified name.static TokenSourceChain.Link[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
EXTERNAL_TOKEN
AuthSetting.EXTERNAL_TOKEN- the token, supplied verbatim. -
EXTERNAL_TOKEN_FILE
AuthSetting.EXTERNAL_TOKEN_FILE- a file holding the current token. -
EXTERNAL_TOKEN_COMMAND
AuthSetting.EXTERNAL_TOKEN_COMMAND- a command that prints the token. -
EXTERNAL_CLIENT_CREDENTIALS
AuthSetting.EXTERNAL_ISSUER- the workload's own authorization server, at which this SDK performs the client-credentials grant with the workload's own secret.Two required companions and two optional ones, which is the shape a single
companionsRequiredflag could not have carried. The registration and its secret are required because no grant is possible without them.AuthSetting.EXTERNAL_AUDIENCEandAuthSetting.EXTERNAL_SCOPEare the two spellings of ONE question - which token the external server should mint - and which spelling a server understands is the server's choice, not ours:audienceis a vendor extension rather than an RFC 6749 §4.4 parameter, and other servers derive the same thing fromscopeand have noaudienceparameter at all. Demandingaudiencewould force those deployments to invent a value that is then POSTed to an endpoint which ignores it; demandingscopewould refuse the deployments that useaudience.So neither is required individually and
TokenSourceChain.resolve(co.ankatech.ankasecure.openapi.client.AnkaSecureOpenApiClient, co.ankatech.ankasecure.sdk.auth.AuthSettings)refuses a configuration carrying NEITHER - which is the real requirement, and one no per-setting flag can state. -
ACTOR_KEY_PAIR
-
NATIVE_CLIENT_SECRET
AuthSetting.CLIENT_SECRET- the platform's own credential.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
credential
- Returns:
- the setting whose presence constitutes this credential; never
null
-
mechanism
- Returns:
- the credential kind this link presents
-
requiredCompanions
The settings this credential cannot be used without. Separate fromoptionalCompanions()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
- Returns:
- the settings that qualify this credential without constituting it and without
being demanded; possibly empty, never
null
-
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
Which external source kind this link names, if any - a declared mapping, never a name correspondence.ExternalTokenSourceKindis provider-side and consumer-extensible throughExternalTokenProvider.kind(); aLinkis 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:
truewhen this link is one of the external-token spellings, among which simultaneous configuration is an error rather than a preference
-