pub struct StripeStyle {
pub header: &'static str,
}Expand description
Stripe’s scheme, the shape adapter-stripe verifies: one header of
t=<unix>,v1=<hex>[,v1=<hex>…], payload {t}.{body}. The header name is
configurable because other providers use the same layout under their own
name.
Fields§
§header: &'static strThe header carrying t=…,v1=….
Trait Implementations§
Source§impl Clone for StripeStyle
impl Clone for StripeStyle
impl Copy for StripeStyle
Source§impl Debug for StripeStyle
impl Debug for StripeStyle
Source§impl Default for StripeStyle
impl Default for StripeStyle
impl Eq for StripeStyle
Source§impl PartialEq for StripeStyle
impl PartialEq for StripeStyle
Source§impl SignatureScheme for StripeStyle
impl SignatureScheme for StripeStyle
Source§fn extract(&self, headers: &HeaderMap, body: &[u8]) -> Option<SignedDelivery>
fn extract(&self, headers: &HeaderMap, body: &[u8]) -> Option<SignedDelivery>
Reads one delivery’s signature material out of the request headers
and the raw body bytes.
None on any input the scheme cannot fully
read; an empty candidate list counts as unreadable.Source§fn secret_key<'a>(&self, secret: &'a str) -> Option<Cow<'a, [u8]>>
fn secret_key<'a>(&self, secret: &'a str) -> Option<Cow<'a, [u8]>>
The key bytes the HMAC runs over: the trimmed secret’s own bytes,
unless the scheme’s providers hand out encoded secrets (Svix’s
base64
whsec_…), which decode here. None refuses.Source§fn digest(&self) -> Digest
fn digest(&self) -> Digest
The digest the scheme’s HMAC runs on. SHA-256 unless a provider
signs with SHA-1 (Vercel today). Ignored by a shared-token scheme,
which hashes nothing.
Source§fn expected_signature(&self, key: &[u8], signed_payload: &[u8]) -> Vec<u8> ⓘ
fn expected_signature(&self, key: &[u8], signed_payload: &[u8]) -> Vec<u8> ⓘ
The signature bytes a matching delivery must carry, given the
derived
key and the bytes the scheme signed. The default is
HMAC(self.digest(), key, signed_payload); a shared-token scheme
overrides this to return the key’s own bytes, because for it the
header is the secret and there is nothing to compute. Read moreimpl StructuralPartialEq for StripeStyle
Auto Trait Implementations§
impl Freeze for StripeStyle
impl RefUnwindSafe for StripeStyle
impl Send for StripeStyle
impl Sync for StripeStyle
impl Unpin for StripeStyle
impl UnsafeUnpin for StripeStyle
impl UnwindSafe for StripeStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.