pub fn sigv4_verify_at<A1, A2>(
req: &Request,
signing_key: &SigningKey,
server_timestamp: &DateTime<Utc>,
allowed_mismatch: Option<Duration>,
region: A1,
service: A2,
) -> Result<(), SignatureError>
Expand description
Verify a SigV4 request at a particular point-in-time. This verifies that the request timestamp is not beyond the allowed timestamp mismatch against the specified point-in-time, and that the request signature matches our expected signature.
This is mainly for unit testing. For general purpose use, use sigv4_verify
.
§Errors
If the request timestamp is outside the allowed timestamp mismatch, a SignatureError::TimestampOutOfRange
error
is returned.
If the request signature does not match the expected signature, a SignatureError::InvalidSignature
error is
returned.
§Panics
If the expected signature string is not 64 bytes long, this function will panic. This should never happen.