Repository navigation
Conversation
This was referenced Dec 2, 2026
This branch has not been 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.
Summary
Hardens request handling and access boundaries on the backend API. The API is local-first and unauthenticated, so these changes tighten what the browser and callers are allowed to do.
Four related changes:
jobs.py): the upload target is now derived from the file's basename and confined to the server-created temp dir, instead of trusting a client-supplied path.credentials.py): the stored key is no longer returned by the API.is_authenticatedalready tells the UI whether a key is saved; the dialog starts with an empty field.front_api.py): requested paths are resolved and refused unless they stay inside the frontend build directory.app.py,config.py): allowed origins are now an explicit list (newCORS_ALLOWED_ORIGINSsetting, default is the dev frontend) instead of*. Production is served from the same origin, so it is unaffected.Tests
Notes
CORS_ALLOWED_ORIGINSis configurable for setups that serve the frontendfrom another origin (e.g. a remote host). It should never be set to
*.