Skip to content
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

feat: tty free login #816

Merged
merged 14 commits into from
Nov 25, 2024
Merged

Conversation

maffettone
Copy link
Contributor

@maffettone maffettone commented Nov 20, 2024

Closes #815

Adds

Hook to send password directly to authenticate. Not added to login since context.authenticate is meant for programatic use, and we probably shouldn't encourage general users to type their password without getpass protections. Tests are added to mirror auth tests.
prompt_for_reauthentication is expected as True for the hook to function, and the CannotPrompt error is updated to reflect that. Alternatively, this could be updated to use if not prompt_for_reauthentication and password is not UNSET.

Fixes

Idempotency in context manager used by tests to avoid TTY input for context manager. (It was used in all tests previously, so idempotentcy was not relevant).

Checklist

  • Add a Changelog entry
  • Add the ticket number which this PR closes to the comment section

tiled/_tests/test_authentication.py Outdated Show resolved Hide resolved
tiled/_tests/utils.py Show resolved Hide resolved
@maffettone
Copy link
Contributor Author

@danielballan green and ready for a another pass

@danielballan
Copy link
Member

Looks good to me but let's get one more pair of eyes on this -- requested review from @genematx

Copy link
Contributor

@padraic-shafer padraic-shafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!
A few optional suggestions here that I think would benefit the documentation.

tiled/_tests/utils.py Outdated Show resolved Hide resolved
tiled/client/context.py Show resolved Hide resolved
tiled/_tests/test_authentication.py Outdated Show resolved Hide resolved
@danielballan danielballan merged commit d0e8ac1 into bluesky:main Nov 25, 2024
8 checks passed
@maffettone maffettone deleted the feat-tty-free-login branch November 25, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make authentication prompt hookable
4 participants