Class CreateRole.Request
- java.lang.Object
-
- io.helidon.integrations.common.rest.ApiJsonBuilder<T>
-
- io.helidon.integrations.common.rest.ApiJsonRequest<T>
-
- io.helidon.integrations.vault.VaultRequest<CreateRole.Request>
-
- io.helidon.integrations.vault.auths.k8s.CreateRole.Request
-
- All Implemented Interfaces:
ApiRequest<CreateRole.Request>
- Enclosing class:
- CreateRole
public static class CreateRole.Request extends VaultRequest<CreateRole.Request>
Request object. Can be configured with additional headers, query parameters etc.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateRole.Request
addBoundServiceAccountName(String serviceAccountName)
Add a service account name able to access this role.CreateRole.Request
addBoundServiceAccountNamespace(String serviceAccountNamespace)
Add a namespace allowed to access this role.CreateRole.Request
addTokenBoundCidr(String cidr)
Add CIDR block.CreateRole.Request
addTokenPolicy(String policy)
Add a policy to encode on the generated token.CreateRole.Request
audience(String audience)
Optional Audience claim to verify in the JWT.static CreateRole.Request
builder()
Fluent API builder for configuring a request.String
roleName()
Name of the configured role.CreateRole.Request
roleName(String roleName)
Name of the role to create.CreateRole.Request
tokenExplicitMaxTtl(int ttl)
If set, will encode an explicit max TTL onto the token.CreateRole.Request
tokenMaxTtl(int ttl)
The maximum lifetime for generated tokens.CreateRole.Request
tokenNoDefaultPolicy(boolean noDefaultPolicy)
If set, the default policy will not be set on generated tokens; otherwise it will be added to the policies set in token_policies.CreateRole.Request
tokenNumUses(int numUses)
The maximum number of times a generated token may be used (within its lifetime); 0 means unlimited.CreateRole.Request
tokenPeriod(int period)
The period, if any, to set on the token.CreateRole.Request
tokenTtl(int ttl)
The incremental lifetime for generated tokens.CreateRole.Request
tokenType(String type)
The type of token that should be generated.-
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 Detail
-
builder
public static CreateRole.Request 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(javax.json.JsonBuilderFactory)
used by theRestApi
.- Returns:
- new request builder
-
addBoundServiceAccountName
public CreateRole.Request addBoundServiceAccountName(String serviceAccountName)
Add a service account name able to access this role. If set to "*" all names are allowed, both this andaddBoundServiceAccountNamespace(String)
can not be "*".- Parameters:
serviceAccountName
- service account name- Returns:
- updated request
-
addBoundServiceAccountNamespace
public CreateRole.Request addBoundServiceAccountNamespace(String serviceAccountNamespace)
Add a namespace allowed to access this role. If set to "*" all namespaces are allowed, both this andaddBoundServiceAccountName(String)
can not be set to "*".- Parameters:
serviceAccountNamespace
- service account namespace- Returns:
- updated request
-
audience
public CreateRole.Request audience(String audience)
Optional Audience claim to verify in the JWT.- Parameters:
audience
- audience- Returns:
- updated request
-
tokenTtl
public CreateRole.Request tokenTtl(int ttl)
The incremental lifetime for generated tokens. This current value of this will be referenced at renewal time.- Parameters:
ttl
- time to live- Returns:
- updated request
-
tokenMaxTtl
public CreateRole.Request tokenMaxTtl(int ttl)
The maximum lifetime for generated tokens. This current value of this will be referenced at renewal time.- Parameters:
ttl
- time to live- Returns:
- updated request
-
addTokenPolicy
public CreateRole.Request addTokenPolicy(String policy)
Add a policy to encode on the generated token.- Parameters:
policy
- policy to add- Returns:
- updated request
-
addTokenBoundCidr
public CreateRole.Request addTokenBoundCidr(String cidr)
Add CIDR block. f set, specifies blocks of IP addresses which can authenticate successfully, and ties the resulting token to these blocks as well.- Parameters:
cidr
- CIDR to add- Returns:
- updated request
-
tokenExplicitMaxTtl
public CreateRole.Request tokenExplicitMaxTtl(int ttl)
If set, will encode an explicit max TTL onto the token. This is a hard cap even if token_ttl and token_max_ttl would otherwise allow a renewal.- Parameters:
ttl
- time to live- Returns:
- updated request
-
tokenNoDefaultPolicy
public CreateRole.Request tokenNoDefaultPolicy(boolean noDefaultPolicy)
If set, the default policy will not be set on generated tokens; otherwise it will be added to the policies set in token_policies.- Parameters:
noDefaultPolicy
- whether to disable default policy for this role- Returns:
- updated request
-
tokenNumUses
public CreateRole.Request tokenNumUses(int numUses)
The maximum number of times a generated token may be used (within its lifetime); 0 means unlimited. If you require the token to have the ability to create child tokens, you will need to set this value to 0.- Parameters:
numUses
- number of uses- Returns:
- updated request
-
tokenPeriod
public CreateRole.Request tokenPeriod(int period)
The period, if any, to set on the token.- Parameters:
period
- period- Returns:
- updated request
-
tokenType
public CreateRole.Request tokenType(String type)
The type of token that should be generated. Can be service, batch, or default to use the mount's tuned default (which unless changed will be service tokens). For token store roles, there are two additional possibilities: default-service and default-batch which specify the type to return unless the client requests a different type at generation time.- Parameters:
type
- type- Returns:
- updated request
- See Also:
K8sAuthRx.TYPE_SERVICE
,K8sAuthRx.TYPE_BATCH
,K8sAuthRx.TYPE_DEFAULT
-
roleName
public CreateRole.Request roleName(String roleName)
Name of the role to create.- Parameters:
roleName
- role name- Returns:
- updated request
-
roleName
public String roleName()
Name of the configured role.- Returns:
- role name
-
-