fix(security): require auth for mundane comprehensive Groq - #47
Draft
cursor[bot] wants to merge 2 commits into
Draft
cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Unauthenticated POST /api/mundane-astrology/comprehensive called Groq (llama-3.3-70b, 2400 tokens, 3 attempts) with no rate limit. Stage B now generates in-process; the public route requires a Bearer token. Co-authored-by: ANDY OLIVER ROZARIO <AndyOliverR@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What changed
POST /api/mundane-astrology/comprehensivenow requires a Firebase Bearer token and AI rate limiting. Unauthenticated callers can no longer burn Groq credits.generateMundaneComprehensiveso profile generation does not depend on an unauthenticated HTTP loopback.AuthorizationthroughfetchWithFirebaseAuthRequired.Why this change is safe
callStructuredAI(llama-3.3-70b-versatile, 2400 tokens, 3 attempts) with no auth and no rate limit. Stage B and the tool page both hit that route without a Bearer token.data.comprehensiveAnalysis) is unchanged.userIdreturns 403.Verification
tests/integration/mundane-comprehensive-auth.test.ts(401 missing/invalid, 403 mismatch, 200 owner)pnpm test— 62 suites / 325 tests passedpnpm run lint:securitypassedpnpm run lint(full-repo not required by inner-loop plans)pnpm run securitystill fails on pre-existing highnanoid/extract-zipadvisories unrelated to this fix.Regression prevention
tests/integration/mundane-comprehensive-auth.test.ts— would fail on main because the route generated without auth.{ comprehensiveAnalysis }so mystical-profile / tool report consumers are unchanged.Release checklist (solo-friendly)
CI / Lint + JestCI / Playwright smokemain.