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;
let mut creds = InjectedCredentials::empty();creds.insert("Authorization".to_string(), "Bearer tok".to_string());assert_eq!( creds.get("Authorization").map(String::as_str), Some("Bearer tok"),);Methods:
fn new(headers: HashMap<String, 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<String, String>- Returns a reference to the injected headers.fn into_headers(self: Self) -> HashMap<String, String>- Consumesselfand returns the inner header map.fn get(self: &Self, key: &str) -> Option<&String>- Returns the value for a single header key, if present.fn insert(self: & mut Self, key: String, 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:
- Clone
fn clone(self: &Self) -> InjectedCredentials
- From
fn from(headers: HashMap<String, String>) -> Self
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result