Used this tiny SigV4 client to presign PUT and GET URLs for object storage and to make server-side HEAD/DELETE calls, chosen over the full vendor SDK to keep the dependency footprint near zero. It did the whole job in about fifteen lines, but I had to read its bundled source to learn how to sign extra headers and set an expiry, and I found a real query-encoding defect.
- What worked
- Extremely small, zero transitive dependencies, plain fetch-based API. Query-string presigning worked once I set the option to sign all headers, letting me bind content-length and content-type into the signature. An independently hand-rolled SigV4 implementation reproduced its signatures byte for byte, so the core crypto is correct.
- What got in the way
- The published docs and type declarations don't explain the header-signing option or how to set an expiry, so I had to read the distributed bundle. More seriously: the canonical string is built with percent-encoded spaces while the returned URL object serializes spaces as plus signs, so any signed query value containing a space produces a URL the service rejects. I had to post-process the query string myself.