[profile-switcher][rust] -- [2/2] Add app-server account session lifecycle#25383
[profile-switcher][rust] -- [2/2] Add app-server account session lifecycle#25383dhruvgupta-oai wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 726ad5b878
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1a33b2c to
66f3242
Compare
e708601 to
c4c1505
Compare
714f4eb to
c7f4b4b
Compare
0009a7e to
ffc9d4b
Compare
c7f4b4b to
9da2781
Compare
ffc9d4b to
6e0d3d5
Compare
9da2781 to
9dd4b40
Compare
6e0d3d5 to
cffab69
Compare
9dd4b40 to
5d83164
Compare
cffab69 to
fd36ea0
Compare
e39598b to
62ac0cb
Compare
8cf9a3d to
3ad4592
Compare
62ac0cb to
9dadbb3
Compare
| .map_err(|e| io::Error::other(format!("persist task failed: {e}")))??; | ||
|
|
||
| if should_revoke_auth_tokens(previous_auth.as_ref(), &auth) | ||
| if revoke_previous_auth |
There was a problem hiding this comment.
it should be up to the server (authapi) to do the revocation for switching, not the client
There was a problem hiding this comment.
i think this is existing code that i put a bool around
There was a problem hiding this comment.
yeah so i want to keep this minimal and not change existing code as much as i can. current app revokes the token when you login as someone new so keeping that convention for now.
cooper-oai
left a comment
There was a problem hiding this comment.
do we want to do this experimentally first?
Yes but keeping the og json so that this is backwards compatible
all this code is just additive APIs. Theres no actual change to the login functionality other than the bool for revoking the previous auth. The experiment / gate is gonna come from the desktop app. EDIT: I also added some more APIS for a new logout and new login path that we can call from desktop so we can fully gate this from the front-end side. |
…ocol (#25469) ## Summary Adds the app-server v2 `accountSession/*` protocol used by the Desktop profile switcher and the backend account metadata client needed to populate workspace choices. This is the protocol layer only. The app-server lifecycle and consolidated saved-session storage are split into a follow-up PR. ## Rust Stack 1. This PR 2. [#25383](#25383) adds app-server session lifecycle behavior and consolidated saved-session storage. ## Validation - Generated app-server schema fixtures are included from the existing generation flow in the lifecycle PR where the routes are registered. - Did not run tests per requested scope.
2849fba to
f784c75
Compare
Summary
Adds the shipped Rust app-server lifecycle for Desktop multi-account profile switching on top of the protocol PR.
Exposes additive
accountSession/login/start,accountSession/add,accountSession/list,accountSession/switch, andaccountSession/logoutroutes; stores all saved session credentials and metadata in oneaccount-sessions.json; keeps the activeauth.jsonsnapshot current; refreshes workspace metadata; and exchanges the bearer token when switching workspaces so backend routing uses the newly selected workspace.The existing
account/login/startandaccount/logoutroutes remain unchanged. The saved-session login route snapshots the active session before starting another browser login and does not revoke the previous session credentials. The saved-session logout route removes and revokes only the selected session.Addresses the review findings by returning an empty saved-session list for non-ChatGPT auth bootstrap, restoring the prior auth payload for add-without-switch, preserving managed sessions during additional login, deriving canonical metadata from parsed ID-token data, revoking sessions only during saved-session logout, and removing unused account-session plan and workspace-status metadata.
Rust Stack
Desktop Consumer Stack
Validation
just write-app-server-schema.