pub struct Verifier<'a> { /* private fields */ }
Expand description

Builder to verify a request against a Tl-Signature header.

See crate::verify_with_pem for examples.

Implementations§

Add the full received request body.

Add the request method, e.g. "POST".

Add the request path, e.g. "/payouts".

Panics

If path does not start with a ‘/’ char.

Add a header name & value. May be called multiple times to add multiple different headers.

All request headers may be added here, any headers not mentioned in the jws signature header will be ignored unless required using Verifier::require_header.

Add a header name & value. May be called multiple times to add multiple different headers.

All request headers may be added here, any headers not mentioned in the jws signature header will be ignored unless required using Verifier::require_header.

Examples found in repository?
src/verify.rs (line 87)
86
87
88
89
    pub fn header(mut self, key: &'a str, value: &'a [u8]) -> Self {
        self.add_header(key, value);
        self
    }

Appends multiple header names & values.

All request headers may be added here, any headers not mentioned in the jws signature header will be ignored unless required using Verifier::require_header.

Example
truelayer_signing::verify_with_pem(key)
    .headers([("X-Head-A", "123".as_bytes()), ("X-Head-B", "345".as_bytes())]);

Require a header name that must be included in the Tl-Signature. May be called multiple times to add multiple required headers.

Signatures missing these will fail verification.

Sets whether v1 body-only signatures are allowed to pass verification. Default false.

true means both v1 & v2 signatures are allowed.

Verify the given Tl-Signature header value.

Supports v1 (body only) & v2 full request signatures.

Returns Err(_) if verification fails.

Trait Implementations§

Debug does not display key info.

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.