Struct http_sig::VerifyingConfig
source · pub struct VerifyingConfig { /* private fields */ }
Expand description
The configuration used for verifying HTTP requests.
Implementations§
source§impl VerifyingConfig
impl VerifyingConfig
sourcepub fn new<KP: KeyProvider>(key_provider: KP) -> Self
pub fn new<KP: KeyProvider>(key_provider: KP) -> Self
Creates a new verifying configuration using the given key provider.
sourcepub fn key_provider(&self) -> &dyn KeyProvider
pub fn key_provider(&self) -> &dyn KeyProvider
Returns the key provider.
sourcepub fn digest_provider(&self) -> &dyn DigestProvider
pub fn digest_provider(&self) -> &dyn DigestProvider
Returns the digest provider.
sourcepub fn with_digest<DP: DigestProvider>(self, digest_provider: DP) -> Self
pub fn with_digest<DP: DigestProvider>(self, digest_provider: DP) -> Self
Sets the digest provider.
sourcepub fn require_digest(&self) -> bool
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.
sourcepub fn set_require_digest(&mut self, require_digest: bool) -> &mut Self
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.
sourcepub fn with_require_digest(self, require_digest: bool) -> Self
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.
sourcepub fn validate_digest(&self) -> bool
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.
sourcepub fn set_validate_digest(&mut self, validate_digest: bool) -> &mut Self
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.
sourcepub fn with_validate_digest(self, validate_digest: bool) -> Self
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.
sourcepub fn validate_date(&self) -> bool
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.
sourcepub fn set_validate_date(&mut self, validate_date: bool) -> &mut Self
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.
sourcepub fn with_validate_date(self, validate_date: bool) -> Self
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.
sourcepub fn date_leeway(&self) -> Duration
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.
sourcepub fn set_date_leeway(&mut self, date_leeway: Duration) -> &mut Self
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.
sourcepub fn with_date_leeway(self, date_leeway: Duration) -> Self
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.
sourcepub fn required_headers(&self) -> impl IntoIterator<Item = &Header>
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.
sourcepub fn set_required_headers(&mut self, required_headers: &[Header]) -> &mut Self
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.
sourcepub fn with_required_headers(self, required_headers: &[Header]) -> Self
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.