pub struct VerifyingConfig { /* private fields */ }
Expand description

The configuration used for verifying HTTP requests.

Implementations§

source§

impl VerifyingConfig

source

pub fn new<KP: KeyProvider>(key_provider: KP) -> Self

Creates a new verifying configuration using the given key provider.

source

pub fn key_provider(&self) -> &dyn KeyProvider

Returns the key provider.

source

pub fn digest_provider(&self) -> &dyn DigestProvider

Returns the digest provider.

source

pub fn with_digest<DP: DigestProvider>(self, digest_provider: DP) -> Self

Sets the digest provider.

source

pub fn require_digest(&self) -> bool

Returns whether a digest header must be present and included in the signature for requests with a body.

This is set to true by default.

source

pub fn set_require_digest(&mut self, require_digest: bool) -> &mut Self

Controls whether a digest header must be present and included in the signature for requests with a body (in-place).

This is set to true by default.

source

pub fn with_require_digest(self, require_digest: bool) -> Self

Controls whether a digest header must be present and included in the signature for requests with a body.

This is set to true by default.

source

pub fn validate_digest(&self) -> bool

Returns whether the request body will be checked against the digest for correctness if the digest is included in the signature.

This is set to true by default.

source

pub fn set_validate_digest(&mut self, validate_digest: bool) -> &mut Self

Controls whether the request body will be checked against the digest for correctness if the digest is included in the signature (in-place).

This is set to true by default.

source

pub fn with_validate_digest(self, validate_digest: bool) -> Self

Controls whether the request body will be checked against the digest for correctness if the digest is included in the signature.

This is set to true by default.

source

pub fn validate_date(&self) -> bool

Returns whether the date header will be compared against the current date and time if the date header is included in the signature.

This is set to true by default.

source

pub fn set_validate_date(&mut self, validate_date: bool) -> &mut Self

Controls whether the date header will be compared against the current date and time if the date header is included in the signature (in-place).

This is set to true by default.

source

pub fn with_validate_date(self, validate_date: bool) -> Self

Controls whether the date header will be compared against the current date and time if the date header is included in the signature.

This is set to true by default.

source

pub fn date_leeway(&self) -> Duration

Returns the amount of leeway allowed in either direction when comparing dates and times from requests against the current date and time.

This is set to 30 seconds by default.

source

pub fn set_date_leeway(&mut self, date_leeway: Duration) -> &mut Self

Controls the amount of leeway allowed in either direction when comparing dates and times from requests against the current date and time (in-place).

This is set to 30 seconds by default.

source

pub fn with_date_leeway(self, date_leeway: Duration) -> Self

Controls the amount of leeway allowed in either direction when comparing dates and times from requests against the current date and time.

This is set to 30 seconds by default.

source

pub fn required_headers(&self) -> impl IntoIterator<Item = &Header>

Returns the list of headers that must be included in every request’s signature. Do not include the digest header here or requests without a body will be denied. Instead, rely on the validate_digest option.

This list contains (request-target) and date by default.

source

pub fn set_required_headers(&mut self, required_headers: &[Header]) -> &mut Self

Controls the list of headers that must be included in every request’s signature (in-place). Do not include the digest header here or requests without a body will be denied. Instead, rely on the validate_digest option.

This list contains (request-target) and date by default.

source

pub fn with_required_headers(self, required_headers: &[Header]) -> Self

Controls the list of headers that must be included in every request’s signature. Do not include the digest header here or requests without a body will be denied. Instead, rely on the validate_digest option.

This list contains (request-target) and date by default.

Trait Implementations§

source§

impl Debug for VerifyingConfig

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

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

§

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