fix: default github export to private and stop blind-pushing on 422 (issue #1872) - #1906
Open
ionfwsrijan wants to merge 1 commit into
Open
fix: default github export to private and stop blind-pushing on 422 (issue #1872)#1906ionfwsrijan wants to merge 1 commit into
ionfwsrijan wants to merge 1 commit into
Conversation
|
@ionfwsrijan is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Problem
POST /project/<id>/export_githubcreated a public GitHub repository with no visibility prompt: the repo payload hard-coded"private": False, so clicking "Export to GitHub" exposed the starter code publicly with no consent. Additionally, on a 422 from repo creation (name already exists) the route silently proceeded to push the file into that existing repository, which could modify a repo the user did not intend to touch.Fix
project.htmlnow includes a visibility selector (Private is pre-selected), and the route readsvisibilityfrom the form, defaulting toprivatefor any missing/invalid value. The GitHub repo payload sets"private"accordingly, so a repo is never public unless the user explicitly chooses Public.PUTis never issued in that case.Files changed
src/routes/main_routes.py— read and validatevisibility(default private); pass it into the repo payload; return a clear error on 422 instead of continuing.src/templates/project.html— visibility selector (Private default / Public opt-in) in the export form.tests/test_basic.py— updated the 422 test to assert no blind-push; added tests that export defaults to a private repo and that a repo is only public when explicitly selected.Testing
private: True;visibility=public→private: False; 422 → redirects back to the project withPUTnever called.py_compilepasses on all modified files.Closes #1872