You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Would you take a PR that replaces aws4fetch with sigflint in the Worker S3 store?
#752
I maintain sigflint (https://github.com/bompus/sigflint, MIT, no dependencies), a SigV4 signing library. This is a question before any code: would you want aws4fetch in apps/api/src/worker-s3-blob-store.ts replaced with it?
What the file does today: AwsClient (service s3, region from config, no session token, no presigned URLs) for a ranged GET, PUT, multipart create, part PUT, complete (XML body), abort and DELETE.
Equivalence: I signed 147 requests of those shapes (7 object keys with spaces, Cyrillic, ü, + & ' !, ~, % and nested paths, 3 endpoint styles: path-style localhost, virtual-hosted AWS, an R2 host, 7 operations) with aws4fetch 1.0.20 and with sigflint 1.0.4 at a fixed signing time. All 147 Authorization headers were identical. To match aws4fetch, sigflint has to be called with unsignedPayload: true, which is aws4fetch's S3 default, and with the signed headers listed. I have not sent a request to S3 or R2 with it beyond four read-only R2 requests.
Size, speed and memory, from sigflint's benchmark page (https://github.com/bompus/sigflint/blob/main/docs/benchmarks.md; signing only, no network, 2026-11-01, Tinybench and Hyperfine; speed uses two fresh processes per library and runtime, memory and import five rounds): header signing is 5,677 bytes minified against 7,428 for aws4fetch. For a plain S3 GET, aws4fetch takes 26.03 µs on Node 26.13.0 and 17.18 µs on Bun 1.4.4, sigflint 0.99 and 0.65 µs. On Node the heap allocated per call is 29.3 KiB against 2.6 KiB, the garbage-collection pause per 10,000 calls 14.6 ms against 0.3 ms, and importing the library plus the first signature 18.4 ms against 2.1 ms (on Bun the import difference is not clear). I did not time Cloudflare Workers, which is where this file runs, so I cannot say what the difference is there.
What it would cost: both libraries have no dependencies, so none goes away. aws4fetch's client.fetch retries failed requests (5xx and 429), and sigflint only returns headers, so the retries would have to be written separately or dropped. sigflint is ESM-only and needs Node 22.12 or newer.
If the smaller and faster signer is worth that to you, I would send one PR limited to that file, with a test that pins an exact Authorization value for a fixed time. If not, I understand.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I maintain sigflint (https://github.com/bompus/sigflint, MIT, no dependencies), a SigV4 signing library. This is a question before any code: would you want
aws4fetchinapps/api/src/worker-s3-blob-store.tsreplaced with it?What the file does today:
AwsClient(services3, region from config, no session token, no presigned URLs) for a ranged GET, PUT, multipart create, part PUT, complete (XML body), abort and DELETE.Equivalence: I signed 147 requests of those shapes (7 object keys with spaces, Cyrillic, ü,
+ & ' !,~,%and nested paths, 3 endpoint styles: path-style localhost, virtual-hosted AWS, an R2 host, 7 operations) with aws4fetch 1.0.20 and with sigflint 1.0.4 at a fixed signing time. All 147 Authorization headers were identical. To match aws4fetch, sigflint has to be called withunsignedPayload: true, which is aws4fetch's S3 default, and with the signed headers listed. I have not sent a request to S3 or R2 with it beyond four read-only R2 requests.Size, speed and memory, from sigflint's benchmark page (https://github.com/bompus/sigflint/blob/main/docs/benchmarks.md; signing only, no network, 2026-11-01, Tinybench and Hyperfine; speed uses two fresh processes per library and runtime, memory and import five rounds): header signing is 5,677 bytes minified against 7,428 for aws4fetch. For a plain S3 GET, aws4fetch takes 26.03 µs on Node 26.13.0 and 17.18 µs on Bun 1.4.4, sigflint 0.99 and 0.65 µs. On Node the heap allocated per call is 29.3 KiB against 2.6 KiB, the garbage-collection pause per 10,000 calls 14.6 ms against 0.3 ms, and importing the library plus the first signature 18.4 ms against 2.1 ms (on Bun the import difference is not clear). I did not time Cloudflare Workers, which is where this file runs, so I cannot say what the difference is there.
What it would cost: both libraries have no dependencies, so none goes away. aws4fetch's
client.fetchretries failed requests (5xx and 429), and sigflint only returns headers, so the retries would have to be written separately or dropped. sigflint is ESM-only and needs Node 22.12 or newer.If the smaller and faster signer is worth that to you, I would send one PR limited to that file, with a test that pins an exact Authorization value for a fixed time. If not, I understand.
(Disclosure: I wrote and maintain sigflint.)
All reactions