-
Notifications
You must be signed in to change notification settings - Fork 342
fix JWK endpoints returning empty keys #4662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix JWK endpoints returning empty keys #4662
Conversation
|
@sweatybridge kindly review. Thanks |
6e88d0e to
159381e
Compare
Pull Request Test Coverage Report for Build 20494065924Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
159381e to
b8cad1c
Compare
| return errors.Errorf("failed to read signing keys: %w", err) | ||
| } else if c.Auth.SigningKeys, err = fetcher.ParseJSON[[]JWK](f); err != nil { | ||
| return errors.Errorf("failed to decode signing keys: %w", err) | ||
| if err := c.loadSigningKeys(fsys); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this refactor is unnecessary because ParseJSON closes the reader automatically
|
|
||
| func Run(ctx context.Context, fsys afero.Fs, interactive bool, params utils.InitParams) error { | ||
| // 1. Write `config.toml`. | ||
| // 1. Generate default signing key if it doesn't exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since supabase init is no longer a prerequisite for supabase start, we cannot assume users will always run init before start. Let's handle signing key generation as part of config loading instead.
|
@sweatybridge just to confirm, this PR isn't necessary anymore with the recent merge right? |
|
Yea it's no longer needed but thanks for picking up this issue anyway! |
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
The JWKS endpoint (
/auth/v1/.well-known/jwks.json) returns an empty keys array ({"keys": []})for local Supabase instances because signing keys are not automatically generated during supabase init. Users must manually generate signing keys using supabase gen signingkeys and configuresigning_keys_pathinconfig.toml.Issue: #4614
What is the new behavior?
Additional context
Add any other context or screenshots.
