-
Notifications
You must be signed in to change notification settings - Fork 96
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
Allow user to control behavior when login fails; warn by default #946
Draft
mfisher87
wants to merge
21
commits into
main
Choose a base branch
from
warn-on-login-fail
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+155
−49
Draft
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
58efc88
Allow user to control behavior when login fails; warn by default
mfisher87 2571e10
Extract type alias
mfisher87 775976e
Give the top-level strategy function a default for "on_failure"
mfisher87 a8b204c
Fix integration test
mfisher87 f8e74b4
Make on_failure kw-only
mfisher87 b278742
Change argument to boolean, default to error
mfisher87 77d75a8
Fix unit tests
mfisher87 6f2cabf
Add breaking change to changelog
mfisher87 763fcbe
Add migration guide for next release
mfisher87 ce1b44c
Clarify migration language
mfisher87 cca538f
Clarify language in migration guide
mfisher87 720241d
Use explicit python value in docstring
mfisher87 f234231
Use explicit python value in docstring
mfisher87 bc18781
Raise LoginStrategyUnavailable when hostname not found in netrc
mfisher87 3154e47
Add explicit `pass` to exception classes
mfisher87 2cf8fc6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5539a25
Remove non-user-facing CHANGELOG entry
mfisher87 57535b2
Change voice in changelog entry
mfisher87 1c5de64
More explicit differentiation between exception classes
mfisher87 6ce736a
More explicit differentiation between exception classes
mfisher87 3c69ed2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class LoginStrategyUnavailable(Exception): | ||
"""The selected login strategy was skipped. | ||
This should be raised when a login strategy can't be attempted, for example because | ||
"environment" was selected but the envvars are not populated. | ||
DO NOT raise this exception when a login strategy is attempted and failed, for | ||
example because credentials were rejected. | ||
mfisher87 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
mfisher87 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
class LoginAttemptFailure(Exception): | ||
"""The login attempt failed.""" | ||
mfisher87 marked this conversation as resolved.
Show resolved
Hide resolved
mfisher87 marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
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.
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.
We don't want to skip without regard for what type of error occurs; instead I'm using the exception type to communicate from the inner call whether we skip or not. There's a difference between "strategy unavailable", "something unexpected happened with strategy", and "login failed", and we want the user and programmer to be able to tell!