-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Requesting a network page is first tried without retrieving authentication from the keyring. Credentials provided by other means are used already. If no authentication was found and the server answers with 401 or 403 the keyring is queried for credentials. This fixes #1917. * src/poetry/utils/constants.py (STATUS_AUTHLIST): A list of HTTP errors requesting authentication. Currently 401 and 403. * src/poetry/utils/authenticator.py (Authenticator.request): Retrieve credentials with disabled keyring first. On auth error try again with enabled keyring. * src/poetry/utils/authenticator.py (Authenticator.get_credentials_for_url): Add `keyring` option. * src/poetry/utils/authenticator.py (Authenticator._get_credentials_for_url: ^^^ same as above * src/poetry/utils/authenticator.py (Authenticator._get_credentials_for_repository): ^^^ * src/poetry/utils/authenticator.py (AuthenticatorRepositoryConfig.get_http_credentials): ^^^ * src/poetry/utils/password_manager.py (PasswordManager.get_http_auth): ^^^ * src/poetry/utils/password_manager.py (HTTPAuthCredential): Implement `empty` property that one of username or password exists. * src/poetry/utils/authenticator.py (Authenticator): Use `HTTPAuthCredential.empty`. Only cache non-empty credentials. * tests/utils/test_authenticator.py : Fix tests.
- Loading branch information
1 parent
a9ac06f
commit 8bfde6f
Showing
4 changed files
with
95 additions
and
27 deletions.
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
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