pub struct RuntimeCredentials { /* private fields */ }Expand description
A single-purpose credential source shared by concurrent requests. Refresh errors propagate; expired credentials are never returned.
Implementations§
Source§impl RuntimeCredentials
impl RuntimeCredentials
Sourcepub fn new(
config: RuntimeCredentialConfig,
proof: Arc<dyn RuntimeProofProvider>,
) -> Result<Self>
pub fn new( config: RuntimeCredentialConfig, proof: Arc<dyn RuntimeProofProvider>, ) -> Result<Self>
Connect to a manager using a fixed deployment and purpose. The manager independently verifies membership and never trusts these selectors.
Sourcepub fn new_for_receiver(
config: RuntimeCredentialConfig,
proof: Arc<dyn RuntimeProofProvider>,
exchange_path: &str,
receiver_url: &str,
) -> Result<Self>
pub fn new_for_receiver( config: RuntimeCredentialConfig, proof: Arc<dyn RuntimeProofProvider>, exchange_path: &str, receiver_url: &str, ) -> Result<Self>
Exchange proof at a configured manager path for a credential restricted to an independently configured receiver. Neither destination is selected by the proof provider or an exchange response.
Sourcepub fn from_capability_file(
config: RuntimeCredentialConfig,
path: PathBuf,
) -> Result<Self>
pub fn from_capability_file( config: RuntimeCredentialConfig, path: PathBuf, ) -> Result<Self>
Read an externally refreshed capability on each request. This source never exchanges or renews the supplied credential.
Sourcepub fn allows_endpoint(&self, endpoint: &str) -> bool
pub fn allows_endpoint(&self, endpoint: &str) -> bool
Credentials may only be attached to their configured receiver origin.
Sourcepub fn with_clock(
self,
clock: Arc<dyn Fn() -> DateTime<Utc> + Send + Sync>,
) -> Self
pub fn with_clock( self, clock: Arc<dyn Fn() -> DateTime<Utc> + Send + Sync>, ) -> Self
Inject a clock for precise expiry validation.
Sourcepub async fn token(&self) -> Result<String>
pub async fn token(&self) -> Result<String>
Return a current credential, refreshing halfway through its remaining lifetime. A scheduled refresh failure may retain unexpired authority.
Sourcepub async fn reject(&self, rejected: &str)
pub async fn reject(&self, rejected: &str)
Invalidate only the credential rejected by a receiver. A delayed response for an older token must not evict a newer cached credential or replace the rejection recorded while that newer generation is being refreshed.
Sourcepub async fn token_after_rejection(&self, rejected: &str) -> Result<String>
pub async fn token_after_rejection(&self, rejected: &str) -> Result<String>
Retry callers share a replacement when they rejected the same token.
Sourcepub async fn capability(&self) -> Result<RuntimeCapability>
pub async fn capability(&self) -> Result<RuntimeCapability>
The deadline accompanies tokens written to child credential files.