You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relax userId input validation in admin.gastown.getUserTowns and admin.gastown.getUserRigs from z.string().uuid() to z.string().min(1), allowing legacy oauth/... user IDs to pass validation. The downstream gastown service already accepts arbitrary string IDs — the Zod UUID constraint was the only thing rejecting them.
Verification
Loaded the admin Gas Town tab for a user with an oauth/google/... ID and confirmed it renders without a BAD_REQUEST error.
Visual Changes
N/A
Reviewer Notes
Single-file change, two identical validator relaxations. No other admin router constrains userId to UUID.
Minimal, correct fix: relaxing userId validation from z.string().uuid() to z.string().min(1) in two admin-only gastown procedures to support legacy oauth/... user IDs, consistent with all other admin router procedures.
Files Reviewed (1 file)
apps/web/src/routers/admin/gastown-router.ts
Note: A theoretical path traversal concern exists because input.userId is interpolated directly into URL paths sent to the gastown service (e.g. /api/users/${input.userId}/towns). However, this is admin-only behind adminProcedure (requires is_admin: true), and the gastown service is an internal Cloudflare Worker protected by CF Access + short-lived admin JWTs — the exploitable surface is negligible. If future non-admin procedures adopt this pattern, consider URL-encoding the userId before interpolation.
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
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
Relax
userIdinput validation inadmin.gastown.getUserTownsandadmin.gastown.getUserRigsfromz.string().uuid()toz.string().min(1), allowing legacyoauth/...user IDs to pass validation. The downstream gastown service already accepts arbitrary string IDs — the Zod UUID constraint was the only thing rejecting them.Verification
Loaded the admin Gas Town tab for a user with an
oauth/google/...ID and confirmed it renders without a BAD_REQUEST error.Visual Changes
N/A
Reviewer Notes
Single-file change, two identical validator relaxations. No other admin router constrains userId to UUID.