Skip to main content

KeyManagerConfig

Struct KeyManagerConfig 

Source
pub struct KeyManagerConfig {
    pub refresh_interval: Duration,
    pub fetch_timeout: Duration,
    pub pass_timeout: Duration,
    pub page_limit: NonZeroUsize,
    pub max_pages: NonZeroUsize,
    pub max_age: Duration,
    pub shutdown_timeout: Duration,
}
Expand description

Credential-projection refresh timing and paging budgets.

Default gives a five-second refresh pause and per-call timeout, a ten-second pass, 256 records a page, 1024 page calls a pass, a 30-second max_age and a five-second shutdown timeout. validate runs before the task starts (INVARIANTS.md 16). docs/CREDENTIAL_PROJECTION.md covers sizing against revocation tolerance.

Fields§

§refresh_interval: Duration

Pause after each completed attempt. The first fetch starts immediately.

Bounds how soon a key added, rotated or removed at the source reaches new verifications. Set it no longer than the snapshot refresh_interval. Too long delays key changes; too short re-reads the whole credential set more often. Must be positive, and max_age must exceed refresh_interval + 2 * pass_timeout.

§fetch_timeout: Duration

Bound on one page call to the key source. A timeout fails the pass (counted in KeyManagerStats::timeouts, or in pass_timeouts when the pass budget ran out first) and keeps the previous projection. Set it above the source’s slowest legitimate page. Must be positive and no longer than pass_timeout.

§pass_timeout: Duration

One budget for every page, restart, and projection build.

Must cover reading the whole credential set, including revision restarts, or no pass ever publishes (counted in KeyManagerStats::pass_timeouts). Larger values also force a larger max_age. Must be positive and at least fetch_timeout.

§page_limit: NonZeroUsize

Records requested per page call. Larger pages mean fewer calls per pass, each heavier. At most 4096.

§max_pages: NonZeroUsize

Total page calls per pass, including revision-conflict retries.

A catalogue that needs more pages than this never publishes (counted in KeyManagerStats::page_budget_exceeded); size it above the credential count divided by page_limit, with room for restarts.

§max_age: Duration

Maximum evidence lifetime, measured from fetch START, including I/O.

Every credential verified from a projection, including one cached in a session, stops verifying at the earlier of its own expiry and the fetch start plus this. It is therefore the revocation bound for cached sessions and how long authentication survives a feed outage. Too short withdraws readiness on any slow pass; too long lets a removed key keep authenticating. Must strictly exceed refresh_interval + 2 * pass_timeout, and the resulting deadline must fit a Timestamp.

§shutdown_timeout: Duration

How long KeyManager::shutdown waits for the task to stop before reporting deadline_expired. Include it in the application’s shutdown budget. Must be positive.

Implementations§

Source§

impl KeyManagerConfig

Source

pub fn validate(&self) -> Result<(), KeyManagerConfigError>

Check the configuration without starting anything: every duration positive and representable, page_limit at most 4096, fetch_timeout <= pass_timeout, and max_age > refresh_interval + 2 * pass_timeout, so the previous pass, the pause and the next pass all fit inside one evidence window.

§Errors

The first rule the configuration breaks.

Trait Implementations§

Source§

impl Clone for KeyManagerConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KeyManagerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for KeyManagerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more