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.
fix: secure login flow with copy-paste API key exchange #337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: secure login flow with copy-paste API key exchange #337
Changes from all commits
26d4945ca9c413c4595c3File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This echoes the key to the terminal — it ends up in scrollback, screen recordings, and shoulder-surfing range. For a security-focused PR, prefer
rich.prompt.Prompt.ask("Paste the API key", password=True)orgetpass.getpass. The user already has the key visible in the browser; they don't need it echoed again here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A wrong/empty paste currently forces the user to rerun
flash login, which means re-approving in the browser. A small retry loop (e.g. 3 attempts) would be friendlier without weakening security.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now any non-empty string gets written to the credentials file. Worth at minimum a prefix check (e.g.
rpa_) so a fat-fingered paste fails loudly. Even better: fire a cheap authenticated call (e.g.myself) to confirm the key works before persisting, so users don't discover the bad paste on the next command.Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.