pub struct CanonicalRequest<'a> { /* private fields */ }Expand description
The request as the client addressed it: the values the covered components resolve to.
scheme and authority are what the client dialled. A verifier takes them from its own
configuration, never from the request’s Host header, which infrastructure may rewrite.
Implementations§
Source§impl<'a> CanonicalRequest<'a>
impl<'a> CanonicalRequest<'a>
Sourcepub fn new(
method: &'a str,
scheme: &'a str,
authority: &'a str,
path: &'a str,
query: Option<&'a str>,
body: &'a [u8],
) -> Result<Self, InvalidUri>
pub fn new( method: &'a str, scheme: &'a str, authority: &'a str, path: &'a str, query: Option<&'a str>, body: &'a [u8], ) -> Result<Self, InvalidUri>
A request from its parts. path is percent-encoded and query excludes the leading ?.
§Errors
Returns an error if authority cannot be parsed as a URI authority.
Sourcepub fn from_http(
method: &'a Method,
uri: &'a Uri,
scheme: &'a str,
authority: &'a str,
body: &'a [u8],
) -> Result<Self, InvalidUri>
pub fn from_http( method: &'a Method, uri: &'a Uri, scheme: &'a str, authority: &'a str, body: &'a [u8], ) -> Result<Self, InvalidUri>
A received request, with scheme and authority from verifier configuration.
§Errors
Returns an error if authority cannot be parsed as a URI authority.
Sourcepub fn component_values(&self, integrity_token: &str) -> ComponentValues
pub fn component_values(&self, integrity_token: &str) -> ComponentValues
The values the covered components resolve to, with integrity_token as the token.
Scheme and host are lowercased, and the HTTP(S) default port is omitted.
Sourcepub fn signature_base(
&self,
params: &SignatureParams,
integrity_token: &str,
) -> SignatureBase
pub fn signature_base( &self, params: &SignatureParams, integrity_token: &str, ) -> SignatureBase
Builds the signature base for params, with integrity_token as the token component.