pub struct Config { /* private fields */ }Expand description
Configuration to interact with a Flamingo Verifier host.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(
host_url: &str,
allowed_pcr_configs: Vec<Vec<PcrMeasurement>>,
) -> Result<Self, Error>
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.
Sourcepub fn dangerously_skip_measurements(host_url: &str) -> Result<Self, Error>
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.
Sourcepub fn with_max_attestation_age(self, max_age: Duration) -> Self
pub fn with_max_attestation_age(self, max_age: Duration) -> Self
Bounds how old an attestation document’s own timestamp may be.
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Bounds each WebSocket exchange phase. Connecting uses connect_timeout_millis instead.
Sourcepub const fn with_max_response_slots(self, max_slots: usize) -> Self
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).
Sourcepub fn from_json(json: &str) -> Result<Self, Error>
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.
Sourcepub fn verifier(&self) -> Result<Verifier, Error>
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.
Sourcepub const fn connect_timeout(&self) -> Duration
pub const fn connect_timeout(&self) -> Duration
Bound on establishing a connection.
Sourcepub const fn request_timeout(&self) -> Duration
pub const fn request_timeout(&self) -> Duration
Bound on a whole exchange.
Sourcepub const fn max_response_slots(&self) -> usize
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<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Configwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Vec<PcrMeasurement>>: Freeze,
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Configwhere
RawVecInner: Send,
impl Sync for Configwhere
RawVecInner: Sync,
impl Unpin for Config
impl UnsafeUnpin for Configwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Vec<PcrMeasurement>>: UnsafeUnpin,
impl UnwindSafe for Configwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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