[Fix] Unify API route auth guards, add database indexes, extract shared utilities, and add API client retry#298
Merged
Conversation
…lities, and add API client retry
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…selectors, refine retryable status codes
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
guardApiRequest+requireApiUserto 6 previously unprotected API routes (summary,sessionPOST/PATCH/DELETE,session/sync,history,turns,sessions/[id]/turns)guardApiRequest(client header + rate limit) to 3 public catalog endpoints (scenarios,accents,asr/providers)011_add_indexes.sqlwith 6 secondary indexes for common query patternsnormalizeLocaletopackages/shared/src/locale.ts(was duplicated in 3 files)requireEnvtoapps/web/lib/server/env.ts(was duplicated in 5 provider files)sleeptopackages/shared/src/locale.ts(was duplicated in 3 mock files)packages/api-client(default 2 retries, 500ms base delay, retries on 5xx/429/timeout/network errors only)XUNFEI_TRIAL_VOICE_EXPIRES_ATenv var with fallbacke2e/session.spec.tscovering auth guard integration and page navigationTest Plan
npx vitest run— 118 tests pass (13 files), including 2 new retry testsnpx tsc --noEmit— type check passes with zero errorsCloses #297