Skip to content

Validate FLAGS_SECRET length for precompute JWS codes#380

Open
OWConnoi wants to merge 1 commit into
vercel:mainfrom
OWConnoi:codex/validate-flags-secret
Open

Validate FLAGS_SECRET length for precompute JWS codes#380
OWConnoi wants to merge 1 commit into
vercel:mainfrom
OWConnoi:codex/validate-flags-secret

Conversation

@OWConnoi
Copy link
Copy Markdown

What

This aligns precompute JWS signing/verification with the documented FLAGS_SECRET requirement by rejecting secrets that do not decode to 32 bytes.

Why

The JWE helpers already enforce a 256-bit key. Precompute serialization used the decoded secret directly for HS256, so accidentally short secrets were accepted. Using the same validation here makes misconfiguration fail early and keeps the secret handling consistent across the package.

Tests

  • npx --yes pnpm@10.19.0 --filter flags test
  • npx --yes pnpm@10.19.0 --filter flags check
  • npx --yes pnpm@10.19.0 --filter flags type-check

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 11, 2026

@OWConnoi is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

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