fix(session-ingest): deny blocked users and stale token peppers - #5325
Conversation
Cache pepper and blocked_reason in session-ingest auth, reject ordinary tokens that fail those checks, and refuse session creation unless the user still exists and is unblocked.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Executive SummaryIncremental review of commit Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous Review Summaries (3 snapshots, latest commit 7764a9a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 7764a9a)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryIncremental review of commit Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Resolved Since Last Review
Fix these issues in Kilo Cloud Previous review (commit aaccc3b)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryIncremental review of the share-token cutover (public Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Previous review (commit 33f6496)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe auth-boundary hardening is well-tested and correct, but infrastructure failures in the new auth path are swallowed into silent 503s with no logging, and the new user-auth invalidation route has no caller in the monorepo yet. Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (13 files)
Reviewed by kimi-k3 · Input: 91.3K · Output: 13K · Cached: 601.2K Review guidance: REVIEW.md from base branch |
33f6496 to
aaccc3b
Compare
activeSessions.getToken now returns a one-hour ordinary API token so browser and mobile clients no longer receive pepperless internal-service tokens that bypass blocked-user and pepper checks.
A Secrets Store read failure is an infrastructure outage, not a bad caller credential. Missing or incorrect X-Internal-Secret still returns 401.
Summary
Session-ingest now treats user existence,
blocked_reason, and token pepper as part of the auth/admission boundary.user-auth:v1KV record (pepper + blocked reason) with a short TTL, plus an internal invalidation route.This Worker can be deployed on its own. Callers keep their existing service bindings; blocked/missing users start getting 403 / RPC errors immediately.
Verification
pnpm test,pnpm typecheck, andpnpm lintinservices/session-ingestVisual Changes
N/A
Reviewer Notes
The
packages/worker-utilschange is a comment only. The RPC method signature is unchanged;createSessionForCloudAgentnow throwsUser session creation is not allowedfor blocked/missing users.