Fix credentials set via environment variables#2955
Closed
fbergroth wants to merge 5 commits intopython-poetry:masterfrom
Closed
Fix credentials set via environment variables#2955fbergroth wants to merge 5 commits intopython-poetry:masterfrom
fbergroth wants to merge 5 commits intopython-poetry:masterfrom
Conversation
config.get('http-basic') may not list repositories if credentials are set via
environment variables.
Closed
3 tasks
b833165 to
4cea791
Compare
4cea791 to
1733ed9
Compare
Member
|
@fbergroth #2990 will close this PR. I have kept your attribution for your test changes (408b0fb). For the @pytest.fixture
def environment_repository(monkeypatch):
monkeypatch.setenv("POETRY_REPOSITORIES_FOO_URL", "https://foo.bar/simple/")
def test_authenticator_uses_env_provided_credentials_and_repo(
config, environ, mock_remote, http, environment_repository_credentials, environment_repository
):
authenticator = Authenticator(config, NullIO())
authenticator.request("get", "https://foo.bar/files/foo-0.1.0.tar.gz")
request = http.last_request()
assert "Basic YmFyOmJheg==" == request.headers["Authorization"] |
Member
|
Closing this in favour of #2990. Support of |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
config.get('http-basic')may not list repositories if credentials are set via environment variables. This fixes that by listing repositories fromconfig.get('repositories').However, the user still need to configure the repo url like
poetry config repositories.foo .... It doesn't work by simply setting the environment variablePOETRY_REPOSITORIES_FOO_URL, as there is currently no way to iterate over the repository names set via environment variables.I added a commit 1733ed9 to show a potential solution to this, but it might need to be reworked a bit. I can split it out in a separate PR if needed.
Pull Request Check List
Resolves: #2799