Skip to content

feat(aws): Signer, a service that signs requests in place of the local key - #1328

Draft
sam-goodwin wants to merge 2 commits into
mainfrom
feat/aws-signer
Draft

sam-goodwin wants to merge 2 commits into
mainfrom
feat/aws-signer

Conversation

@sam-goodwin

Copy link
Copy Markdown
Member

A Signer in context signs AWS requests in place of the local SigV4 key, so a caller that holds no key can still send requests straight to AWS with a signature made elsewhere.

import { Signer, unsignedCredentials } from "@distilled.cloud/aws/Signer";

const signed = Layer.mergeAll(
  Layer.succeed(Signer, {
    // ask a process that holds the key; it returns the signed headers (or a presigned URL)
    sign: (request) => askTheKeyHolder(request),
  }),
  // Credentials must still resolve; these sign nothing
  unsignedCredentials(Effect.succeed("us-west-2")),
);

yield* S3.getObject({ Bucket, Key }).pipe(Effect.provide(signed));
  • Without a Signer, signing is unchanged.
  • sign receives what SigV4.sign takes, minus the key, plus regionSet for SigV4A.
  • Operation requests, presignUrl and operation presigning (Presigning) all go through it.

Used by alchemy-run/alchemy#3470: a sandbox's gateway signs with its role, and the sandbox sends the request itself.

github-actions Bot added a commit that referenced this pull request Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Benchmarks: PR 132b8d22a vs main 294d116ba

  • ⚪ Bundle size 54.7 KB: ±0.0% (±0 B), same as main
  • ⚪ Runtime speed 3.1 µs: +20.5% (+0.5 µs), same as main
  • ⚪ Runtime memory 795.4 KB: ±0.0% (±0 B), same as main
  • ⚪ Objects at import 1,084: ±0.0% (±0), same as main
  • ⚪ Whole-SDK memory cloudflare 8.27 MB (unchanged), gcp 24.8 MB (unchanged), aws 39.7 MB (−0.0%)
  • ⚪ Repo size 543.9 MB tracked in 9,898 files, same as main (+3.9 KB). .generated-specs/ 0 B, src/services/ 512.0 MB, everything else 31.9 MB.

sdk-memory

bundle-programs

memory-programs

bundle memory
speed objects

Numbers

🟡 Timings moved, may be runner noise: import time on 4 (up to +48.0%, github)

Metric Change vs main Programs
Bundle (gzip) no change 17
Import heap no change 6
Objects at import no change 6
Added latency (p50) ¹ no change 6
Import time ¹ 4 worse 6
First call ¹ no change 6
Program Call Bundle (gzip) Import heap Objects at import Added latency (p50) Import time First call
aws s3.listBuckets 79.4 KB — — — — —
aws~awsJson1_0 dynamodb.listTables 71.7 KB — — — — —
aws~awsJson1_1 kms.listKeys 71.0 KB — — — — —
aws~awsQuery sts.getCallerIdentity 72.4 KB — — — — —
aws~ec2Query ec2.describeRegions 72.5 KB — — — — —
aws~restJson1 lambda.listFunctions 73.2 KB — — — — —
azure resources.ListTenants 57.0 KB — — — — —
cloudflare workers.listScripts 69.3 KB — — — — —
cloudflare~CloudflareProtocol ips.listIps 49.9 KB — — — — —
fly-io machines.getRegions 50.9 KB 776.7 KB 1,088 4.9 µs 9.1 ms 3.7 ms
fly-io~FlyApiProtocol mpg.listUsers 50.6 KB 668.0 KB 982 2.8 µs 9.5 ms (+37.3%) 🟡 3.8 ms
fly-io~SpritesProtocol sprites.createOrganizationToken 51.3 KB 706.2 KB 1,024 7.3 µs 9.8 ms (+32.9%) 🟡 4.1 ms
gcp storage_v1.listBuckets 51.8 KB — — — — —
github gists.list 53.4 KB 639.7 KB 954 3.1 µs 9.6 ms (+48.0%) 🟡 3.9 ms
neon neon.listProjects 52.1 KB 837.8 KB 1,084 1.8 µs 8.9 ms 3.9 ms
resend resend.listLogs 51.9 KB 859.3 KB 1,144 2.2 µs 9.5 ms (+28.4%) 🟡 3.5 ms
stripe stripe.GetFiles 50.1 KB — — — — —

PR 132b8d22a against main 294d116ba (main's cached run from 2026-11-21 04:12 UTC). 17 programs, measured in 47 s on 8 vCPU.

Package Tarball Unpacked Files
core 331.2 KB 1.3 MB 229
fly-io 250.2 KB 1.6 MB 71
github 2.1 MB 19.6 MB 338
neon 221.4 KB 1.2 MB 47
resend 173.2 KB 1.2 MB 57
s3 425.6 KB (+0.5%) 2.5 MB (+0.3%) 250
Tracked files Size Change vs main Files
services 512.0 MB ±0 B 3,024
in-tree-specs 98.3 KB ±0 B 4
patches 10.1 MB ±0 B 4,189
handwritten 9.6 MB +3.9 KB 1,959
benches 9.6 MB ±0 B 207
other 2.6 MB ±0 B 515
Total 543.9 MB +3.9 KB 9,898

What a checkout or worktree writes to disk, from git ls-tree (benches/repo-size/tree.ts). The dashboard's Repo size page has the full picture.

Effect alone: effect-minimal bundle 8.9 KB gzip, hand-written effect-http call 48.6 KB gzip; effect import 81.5 ms and 12.8 MB heap; bare mocked HTTP roundtrip 11.9 µs p50.

Bundled (from src/): resend, neon, github, fly-io, aws, cloudflare, gcp, azure, stripe, s3. Built and probed (from lib/): resend, neon, github, fly-io, s3. Changed in this PR: aws, s3. No target in targets.json: s3.

Job time: bundle 8.2 s, build: tsrs 1.4 s, build: bundle-lib 20.0 s, build: strip-lib-docs 0.1 s, build 21.5 s, size 1.2 s, runtime 13.5 s, providers 3.0 s.

¹ Timings run on a different runner than main's, so 🟡 marks a large move that may still be noise. Sizes, heap and object counts are stable. Offline: every call hits a canned in-memory response. Full suite: node benches/sdks/run.ts. Job log

@alchemy-version-bot

alchemy-version-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

@distilled.cloud (7)
pnpm install https://pkg.distilled.cloud/@distilled.cloud/aws/pr:1328:132b8d2
pnpm install https://pkg.distilled.cloud/@distilled.cloud/aws4signer/pr:1328:132b8d2
pnpm install https://pkg.distilled.cloud/@distilled.cloud/cloudflare/pr:1328:132b8d2
pnpm install https://pkg.distilled.cloud/@distilled.cloud/core/pr:1328:132b8d2
pnpm install https://pkg.distilled.cloud/@distilled.cloud/digitalocean/pr:1328:132b8d2
pnpm install https://pkg.distilled.cloud/@distilled.cloud/prisma/pr:1328:132b8d2
pnpm install https://pkg.distilled.cloud/@distilled.cloud/s3/pr:1328:132b8d2

Published Nov 21, 2026, 6:14 AM UTC. Expires Nov 28, 2026, 6:14 AM UTC, extended while this pull request is open.

github-actions Bot added a commit that referenced this pull request Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant