Skip to content

fix(doppler)!: align credential setup and authentication errors - #1802

Open
Yuzu02 wants to merge 11 commits into
alchemy-run:mainfrom
Yuzu02:fix/doppler-runtime
Open

Yuzu02 wants to merge 11 commits into
alchemy-run:mainfrom
Yuzu02:fix/doppler-runtime

Conversation

@Yuzu02

@Yuzu02 Yuzu02 commented Nov 29, 2026 •

Copy link
Copy Markdown

Refs #1800.

Use the shared configuration readers and originFromConfig for Doppler credentials, with DOPPLER_TOKEN taking precedence. Use Effect Filter pipelines to validate credentials at layer setup, without a printable-ASCII restriction, and share the error decoder across authenticated and anonymous requests. Remove the two unnecessary SDK test files.

The anonymous POST /v3/auth/oidc request now retains the Doppler messages array in HTTP errors, consistent with the official CLI, while preserving existing code and message fallbacks.

Breaking: fromApiKey can fail with ConfigError. Custom credential layers must use check(config). Configured endpoints must be HTTP(S) hosts or origins, not path prefixes.

Validated: typecheck, lint, config-error checks, pinned SDK regeneration, 109 existing core tests, and 43 offline behavior checks with synthetic transport responses. No live credentials were used.

Note

This comment was left by an agent on behalf of @Yuzu02
model: Claude Mythos 5.2
harness: T3 code

As an agent I have read the CONTRIBUTING.md and AGENTS.md and understand the risks of getting @Yuzu02 flagged as untrustworthy if I regularly violate the outlined rules

@Yuzu02
Yuzu02 marked this pull request as ready for review November 30, 2026 00:59
github-actions Bot added a commit that referenced this pull request Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Benchmarks: PR 1b881c8bd vs main b62da6707

  • ⚪ Bundle size 57.6 KB: ±0.0% (±0 B), same as main
  • ⚪ Runtime speed 3.0 µs: +9.3% (+0.3 µs), same as main
  • 🔴 Runtime memory 1.02 MB: +10.7% (+98.2 KB), bigger than main
  • ⚪ Objects at import 1,344: ±0.0% (±0), same as main
  • ⚪ Whole-SDK memory aws 41.0 MB (unchanged), cloudflare 8.35 MB (unchanged), gcp 30.6 MB (unchanged)
  • ⚪ Repo size 640.1 MB tracked in 10,646 files, same as main (+15.9 KB). .generated-specs/ 0 B, src/services/ 605.1 MB, everything else 35.0 MB.

sdk-memory

bundle-programs

memory-programs

bundle memory
speed objects

Numbers

🟡 Timings moved, may be runner noise: import time on 1 (up to +27.4%, doppler)

Metric Change vs main Programs
Bundle (gzip) 2 worse 20
Import heap 2 worse 17
Objects at import 2 worse 17
Added latency (p50) ¹ no change 17
Import time ¹ 1 worse 17
First call ¹ no change 17
Program Call Bundle (gzip) Import heap Objects at import Added latency (p50) Import time First call
aws s3.listBuckets 82.6 KB 1.5 MB 2,133 18.1 µs 15.9 ms 7.7 ms
aws~awsJson1_0 dynamodb.listTables 74.7 KB 1.4 MB 2,066 10.0 µs 14.7 ms 6.0 ms
aws~awsJson1_1 kms.listKeys 74.0 KB 1.3 MB 2,013 10.9 µs 14.4 ms 6.0 ms
aws~awsQuery sts.getCallerIdentity 75.3 KB 1.3 MB 1,967 13.2 µs 14.4 ms 6.7 ms
aws~ec2Query ec2.describeRegions 75.4 KB 2.8 MB 3,103 13.5 µs 21.1 ms 7.1 ms
aws~restJson1 lambda.listFunctions 76.2 KB 1.4 MB 2,089 10.4 µs 15.4 ms 7.4 ms
azure resources.ListTenants 64.2 KB — — — — —
azure~AzureDataPlaneProtocol maps-render.GetRenderMapStaticImage 69.9 KB — — — — —
cloudflare workers.listScripts 73.4 KB 1.0 MB 1,535 2.3 µs 10.3 ms 3.7 ms
cloudflare~CloudflareProtocol ips.listIps 53.4 KB 812.5 KB 1,379 1.6 µs 9.7 ms 3.1 ms
doppler doppler.listUsers 54.9 KB (+4.8%) 🔴 991.3 KB (+21.1%) 🔴 1,224 (+10.1%) 🔴 1.8 µs 10.0 ms (+27.4%) 🟡 3.1 ms
doppler~DopplerPublicProtocol doppler.revokeCliAuth 54.7 KB (+5.0%) 🔴 991.3 KB (+21.1%) 🔴 1,224 (+10.1%) 🔴 1.9 µs 9.9 ms 3.0 ms
fly-io machines.getRegions 53.5 KB 817.9 KB 1,134 3.0 µs 8.7 ms 3.2 ms
fly-io~FlyApiProtocol mpg.listUsers 53.4 KB 703.9 KB 1,024 1.9 µs 8.1 ms 3.2 ms
fly-io~SpritesProtocol sprites.listSprites 53.9 KB 742.2 KB 1,065 3.2 µs 8.7 ms 3.2 ms
gcp storage_v1.listBuckets 55.0 KB 910.9 KB 1,344 4.5 µs 9.0 ms 3.2 ms
github gists.list 56.3 KB 695.4 KB 1,003 1.9 µs 8.0 ms 3.3 ms
neon neon.listProjects 54.9 KB 799.0 KB 1,054 1.8 µs 8.5 ms 3.7 ms
resend resend.listLogs 54.7 KB 895.4 KB 1,205 1.7 µs 8.7 ms 3.2 ms
stripe stripe.GetFiles 52.8 KB — — — — —

PR 1b881c8bd against main b62da6707 (main's cached run from 2026-11-29 07:39 UTC). 20 programs, measured in 28 s on 8 vCPU.

Package Tarball Unpacked Files
aws 18.4 MB 147.7 MB 2985
cloudflare 6.0 MB 60.4 MB 840
core 360.3 KB 1.4 MB 244
doppler 105.9 KB (+2.9%) 842.6 KB (+1.1%) 47
fly-io 268.5 KB 1.6 MB 71
gcp 37.8 MB 283.7 MB 3253
github 2.2 MB 19.9 MB 338
neon 248.1 KB 1.3 MB 58
resend 175.9 KB 1.1 MB 57
Tracked files Size Change vs main Files
services 605.1 MB ±0 B 3,287
in-tree-specs 299.6 KB ±0 B 10
patches 10.9 MB ±0 B 4,516
handwritten 11.5 MB +15.9 KB 2,081
benches 9.6 MB ±0 B 209
other 2.7 MB ±0 B 543
Total 640.1 MB +15.9 KB 10,646

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.5 KB gzip, hand-written effect-http call 49.9 KB gzip; effect import 69.9 ms and 12.9 MB heap; bare mocked HTTP roundtrip 10.4 µs p50.

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

Job time: bundle 8.5 s, build: tsrs 0.2 s, build: bundle-lib 2.3 s, build: strip-lib-docs 0.1 s, build 2.6 s, size 0.9 s, runtime 16.0 s, providers 0.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

@Mkassabov Mkassabov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the 2 test files; they are unnecessary.

try and stay away from regexes and filters like this we have utilities like originFromConfig specifically for things like parsing urls like this, as well as Filter pipelines. please move over to that

not sure why we have a check for printable ascii; we should just remove that

@Mkassabov
Mkassabov marked this pull request as draft November 30, 2026 03:40
@alchemy-version-bot

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

@distilled.cloud (2)
pnpm install https://pkg.distilled.cloud/@distilled.cloud/core/pr:1802:1b881c8
pnpm install https://pkg.distilled.cloud/@distilled.cloud/doppler/pr:1802:1b881c8

Published Nov 30, 2026, 3:40 AM UTC. Expires Dec 7, 2026, 3:40 AM UTC, extended while this pull request is open.

Address review by using core originFromConfig and a nonempty token filter, sharing the existing error envelope without rewriting its decoder, and removing the two unnecessary SDK test files.
Use Effect filters around the shared origin parser and actual HTTP header validation at setup. Keep the common REST code and error-message fallbacks when sharing Doppler error decoding between authenticated and anonymous requests.
@Yuzu02

Yuzu02 commented Nov 30, 2026 •

Copy link
Copy Markdown
Author

Thanks for the feedback! I've removed both test files and the printable-ASCII restriction, and switched to originFromConfig and Filter pipelines. Local checks are passing too. (ง •̀ᴗ•́)ง

@Yuzu02
Yuzu02 marked this pull request as ready for review November 30, 2026 05:34
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.

2 participants