Guard all (still public) endpoints with authentication checks#23
Merged
Conversation
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
Security audit that enforces authentication on all API endpoints that were previously accessible without a session.
menus.ts— AddedrequireAuthenticatedActorto all 9 mutation/read handlers (create, update, delete menu/items, import, preview).GET /api/menuswas public before; now requires auth too.foodSelections.ts— Auth guard added to 3 GET endpoints (active selection, history, fallback candidates).polls.ts— Auth guard added to 2 GET endpoints (active poll, poll by ID).shoppingList.ts— Auth guard added to 1 GET endpoint.agent()helper to send auth cookies; food-selection, poll, and meal-recommendation tests updated theircreateMenu/createMenuItemhelpers and relevant GETs to includeapprovedAuthHeaders().prisma-generate-safe.mjs— Now clears stale generated client dirs before regenerating (fixes sqlite/postgres client pollution)..faim/— Formal invariant memory bootstrapped;auth_on_mutationsinvariant passes with 0 violations.What stays public
Auth-bootstrap endpoints only:
/api/auth/config,/api/auth/local/login,/api/auth/logout,/api/auth/entra/*, and the static SPA.