Class Tokens
java.lang.Object
com.linecorp.centraldogma.server.metadata.Tokens
Holds a token map and a secret map for fast lookup.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappIds()
Returns the applicationToken
s.findBySecret
(String secret) Returns theToken
that corresponds to the specified secret.findBySecretOrDefault
(String secret, Token defaultValue) Returns theToken
that corresponds to the specified secret.Returns theToken
that corresponds to the specified application ID.getOrDefault
(String appId, Token defaultValue) Returns theToken
that corresponds to the specified application ID.static boolean
isValidSecret
(String secret) Returnstrue
if the specified secret is valid.secrets()
Returns the secrets.toString()
static void
validateSecret
(String secret) Throws anIllegalArgumentException
if the specified secret is not valid.Returns a newTokens
which does not contain any secrets.
-
Constructor Details
-
Tokens
public Tokens()Creates a new empty instance. -
Tokens
Creates a new instance with the given application IDs and secrets.
-
-
Method Details
-
appIds
Returns the applicationToken
s. -
secrets
Returns the secrets. -
get
Returns theToken
that corresponds to the specified application ID. -
getOrDefault
Returns theToken
that corresponds to the specified application ID.defaultValue
is returned if there's no such application. -
findBySecret
Returns theToken
that corresponds to the specified secret. -
findBySecretOrDefault
Returns theToken
that corresponds to the specified secret.defaultValue
is returned if there's no such secret. -
withoutSecret
Returns a newTokens
which does not contain any secrets. -
toString
-
isValidSecret
Returnstrue
if the specified secret is valid. -
validateSecret
Throws anIllegalArgumentException
if the specified secret is not valid.
-