Skip to content

[Fix] [Studio] Protect API key routes in proxy#67

Merged
Gautam25Raj merged 3 commits into
VeriWorkly:masterfrom
dicnunz:fix/protect-api-keys-route-65
May 21, 2026
Merged

[Fix] [Studio] Protect API key routes in proxy#67
Gautam25Raj merged 3 commits into
VeriWorkly:masterfrom
dicnunz:fix/protect-api-keys-route-65

Conversation

@dicnunz
Copy link
Copy Markdown
Contributor

@dicnunz dicnunz commented May 20, 2026

Summary

  • Add /api-keys and /api-keys/:path* to the studio proxy matcher so API key pages require auth
  • Add a proxy contract test covering the guarded API key routes

Closes #65

Tests

Comment thread apps/studio/proxy.ts Outdated
Copy link
Copy Markdown
Collaborator

@Gautam25Raj Gautam25Raj left a comment

Choose a reason for hiding this comment

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

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:

  1. 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.

  2. Redundant Route Matchers: In Next.js middleware, the :path* syntax matches zero or more path segments. * "/api-keys/:path*" already covers both /api-keys and all of its subpaths (like /api-keys/create).

    • Please remove the redundant base path matchers (e.g., "/api-keys", "/admin", "/profile") from config.matcher and stick to the wildcards (e.g., "/api-keys/:path*").
  3. Review of the Test File:

    • The unit test asserts the static contents of the config.matcher array 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.

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 Gautam25Raj changed the title Protect API key routes in studio proxy [Fix] [Studio] Protect API key routes in proxy May 20, 2026
@Gautam25Raj Gautam25Raj added enhancement New feature or request frontend UI/client-side code labels May 20, 2026
@Gautam25Raj Gautam25Raj merged commit 4ad0a91 into VeriWorkly:master May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend UI/client-side code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Protect /api-keys page from unauthenticated access

2 participants