pub struct HmacSigner;Expand description
HMAC-SHA256 API signer.
Sorts parameters in lexicographic order, joins them into a query string, and then signs the result with HMAC-SHA256.
§Security notes (v4.8.0 fix for H-1 parameter smuggling)
- Both key and value are RFC 3986 percent-encoded before being joined,
eliminating the canonical-string ambiguity between
{a:1,b:2}and{a:"1&b=2"}(parameter smuggling). - The caller must include a timestamp/random nonce as one of the signed parameters and verify the time window on the server side; otherwise signed requests can still be replayed.
Implementations§
Source§impl HmacSigner
impl HmacSigner
Trait Implementations§
Source§impl ApiSigner for HmacSigner
impl ApiSigner for HmacSigner
Auto Trait Implementations§
impl Freeze for HmacSigner
impl RefUnwindSafe for HmacSigner
impl Send for HmacSigner
impl Sync for HmacSigner
impl Unpin for HmacSigner
impl UnsafeUnpin for HmacSigner
impl UnwindSafe for HmacSigner
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