#[non_exhaustive]pub struct CredentialRequest<'req> {
pub env: &'req str,
pub command: &'req str,
pub tier: &'req str,
pub meta: &'req CommandMeta,
}Expand description
Everything an AuthProvider may inspect about the command requesting a
credential.
This bundles the routing fields passed to AuthProvider::get_credential
(env, colon command path, and tier) together with the command’s
CommandMeta, so a provider can read richer metadata — for example an
OAuth provider reading CommandMeta::scopes to decide whether the cached
token is sufficient. Providers that do not need metadata can ignore it.
Marked #[non_exhaustive] because the framework constructs it (providers only
read it) and more request fields may be added over time; build one with
CredentialRequest::new rather than a struct literal so adding a field is
not a breaking change for downstream crates.
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.env: &'req strTarget environment name.
command: &'req strColon-separated command path, for example project:list.
tier: &'req strRisk tier as a string, for example read or mutate.
meta: &'req CommandMetaMetadata for the command requesting the credential.
Implementations§
Source§impl<'req> CredentialRequest<'req>
impl<'req> CredentialRequest<'req>
Trait Implementations§
Source§impl<'req> Clone for CredentialRequest<'req>
impl<'req> Clone for CredentialRequest<'req>
Source§fn clone(&self) -> CredentialRequest<'req>
fn clone(&self) -> CredentialRequest<'req>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more