Skip to content

fix(admin): relax userId validation in gastown router for legacy oauth/* IDs#3497

Merged
jrf0110 merged 1 commit into
mainfrom
gt/toast/6f7b350e
May 26, 2026
Merged

fix(admin): relax userId validation in gastown router for legacy oauth/* IDs#3497
jrf0110 merged 1 commit into
mainfrom
gt/toast/6f7b350e

Conversation

@jrf0110
Copy link
Copy Markdown
Contributor

@jrf0110 jrf0110 commented May 26, 2026

Summary

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.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 26, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

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.

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-4.6 · 394,098 tokens

Review guidance: REVIEW.md from base branch main

@jrf0110 jrf0110 merged commit df49ffc into main May 26, 2026
17 checks passed
@jrf0110 jrf0110 deleted the gt/toast/6f7b350e branch May 26, 2026 18:29
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.

2 participants