Skip to content

SECENG-13376: Add getMulti() type to SecretsStoreSecret interface#6285

Draft
ang-cloudflare wants to merge 2 commits intocloudflare:mainfrom
ang-cloudflare:ang/SECENG-13376
Draft

SECENG-13376: Add getMulti() type to SecretsStoreSecret interface#6285
ang-cloudflare wants to merge 2 commits intocloudflare:mainfrom
ang-cloudflare:ang/SECENG-13376

Conversation

@ang-cloudflare
Copy link

Summary

Adds a getMulti() method to the SecretsStoreSecret type definition, allowing workers to fetch multiple secrets from the same store in a single request.

Motivation

Workers that need multiple secrets currently call get() sequentially for each one. Each call traverses the full JSRPC → service binding → edge service → QuickSilver path, with P99 latency of 200–500ms per call. For workers fetching 2–3 secrets, this compounds to 1–3s+ at the tail.
The secrets store edge service already supports a batch endpoint (store_secrets_multi), and the proxy worker now exposes it as getMulti() via SECENG-13376. This PR adds the corresponding TypeScript type so users get autocomplete and type checking without @ts-expect-error.

Usage

// Before: sequential, 2-3 round trips
const apiKey = await env.MY_SECRET.get();
const dbPass = await env.DB_SECRET.get();
// After: single round trip from any binding in the same store
const secrets = await env.MY_SECRET.getMulti(["API_KEY", "DB_PASSWORD", "AUTH_TOKEN"]);
// secrets = { API_KEY: "...", DB_PASSWORD: "...", AUTH_TOKEN: "..." }
Only found secrets are included in the returned record.
Changes
- types/defines/secrets-store.d.ts: Added getMulti(secretNames: string[]): Promise<Record<string, string>>

@ang-cloudflare ang-cloudflare requested a review from a team as a code owner March 9, 2026 23:51
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ang-cloudflare ang-cloudflare marked this pull request as draft March 9, 2026 23:53
@ang-cloudflare
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@ang-cloudflare
Copy link
Author

recheck

github-actions bot added a commit that referenced this pull request Mar 10, 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