Class AuthenticationTokenContext<T>
java.lang.Object
jenkins.authentication.tokens.api.AuthenticationTokenContext<T>
- Type Parameters:
T
- the type of token
The context within which an authentication token will be used.
- Since:
- 1.2
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A non-thread safe builder ofAuthenticationTokenContext
instances. -
Constructor Summary
ConstructorDescriptionAuthenticationTokenContext
(Class<T> tokenClass) Creates a basic context for any purpose. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> AuthenticationTokenContext.Builder<T>
Creates aAuthenticationTokenContext.Builder
for contexts of the specified token type.boolean
Checks if the context specifies the supplied purpose and matches against the valid values.Returns the type of token.boolean
Ensures the context specifies the supplied purpose matching against the valid values.
-
Constructor Details
-
AuthenticationTokenContext
Creates a basic context for any purpose.- Parameters:
tokenClass
- the type of token.
-
-
Method Details
-
builder
Creates aAuthenticationTokenContext.Builder
for contexts of the specified token type.- Type Parameters:
T
- the type of token.- Parameters:
tokenClass
- the type of token.- Returns:
- a
AuthenticationTokenContext.Builder
instance.
-
getTokenClass
Returns the type of token.- Returns:
- the type of token.
-
canHave
Checks if the context specifies the supplied purpose and matches against the valid values.- Parameters:
purpose
- the purpose.validValues
- the valid values that the purpose must match if specified.- Returns:
true
if either the purpose is not specified or the purpose is specified and is equal to one of the specified values.
-
mustHave
Ensures the context specifies the supplied purpose matching against the valid values.- Parameters:
purpose
- the purpose.validValues
- the valid values that the purpose must match.- Returns:
true
if and only if the purpose is specified and is equal to one of the specified values.
-