Skip to content

fix: support bare array format for SUPABASE_JWKS#8

Merged
tomaspozo merged 3 commits intomainfrom
fix/jwks-array-format
Mar 20, 2026
Merged

fix: support bare array format for SUPABASE_JWKS#8
tomaspozo merged 3 commits intomainfrom
fix/jwks-array-format

Conversation

@tomaspozo
Copy link
Copy Markdown
Member

@tomaspozo tomaspozo commented Mar 20, 2026

Summary

  • The Supabase platform provides SUPABASE_JWKS as a bare JSON array [{...}], but parseJwks expected { keys: [...] } format
  • Now auto-wraps bare arrays in { keys: [...] } so both formats work
  • Adds integration test using realistic platform env var shapes

tomaspozo and others added 2 commits March 20, 2026 02:02
The platform provides JWKS as a JSON array [...] but parseJwks
expected { keys: [...] }. Now wraps bare arrays automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies parsing of real platform env var shapes: multiple
named keys and bare JWKS array with two EC key entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 20, 2026 07:11
@tomaspozo tomaspozo requested a review from kallebysantos March 20, 2026 07:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates environment resolution to accept Supabase’s SUPABASE_JWKS value when provided as a bare JSON array (in addition to the standard { keys: [...] } JWKS shape), and adds tests to cover the new parsing behavior and realistic platform env var strings.

Changes:

  • Extend parseJwks to auto-wrap a bare array into { keys: [...] }.
  • Add a unit test for bare-array JWKS parsing.
  • Add an integration-style env parsing test for multi-key platform env vars plus JWKS array.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/core/resolve-env.ts Wraps parsed JWKS arrays into { keys: [...] } to support Supabase’s platform env var format.
src/core/resolve-env.test.ts Adds coverage for bare-array JWKS parsing and a realistic platform env var scenario.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/core/resolve-env.ts Outdated
Reject valid JSON that isn't a valid JWKS (e.g. primitives, empty
objects, objects with non-array `keys`) instead of blindly casting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@kallebysantos kallebysantos left a comment

Choose a reason for hiding this comment

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

Looks good to me!!
its similar to this other commit from ingress

@tomaspozo tomaspozo merged commit 6bd2e4d into main Mar 20, 2026
5 of 6 checks passed
@tomaspozo tomaspozo deleted the fix/jwks-array-format branch March 20, 2026 13:38
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.

3 participants