Skip to content

fix(api): replace raw error responses with generic ErrInternalServerError#1620

Open
rohilsurana wants to merge 1 commit into
mainfrom
fix/sanitize-internal-error-responses
Open

fix(api): replace raw error responses with generic ErrInternalServerError#1620
rohilsurana wants to merge 1 commit into
mainfrom
fix/sanitize-internal-error-responses

Conversation

@rohilsurana
Copy link
Copy Markdown
Member

Summary

  • 21 call sites across 6 handler files were returning raw internal errors to clients via connect.NewError(connect.CodeInternal, err), leaking DB table names, OIDC config, SMTP details, SpiceDB addresses, and file paths
  • Replaced all with connect.NewError(connect.CodeInternal, ErrInternalServerError) which returns a generic "internal server error" message
  • All call sites already had errorLogger.LogUnexpectedError / errorLogger.LogServiceError calls logging the real error server-side before returning

Files changed

  • authenticate.go — 10 fixes (unauthenticated endpoints, highest risk)
  • authorize.go — 2 fixes
  • kyc.go — 3 fixes
  • organization.go — 2 fixes
  • role.go — 2 fixes
  • serviceuser.go — 2 fixes

Test plan

  • go build and go vet pass
  • Zero remaining connect.NewError(connect.CodeInternal, err) in handler files
  • Verify error responses return generic message, not raw error details

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment May 15, 2026 1:19pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@rohilsurana has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 23 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 844191ed-3c02-4f20-aa35-3c0d97e51a01

📥 Commits

Reviewing files that changed from the base of the PR and between c922ba4 and 9b151a9.

📒 Files selected for processing (6)
  • internal/api/v1beta1connect/authenticate.go
  • internal/api/v1beta1connect/authorize.go
  • internal/api/v1beta1connect/kyc.go
  • internal/api/v1beta1connect/organization.go
  • internal/api/v1beta1connect/role.go
  • internal/api/v1beta1connect/serviceuser.go

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.

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.

1 participant