refactor(api): remove db type aliases and import sharedauth errors di…#2630
Conversation
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit b8f739e. Bugbot is set up for automated code reviews on this repo. Configure here. |
❌ 3 Tests Failed:
View the full list of 8 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
LGTM, straightforward refactor that removes unused type aliases and uses the underlying sharedauth types directly.
Extended reasoning...
Overview
This PR deletes packages/api/internal/db/apikeys.go (which contained only two type aliases) and updates processCustomErrors in packages/api/internal/utils/error.go to reference sharedauth.TeamForbiddenError/sharedauth.TeamBlockedError directly instead of via the db aliases. The db import in error.go is removed as it is no longer needed.
Security risks
None. This is a pure refactor with no runtime behavior change — errors.As against type aliases behaves identically to the underlying type, since Go type aliases are the same type.
Level of scrutiny
Minimal — this is a mechanical cleanup of an indirection layer. I verified with grep that there are no remaining references to db.TeamForbiddenError or db.TeamBlockedError in the packages/api tree, so the change should compile cleanly.
Other factors
The PR is two files, fewer than 15 lines of effective diff, and the cursor bot review flagged it low-risk. No reviewer comments are outstanding.
…rectly