#[non_exhaustive]pub struct TokenOptions {
pub audience: String,
pub nonce: Vec<String>,
pub token_type: TokenType,
pub token_type_options: Option<TokenTypeOptions>,
/* private fields */
}Expand description
Options to modify claims in the token to generate custom-purpose tokens.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.audience: StringOptional. Optional string to issue the token with a custom audience claim. Required if one or more nonces are specified.
nonce: Vec<String>Optional. Optional parameter to place one or more nonces in the eat_nonce claim in the output token. The minimum size for JSON-encoded EATs is 10 bytes and the maximum size is 74 bytes.
token_type: TokenTypeOptional. Optional token type to select what type of token to return.
token_type_options: Option<TokenTypeOptions>An optional additional configuration per token type.
Implementations§
Source§impl TokenOptions
impl TokenOptions
pub fn new() -> Self
Sourcepub fn set_audience<T: Into<String>>(self, v: T) -> Self
pub fn set_audience<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_token_type<T: Into<TokenType>>(self, v: T) -> Self
pub fn set_token_type<T: Into<TokenType>>(self, v: T) -> Self
Sets the value of token_type.
§Example
use google_cloud_confidentialcomputing_v1::model::TokenType;
let x0 = TokenOptions::new().set_token_type(TokenType::Oidc);
let x1 = TokenOptions::new().set_token_type(TokenType::Pki);
let x2 = TokenOptions::new().set_token_type(TokenType::LimitedAws);Sourcepub fn set_token_type_options<T: Into<Option<TokenTypeOptions>>>(
self,
v: T,
) -> Self
pub fn set_token_type_options<T: Into<Option<TokenTypeOptions>>>( self, v: T, ) -> Self
Sets the value of token_type_options.
Note that all the setters affecting token_type_options are mutually
exclusive.
§Example
use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
let x = TokenOptions::new().set_token_type_options(Some(
google_cloud_confidentialcomputing_v1::model::token_options::TokenTypeOptions::AwsPrincipalTagsOptions(AwsPrincipalTagsOptions::default().into())));The value of token_type_options
if it holds a AwsPrincipalTagsOptions, None if the field is not set or
holds a different branch.
Sets the value of token_type_options
to hold a AwsPrincipalTagsOptions.
Note that all the setters affecting token_type_options are
mutually exclusive.
§Example
use google_cloud_confidentialcomputing_v1::model::AwsPrincipalTagsOptions;
let x = TokenOptions::new().set_aws_principal_tags_options(AwsPrincipalTagsOptions::default()/* use setters */);
assert!(x.aws_principal_tags_options().is_some());Trait Implementations§
Source§impl Clone for TokenOptions
impl Clone for TokenOptions
Source§fn clone(&self) -> TokenOptions
fn clone(&self) -> TokenOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more