Class CreateToken.Request
java.lang.Object
io.helidon.integrations.common.rest.ApiJsonBuilder<CreateToken.Request>
io.helidon.integrations.common.rest.ApiJsonRequest<CreateToken.Request>
io.helidon.integrations.vault.VaultRequest<CreateToken.Request>
io.helidon.integrations.vault.auths.token.CreateToken.Request
- All Implemented Interfaces:
ApiRequest<CreateToken.Request>
- Enclosing class:
CreateToken
Request object. Can be configured with additional headers, query parameters etc.
-
Method Summary
Modifier and TypeMethodDescriptionaddMetadata
(String key, String value) Request metadata, passed through to the audit devices.Add a policy for the token.static CreateToken.Request
builder()
Fluent API builder for configuring a request.displayName
(String displayName) The display name of the token.entityAlias
(String entityAlias) Name of the entity alias to associate with during token creation.explicitMaxTtl
(Duration explicitMaxTtl) If set, the token will have an explicit max TTL set upon it.The ID of the client token.noDefaultPolicy
(boolean noDefaultPolicy) If configured totrue
, thedefault
policy will not be contained in this token's policy set.noParent
(boolean noParent) This argument only has effect if used by a root or sudo caller.numUses
(int numUses) The maximum uses for the given token.If specified, the token will be periodic; it will have no maximum TTL (unless an "explicit-max-ttl" is also set) but every renewal will use the given period.renewable
(boolean renewable) Set tofalse
to disable the ability of the token to be renewed past its initial TTL.The name of the token role.The TTL period of the token.Choose token type.Methods inherited from class io.helidon.integrations.vault.VaultRequest
add, addCommaDelimitedArray, addToCommaDelimitedArray, durationToTtl, preBuild
Methods inherited from class io.helidon.integrations.common.rest.ApiJsonRequest
addHeader, addQueryParam, headers, queryParams, requestId, requestId, requestMediaType, requestMediaType, responseMediaType, responseMediaType
Methods inherited from class io.helidon.integrations.common.rest.ApiJsonBuilder
add, add, add, add, add, add, addBase64, addToArray, addToArray, addToArray, addToArray, addToArray, addToArray, addToObject, addToObject, addToObject, addToObject, addToObject, emptyArray, me, postBuild, toJson
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.helidon.integrations.common.rest.ApiRequest
toJson
-
Method Details
-
builder
Fluent API builder for configuring a request. The request builder is passed as is, without a build method. The equivalent of a build method isApiJsonBuilder.toJson(jakarta.json.JsonBuilderFactory)
used by theRestApi
.- Returns:
- new request builder
-
addPolicy
Add a policy for the token. Policies must be a subset of the policies belonging to the token making the request, unless root. If not specified, defaults to all the policies of the calling token.- Parameters:
policy
- policy to add- Returns:
- updated request
-
addMetadata
Request metadata, passed through to the audit devices.- Parameters:
key
- namevalue
- value- Returns:
- updated request
-
noParent
This argument only has effect if used by a root or sudo caller. When set to true, the token created will not have a parent.- Parameters:
noParent
- set totrue
to create an orphan token- Returns:
- updated request
-
noDefaultPolicy
If configured totrue
, thedefault
policy will not be contained in this token's policy set.- Parameters:
noDefaultPolicy
- whether to exclude default policy- Returns:
- updated request
-
renewable
Set tofalse
to disable the ability of the token to be renewed past its initial TTL. Setting the value totrue
will allow the token to be renewable up to the system/mount maximum TTL.Defaults to
true
.- Parameters:
renewable
- whether the token should be renewable- Returns:
- updated request
-
numUses
The maximum uses for the given token. This can be used to create a one-time-token or limited use token. The value of 0 has no limit to the number of uses.- Parameters:
numUses
- number of uses, defaults to0
- unlimited- Returns:
- updated request
-
id
The ID of the client token. Can only be specified by a root token. The ID provided may not contain a . character. Otherwise, the token ID is a randomly generated value.Note: The ID should not start with the s. prefix.
- Parameters:
id
- id of the client token- Returns:
- updated request
-
roleName
The name of the token role.- Parameters:
roleName
- role name- Returns:
- updated request
-
type
Choose token type. Defaults to "service".- Parameters:
type
- token type- Returns:
- updated request
- See Also:
-
displayName
The display name of the token.- Parameters:
displayName
- display name- Returns:
- updated request
-
entityAlias
Name of the entity alias to associate with during token creation. Only works in combination with role_name argument and used entity alias must be listed in allowed_entity_aliases. If this has been specified, the entity will not be inherited from the parent.- Parameters:
entityAlias
- entity alias- Returns:
- updated request
-
period
If specified, the token will be periodic; it will have no maximum TTL (unless an "explicit-max-ttl" is also set) but every renewal will use the given period. Requires a root token or one with the sudo capability.- Parameters:
period
- period- Returns:
- updated request
-
ttl
The TTL period of the token. If not provided, the token is valid for the default lease TTL, or indefinitely if the root policy is used.- Parameters:
ttl
- duration of the token, smallest unit is seconds- Returns:
- updated request
-
explicitMaxTtl
If set, the token will have an explicit max TTL set upon it. This maximum token TTL cannot be changed later, and unlike with normal tokens, updates to the system/mount max TTL value will have no effect at renewal time -- the token will never be able to be renewed or used past the value set at issue time.- Parameters:
explicitMaxTtl
- duration of the max TTL, smallest unit is seconds- Returns:
- updated request
-