feat(cli): add browser-assisted login and logout flow#1985
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit acd46bd. Configure here.
a78db43 to
c398f2e
Compare
Contributor
Coverage report (flow360)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
benflexcompute
approved these changes
Apr 23, 2026
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
flow360 loginandflow360 logoutfor Flow360 CLI authflow360.dev-simulation.cloudWhat changed
The CLI login callback server now supports:
payload+epk+ivThe CLI login command also now prints a manual fallback hint for headless environments:
flow360 configure ... --apikey <apikey>Why it changed
The frontend handoff now delivers an encrypted localhost callback payload, so the CLI needs to:
Security notes
This improves the current flow by removing the plaintext API key from the callback URL and normal browser history.
It does not fully eliminate plaintext exposure inside the browser page itself, because the page still receives the API key before encrypting it for the localhost callback. A future one-time backend code exchange would still be stronger.
Verification
Result:
10 passedstart screen:

success:

Note
Medium Risk
Adds new CLI auth flows that spin up a local HTTP callback server and process (including decrypt) browser handoff payloads, plus changes how API keys are stored/removed; mistakes here could break login or leak credentials.
Overview
Adds browser-assisted authentication to the CLI via new
flow360 login/flow360 logoutcommands.loginstarts a localhost callback server, opens a web login URL, accepts GET/POST callback payloads (optionally encrypted via P-256 ECDH + HKDF + AES-GCM), and stores the returned API key;logoutremoves a stored key for the selected profile/environment and reports when none exists.Refactors config persistence into
user_confighelpers (read_user_config/write_user_config/store_apikey/delete_apikey) and updatesconfigureto use them with centralized environment flag validation. Config directory/file permissions are now best-effort hardened (0700/0600), and tests are added/updated to cover configure/logout and login callback variants (plaintext, form-encoded, encrypted, and error paths).Reviewed by Cursor Bugbot for commit 8ec9150. Bugbot is set up for automated code reviews on this repo. Configure here.