pub enum Component {
Method,
Authority,
Path,
Query,
RequestTarget,
Header(String),
}Expand description
A covered component of an HTTP message signature.
This crate supports the derived components @method, @authority, @path,
@query and @request-target, plus plain header fields. @target-uri and
component parameters (for example ;sf or ;key) are not modeled.
Variants§
Method
The request method (@method).
Authority
The request authority (@authority), lowercased.
Path
The absolute path (@path).
Query
The query string including the leading ? (@query).
RequestTarget
The request target (@request-target): the absolute path followed by
? and the query when one is present (RFC 9421 Section 2.2.5,
origin-form). The WIMSE profile requires this component to be signed.
Header(String)
A header field, identified by its lowercase name.
Implementations§
Source§impl Component
impl Component
Sourcepub fn quoted_id(&self) -> String
pub fn quoted_id(&self) -> String
The quoted component identifier as it appears in the signature base and
the inner list (for example "@method" or "content-type").
Sourcepub fn from_quoted_id(token: &str) -> Result<Self, HttpSigError>
pub fn from_quoted_id(token: &str) -> Result<Self, HttpSigError>
Parses a quoted component identifier back into a Component.
§Errors
Returns HttpSigError::UnsupportedComponent for an identifier this
crate does not model (including any carrying parameters), and
HttpSigError::Parse if the token is not a quoted string.