Skip to main content

Config

Struct Config 

Source
pub struct Config { /* private fields */ }
Expand description

Configuration to interact with a Flamingo Verifier host.

Implementations§

Source§

impl Config

Source

pub fn new( host_url: &str, allowed_pcr_configs: Vec<Vec<PcrMeasurement>>, ) -> Result<Self, Error>

Instantiates a configuration with the default bounds.

§Errors

Returns an error if host_url is not a valid URL or the measurement policy fails the requirements of Self::verifier.

Source

pub fn dangerously_skip_measurements(host_url: &str) -> Result<Self, Error>

Creates a configuration that bypasses all PCR measurement checks.

No measurements are required. Certificate chain, signature, freshness, and channel public-key commitment verification remain enabled.

§Warning

Accepts any enclave code with otherwise valid attestation, including Nitro debug enclaves. Use only for development, never in production.

§Errors

Returns an error if host_url is not a valid URL.

Source

pub fn with_max_attestation_age(self, max_age: Duration) -> Self

Bounds how old an attestation document’s own timestamp may be.

Source

pub fn with_request_timeout(self, timeout: Duration) -> Self

Bounds each WebSocket exchange phase. Connecting uses connect_timeout_millis instead.

Source

pub const fn with_max_response_slots(self, max_slots: usize) -> Self

Bounds how many response slots a pipeline may list (WIP-201 §4.6 step 3).

Source

pub fn from_json(json: &str) -> Result<Self, Error>

Loads a configuration from JSON.

§Errors

Returns an error if the JSON is invalid or the resulting configuration is not usable.

Source

pub fn verifier(&self) -> Result<Verifier, Error>

Builds a Pontifex verifier applying the configured measurements and freshness bound.

§Errors

Rejects a zero max_response_slots, and a zero age or one above WIP-201 MAX_ATTESTATION_AGE. Without the explicit measurement bypass, also rejects an empty policy, missing or zero PCR0–2, duplicate indices, or malformed measurements.

Source

pub const fn host_url(&self) -> &Url

The host to call.

Source

pub const fn connect_timeout(&self) -> Duration

Bound on establishing a connection.

Source

pub const fn request_timeout(&self) -> Duration

Bound on a whole exchange.

Source

pub const fn max_response_slots(&self) -> usize

Most response slots a pipeline may list before the client sends biometrics to it.

Trait Implementations§

Source§

impl Clone for Config

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 Config

Source§

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

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

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Forget for Config

§

impl Freeze for Config

§

impl Move for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config
where RawVecInner: Send,

§

impl Sync for Config
where RawVecInner: Sync,

§

impl Unpin for Config
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Config

§

impl UnwindSafe for Config
where RawVecInner: UnwindSafe,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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