pub struct VendedCredentials {
pub token: String,
pub expires_at_epoch_s: i64,
pub access: Access,
}Expand description
Temporary, scoped credentials vended by the catalog, inheriting the requesting principal’s privileges. The engine never holds static secrets.
This is an opaque carrier: the token payload and its interpretation are the
backend’s concern. expires_at_epoch_s is UTC seconds since the Unix epoch,
supplied by the backend (this crate never reads the clock).
Refresh ahead of expiry, never at it. Vended Unity Catalog / Databricks
credentials live at most ~1 hour, and an in-flight write must not cross the
expiry boundary holding a credential the server has already rotated. A
consumer (the sink) should re-vend once Self::needs_refresh returns true
— comfortably before expires_at_epoch_s — rather than reacting to a
mid-write auth failure.
Fields§
§token: StringOpaque credential material (e.g. a temporary token or STS payload).
expires_at_epoch_s: i64Expiry as UTC seconds since the Unix epoch.
access: AccessThe access this credential grants.
Implementations§
Source§impl VendedCredentials
impl VendedCredentials
Sourcepub fn needs_refresh(&self, now_epoch_s: i64, refresh_skew_s: i64) -> bool
pub fn needs_refresh(&self, now_epoch_s: i64, refresh_skew_s: i64) -> bool
Whether these credentials should be proactively re-vended: true once
the current time is within refresh_skew_s of expiry (or already past it).
The caller supplies now_epoch_s (this crate never reads the clock). Use a
generous skew — several minutes — so a long write never races the rotation.
Trait Implementations§
Source§impl Clone for VendedCredentials
impl Clone for VendedCredentials
Source§fn clone(&self) -> VendedCredentials
fn clone(&self) -> VendedCredentials
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more