Struct ruma_server_util::authorization::XMatrix
source · #[non_exhaustive]pub struct XMatrix {
pub origin: OwnedServerName,
pub destination: Option<OwnedServerName>,
pub key: OwnedServerSigningKeyId,
pub sig: String,
}
Expand description
Typed representation of an Authorization
header of scheme X-Matrix
, as defined in the
Matrix Server-Server API. Includes an implementation of
headers::authorization::Credentials
for automatically handling the encoding and decoding
when using a web framework that supports typed headers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.origin: OwnedServerName
The server name of the sending server.
destination: Option<OwnedServerName>
The server name of the receiving sender. For compatibility with older servers, recipients should accept requests without this parameter, but MUST always send it. If this property is included, but the value does not match the receiving server’s name, the receiving server must deny the request with an HTTP status code 401 Unauthorized.
key: OwnedServerSigningKeyId
The ID - including the algorithm name - of the sending server’s key that was used to sign the request.
sig: String
The signature of the JSON.
Implementations§
Trait Implementations§
source§impl Credentials for XMatrix
impl Credentials for XMatrix
source§const SCHEME: &'static str = "X-Matrix"
const SCHEME: &'static str = "X-Matrix"
source§fn decode(value: &HeaderValue) -> Option<Self>
fn decode(value: &HeaderValue) -> Option<Self>
HeaderValue
. Read moresource§fn encode(&self) -> HeaderValue
fn encode(&self) -> HeaderValue
HeaderValue
. Read more