[Fix] [Studio] Protect API key routes in proxy#67
Merged
Gautam25Raj merged 3 commits intoMay 21, 2026
Conversation
Gautam25Raj
reviewed
May 20, 2026
Gautam25Raj
requested changes
May 20, 2026
Collaborator
Gautam25Raj
left a comment
There was a problem hiding this comment.
Hi @dicnunz, thanks for submitting this PR to address the API key route protection!
Before we merge, we have a few pieces of feedback regarding the implementation and the test:
-
Workflow Reminder: For future contributions, please comment on the issue and wait to be assigned before opening a PR. This helps us coordinate and prevents overlapping work.
-
Redundant Route Matchers: In Next.js middleware, the
:path*syntax matches zero or more path segments. *"/api-keys/:path*"already covers both/api-keysand all of its subpaths (like/api-keys/create).- Please remove the redundant base path matchers (e.g.,
"/api-keys","/admin","/profile") fromconfig.matcherand stick to the wildcards (e.g.,"/api-keys/:path*").
- Please remove the redundant base path matchers (e.g.,
-
Review of the Test File:
- The unit test asserts the static contents of the
config.matcherarray rather than the actual runtime behavior of the middleware (redirection and cookie checks). - Tests asserting static configuration files are fragile and add maintenance overhead without providing functional regression safety. We recommend removing the test file entirely.
- The unit test asserts the static contents of the
If you can update the PR to clean up the matcher array and remove the test file, we'll be ready to get this formatted and merged!
Gautam25Raj
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api-keysand/api-keys/:path*to the studio proxy matcher so API key pages require authCloses #65
Tests