Expand description
AWS S3 upload via pure-Rust Signature V4 โ no AWS SDK dependency.
Mirrors the Python s3_upload.py module from resource-tracker PR #9.
Structsยง
- Region
Cache - A HashMap-backed cache of bucket name -> region string.
Construct once and pass by
&muttoget_or_detect. - S3Uri
- A parsed
s3://bucket/keyURI. - Upload
Credentials - STS credentials used to sign S3 PUT requests.
Functionsยง
- detect_
bucket_ region - Detect the AWS region for
bucketby sending an HTTP HEAD request to<bucket>.s3.amazonaws.com:80and reading thex-amz-bucket-regionresponse header. - detect_
region_ ๐at - Low-level region probe: connects to
host:portover plain TCP and sends aHEAD / HTTP/1.0request. Used directly by tests with a local mock server. - epoch_
to_ ๐utc - Decompose a Unix timestamp (seconds since 1970-01-01 UTC) into (year, month, day, hour, minute, second). No leap-second handling.
- format_
amz_ date - Format a Unix timestamp as
YYYYMMDDTHHmmSSZ. - hmac_
sha256 ๐ - parse_
s3_ uri - Parse an S3 URI of the form
s3://bucket/key. - s3_put
- Upload
bodybytes tos3://bucket/keyusing AWS Signature V4. - s3_
put_ ๐to - Internal: same as
s3_putbut accepts an explicitbase_url. Used in unit tests to point at a plain-HTTP mock server. - sha256_
hex ๐ - sign_
put_ request - Build the
Authorizationheader value for a PUT to S3.
Type Aliasesยง
- Hmac
Sha256 ๐