Skip to content

fix: authenticate /internal/admin and /gw/*proxy (#672 #665) - #695

Merged
poyrazK merged 1 commit into
poyrazK:mainfrom
jackthepunished:fix/admin-and-gateway-auth-672-665
Jun 13, 2026
Merged

fix: authenticate /internal/admin and /gw/*proxy (#672 #665)#695
poyrazK merged 1 commit into
poyrazK:mainfrom
jackthepunished:fix/admin-and-gateway-auth-672-665

Conversation

@jackthepunished

@jackthepunished jackthepunished commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Authenticates two previously unauthenticated endpoints:

…#665)

- /internal/admin/reset-circuit-breakers was reachable without auth;
  now requires Auth + PermissionFullAccess (poyrazK#672).
- /gw/*proxy was reachable without auth; now requires Auth so the
  per-tenant routing rules cannot be exercised anonymously (poyrazK#665).
Copilot AI review requested due to automatic review settings May 25, 2026 03:08
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jackthepunished, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 59 minutes and 21 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2ef789f4-b773-4dd3-b188-84ca2dead96e

📥 Commits

Reviewing files that changed from the base of the PR and between e0f151b and 68ec051.

📒 Files selected for processing (1)
  • internal/api/setup/router.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added bug Something isn't working size/xs labels May 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Secures previously public/internal endpoints by adding authentication (and RBAC for internal admin), reducing unauthorized access to sensitive routes.

Changes:

  • Added authentication middleware to the /gw/*proxy gateway proxy route.
  • Added authentication + PermissionFullAccess guard to /internal/admin endpoints.

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

Comment on lines +207 to +211
// The actual Gateway Proxy (authenticated)
r.Any("/gw/*proxy",
httputil.Auth(services.Identity, services.Tenant),
handlers.Gateway.Proxy,
)
Comment on lines 761 to +766
// Internal admin endpoints (E2E test support)
internalGroup := r.Group("/internal/admin")
internalGroup.Use(
httputil.Auth(svcs.Identity, svcs.Tenant),
httputil.Permission(svcs.RBAC, domain.PermissionFullAccess),
)

@poyrazK poyrazK left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

It's okay to merge

@poyrazK
poyrazK merged commit 9bfeb83 into poyrazK:main Jun 13, 2026
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRITICAL: Unauthenticated /internal/admin/reset-circuit-breakers endpoint CRITICAL: Unauthenticated API Gateway Proxy at /gw/*proxy

3 participants