Expand description
AWS Signature Version 4 request signing and verification.
Provides:
AwsSign— low-level SigV4 signing primitive (adapted from aws-sign-v4).sign_request— sign an outgoing Pingora [RequestHeader] in-place.signature_is_valid_for_request— verify a standardAuthorizationheader.signature_is_valid_for_presigned— verify presigned URL query parameters.ChunkSigner/StreamingState— per-chunk signing forSTREAMING-AWS4-HMAC-SHA256-PAYLOADuploads.
Structs§
- AwsSign
- Low-level AWS Signature Version 4 signing primitive.
- Chunk
Signer - Stateful per-chunk signer for
STREAMING-AWS4-HMAC-SHA256-PAYLOADuploads. - Date
Time 🔒 - ISO 8601 combined date and time with time zone.
- Naive
Date 🔒Time - ISO 8601 combined date and time without timezone.
- Streaming
State - Maximum chunk payload we read from the client before signing. (4 MiB is what the Java/AWS SDKs use, but any size works.) Runtime state for an in-progress streaming upload.
- Utc 🔒
- The UTC time zone. This is the most efficient time zone when you don’t need the local time. It is also used as an offset (which is also a dummy type).
Constants§
- EMPTY_
HASH 🔒 - EMPTY_
SHA256 🔒 - Pre‑computed because it is constant for every chunk.
- LONG_
DATETIME 🔒 - SHORT_
DATE 🔒
Functions§
- build_
chunk_ 🔒frame - Wrap a signed payload frame into the final on‑the‑wire representation.
- canonical_
query_ string - compute_
chunk_ 🔒signature - Calculate the per‑chunk signature (section Defining the Chunk Body of the AWS doc).
- resign_
streaming_ request - Re-sign an upstream request header for a
STREAMING-AWS4-HMAC-SHA256-PAYLOADupload. - scope_
string - Build the credential scope string:
YYYYMMDD/<region>/<service>/aws4_request. - sha256_
hex 🔒 - sign_
request 🔒 - Sign the request with the AWS V4 signature
- signature_
is_ 🔒valid_ core - Core signature validation: compares provided vs computed
- signature_
is_ valid_ for_ presigned - Validate presigned URL signature
- signature_
is_ valid_ for_ request - Validate standard S3 Authorization header
- signing_
key - Derive the SigV4 signing key.
- string_
to_ sign - Build the string-to-sign for AWS SigV4.
- uri_
encode - wrap_
streaming_ body - Build a stream whose items are already wrapped in “AWS-chunk-signed” envelopes.