mirror of
https://git.asonix.dog/asonix/http-signature-normalization.git
synced 2024-06-13 02:39:34 +00:00
28 lines
789 B
Rust
28 lines
789 B
Rust
use actix_web::{dev::ServiceRequest, HttpRequest};
|
|
pub use http_signature_normalization::verify::{
|
|
Algorithm, DeprecatedAlgorithm, ParseSignatureError, ParsedHeader, Unvalidated, Unverified,
|
|
ValidateError,
|
|
};
|
|
|
|
use crate::{Config, Verify, VerifyError};
|
|
|
|
impl Verify for HttpRequest {
|
|
fn begin_verify(&self, config: &Config) -> Result<Unverified, VerifyError> {
|
|
config.begin_verify(
|
|
self.method(),
|
|
self.uri().path_and_query(),
|
|
self.headers().clone(),
|
|
)
|
|
}
|
|
}
|
|
|
|
impl Verify for ServiceRequest {
|
|
fn begin_verify(&self, config: &Config) -> Result<Unverified, VerifyError> {
|
|
config.begin_verify(
|
|
self.method(),
|
|
self.uri().path_and_query(),
|
|
self.headers().clone(),
|
|
)
|
|
}
|
|
}
|