credential
Module: credential
Section titled “Module: credential”Contents
Section titled “Contents”Structs
InjectedCredentials- Read-only bundle of headers injected into an outbound request after
firma_core::credential::InjectedCredentials
Section titled “firma_core::credential::InjectedCredentials”Struct
Read-only bundle of headers injected into an outbound request after enforcement passes.
Produced by the sidecar credential injection stage. Contains only
HTTP headers — the originating ExecutionEnvelope is never
mutated. Connectors merge these headers into the outbound request.
Examples
Section titled “Examples”use std::collections::HashMap;use firma_core::InjectedCredentials;use firma_http::HeaderName;
let mut creds = InjectedCredentials::empty();creds.insert(HeaderName::from_static("authorization"), "Bearer tok".to_string());assert_eq!( creds.get(&HeaderName::from_static("authorization")).map(String::as_str), Some("Bearer tok"),);Methods:
fn new(headers: HashMap<HeaderName, String>) -> Self- Creates a new [InjectedCredentials] from a header map.fn empty() -> Self- Creates an empty [InjectedCredentials] with no headers.fn headers(self: &Self) -> &HashMap<HeaderName, String>- Returns a reference to the injected headers.fn get(self: &Self, key: &HeaderName) -> Option<&String>- Returns the value for a single header key, if present.fn insert(self: & mut Self, key: HeaderName, value: String)- Inserts a header key-value pair, replacing any existing value.fn is_empty(self: &Self) -> bool- Returnstrueif no headers were injected.
Trait Implementations:
- From
fn from(headers: HashMap<HeaderName, String>) -> Self
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- Clone
fn clone(self: &Self) -> InjectedCredentials