Repository navigation
control-plane: add the account functions and router mount that 49bec0a needs - #49
Merged
Merged
Conversation
…browser session The callback deliberately links rather than opening a new session when the caller is already signed in (oauth.py, since 7ed7c6b) -- the test was asserting two sessions from one browser that was never going to get them.
Member
Author
|
@Viscous106 this unblocks main (currently 500ing on drafting/approving a plan since 49bec0a). Both the fix and the gate numbers are independently verified, details in the description. The one thing in there that's your call, not something I fixed: the trial-abuse and redaction gaps under "What I verified is NOT yet safe to expose" — deletion is deliberately left unreachable (Caddy) until that's decided. Ready to merge whenever you've looked. |
9 of 10 tasks
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
49bec0a("say the free-credit limits before a plan is approved") addedroutes_account.py,user_settings.py, migration0017_user_settings.sql, and their tests, but never added the code they call:accounts.pyhad nounlink_wallet,unlink_identity,delete_account,credits_forfeited, or theNotFound/LastMethod/Busyexceptions;Settingshad nomodel_choices;app.pynever mounted the new router.mainhas been returning 500s on drafting a plan and approving a credits plan since that commit:pytest -m postgreswas 84 failed / 245 passed, pyright 34 errors.This PR adds exactly what those files and tests call for, and fixes one pre-existing bug the new tests happened to expose.
What's in it
826983a:accounts.py(the four functions + exceptions),config.py(planner_models/model_choices),app.py(mounts the router),auth.py(the trial route now checkscredits_forfeited, which the forfeit test needs and49bec0anever added),routes_plans.py(onestr | Nonenarrowing pyright needed).a7e8994: fixestest_signing_out_other_devices_keeps_this_one, which asserted two sessions from one browser that the OAuth callback was never going to give it (it deliberately links rather than re-sessioning an already-signed-in caller — that's been true since7ed7c6b, this PR doesn't touch it).What I verified
Two independent passes (implementer, then a from-scratch reviewer who re-ran every gate and redid 5 of 13 claimed mutation kills personally), both at
control-plane/:ruff check,ruff format --check: clean.pyright: 0 errors (34 before).pytest: 341 passed, unchanged.pytest -m postgres: 329 passed, 0 failed (84 failed / 245 passed before).accounts.pyfunctions is scoped to the caller's ownuser_id/addresses and runs inside the transaction the route already opens; the in-flight-plan check uses the same lock pattern approval does.What I verified is NOT yet safe to expose
Found while reviewing — none of this is new risk from this PR (it's either pre-existing or inherent to
49bec0a's own scope), but all of it should block turning on the account-settings/deletion UI:/v0/account/*, which doesn't matchDELETE /v0/account.test_caddy_routes.pyexists for exactly this and nobody added the new routes to its list. Deliberately left unfixed in this PR — it fails closed, and fixing it now would make the two gaps below reachable live before they're addressed.pr_requests.pr_urlstill names the repo after redaction; rotatingSESSION_SECRETsilently un-forfeits every past deletion (undocumented).These need a real decision on how "once per person" should actually be enforced before the account routes go live — happy to open an issue for it, or take direction here.
Type of change
fix— getsmainback to greenChecklist