We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Setting credentials through env. variable are not working
<!-- Checked checkbox should look like this: [x] -->
- [ x ] I am on the [latest](https://github.com/python-poetry/poetry/releases/latest) Poetry version.
- [ x ] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate.
- [ x ] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).

<!--
  Once those are done, if you're able to fill in the following list with your information,
  it'd be very helpful to whoever handles the issue.
-->

- **OS version and name**: *nix
- **Poetry version**: Poetry version 1.0.0

## Issue
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ -->
I'm failing to use env. variables to set custom pypi credentials. 

My pyproject.toml contains private pypi's like this:
```toml
[[tool.poetry.source]]
url = "https://XXXXX/nexus/repository/pypi-central/simple"
name = "nexus"
```
I'm running this script:
```sh
export POETRY_HTTP_BASIC_NEXUS_USERNAME=****
export POETRY_HTTP_BASIC_NEXUS_PASSWORD=****
poetry install
```
and it fails with:
```
[EnvCommandError]
Command ['/opt/.cache/pypoetry/virtualenvs/YYYY-4zvP7SOo-py3.8/bin/pip', 'install', '--no-deps', '--index-url', 'https://XXXXX/nexus/repository/pypi-central/simple', '--extra-index-url', 'https://pypi.org/', 'six==1.12.0'] errored with the following return code 2, and output: 
Looking in indexes: https://RESOLVED-XXXXX/nexus/repository/pypi-central/simple, https://****:****@XXXXX/nexus/repository/epd-pypi/simple, https://pypi.org/
Collecting six==1.12.0

....

File "/opt/.cache/pypoetry/virtualenvs/YYYY-4zvP7SOo-py3.8/lib/python3.8/site-packages/pip/_internal/download.py", line 386, in handle_401
    username, password, save = self._prompt_for_password(parsed.netloc)
  File "/opt/.cache/pypoetry/virtualenvs/YYYY-4zvP7SOo-py3.8/lib/python3.8/site-packages/pip/_internal/download.py", line 358, in _prompt_for_password
    username = ask_input("User for %s: " % netloc)
  File "/opt/.cache/pypoetry/virtualenvs/YYYY-4zvP7SOo-py3.8/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 281, in ask_input
    return input(message)
EOFError: EOF when reading a line
User for XXXXX: 
```

I investigated the code and it seems that credentials are never acquired separately from config, but always as a pair. That means that code never ask for `http-basic.nexus.password` and `http-basic.nexus.username`, but for `http-basic.nexus` then the value is used as a dict (search for `password_manager.get_http_auth` usage). I could not find single test case, so I wrote one, fill free to use it:
```diff
diff --git a/tests/config/test_config.py b/tests/config/test_config.py
index 07373ad..72ad236 100644
--- a/tests/config/test_config.py
+++ b/tests/config/test_config.py
@@ -14,3 +14,13 @@ def test_config_get_from_environment_variable(config, environ):

     os.environ["POETRY_VIRTUALENVS_CREATE"] = "false"
     assert not config.get("virtualenvs.create")
+
+def test_basic_http_credentials_through_env(config, environ):
+    assert config.get("http-basic.test_repo") is None
+
+    os.environ["POETRY_HTTP_BASIC_TEST_REPO_USERNAME"] = "foo"
+    os.environ["POETRY_HTTP_BASIC_TEST_REPO_PASSWORD"] = "bar"
+    credentials = config.get("http-basic.test-repo")
+    assert credentials is not None
+    assert credentials["username"] == "foo"
+    assert credentials["password"] == "bar"
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `poetry/utils/password_manager.py`
Content:
```
1 import logging
2 
3 
4 logger = logging.getLogger(__name__)
5 
6 
7 class PasswordManagerError(Exception):
8 
9     pass
10 
11 
12 class KeyRingError(Exception):
13 
14     pass
15 
16 
17 class KeyRing:
18     def __init__(self, namespace):
19         self._namespace = namespace
20         self._is_available = True
21 
22         self._check()
23 
24     def is_available(self):
25         return self._is_available
26 
27     def get_password(self, name, username):
28         if not self.is_available():
29             return
30 
31         import keyring
32         import keyring.errors
33 
34         name = self.get_entry_name(name)
35 
36         try:
37             return keyring.get_password(name, username)
38         except (RuntimeError, keyring.errors.KeyringError):
39             raise KeyRingError(
40                 "Unable to retrieve the password for {} from the key ring".format(name)
41             )
42 
43     def set_password(self, name, username, password):
44         if not self.is_available():
45             return
46 
47         import keyring
48         import keyring.errors
49 
50         name = self.get_entry_name(name)
51 
52         try:
53             keyring.set_password(name, username, password)
54         except (RuntimeError, keyring.errors.KeyringError) as e:
55             raise KeyRingError(
56                 "Unable to store the password for {} in the key ring: {}".format(
57                     name, str(e)
58                 )
59             )
60 
61     def delete_password(self, name, username):
62         if not self.is_available():
63             return
64 
65         import keyring
66         import keyring.errors
67 
68         name = self.get_entry_name(name)
69 
70         try:
71             keyring.delete_password(name, username)
72         except (RuntimeError, keyring.errors.KeyringError):
73             raise KeyRingError(
74                 "Unable to delete the password for {} from the key ring".format(name)
75             )
76 
77     def get_entry_name(self, name):
78         return "{}-{}".format(self._namespace, name)
79 
80     def _check(self):
81         try:
82             import keyring
83         except Exception as e:
84             logger.debug("An error occurred while importing keyring: {}".format(str(e)))
85             self._is_available = False
86 
87             return
88 
89         backend = keyring.get_keyring()
90         name = backend.name.split(" ")[0]
91         if name == "fail":
92             logger.debug("No suitable keyring backend found")
93             self._is_available = False
94         elif "plaintext" in backend.name.lower():
95             logger.debug("Only a plaintext keyring backend is available. Not using it.")
96             self._is_available = False
97         elif name == "chainer":
98             try:
99                 import keyring.backend
100 
101                 backends = keyring.backend.get_all_keyring()
102 
103                 self._is_available = any(
104                     [
105                         b.name.split(" ")[0] not in ["chainer", "fail"]
106                         and "plaintext" not in b.name.lower()
107                         for b in backends
108                     ]
109                 )
110             except Exception:
111                 self._is_available = False
112 
113         if not self._is_available:
114             logger.warning("No suitable keyring backends were found")
115 
116 
117 class PasswordManager:
118     def __init__(self, config):
119         self._config = config
120         self._keyring = None
121 
122     @property
123     def keyring(self):
124         if self._keyring is None:
125             self._keyring = KeyRing("poetry-repository")
126             if not self._keyring.is_available():
127                 logger.warning(
128                     "Using a plaintext file to store and retrieve credentials"
129                 )
130 
131         return self._keyring
132 
133     def set_pypi_token(self, name, token):
134         if not self.keyring.is_available():
135             self._config.auth_config_source.add_property(
136                 "pypi-token.{}".format(name), token
137             )
138         else:
139             self.keyring.set_password(name, "__token__", token)
140 
141     def get_pypi_token(self, name):
142         if not self.keyring.is_available():
143             return self._config.get("pypi-token.{}".format(name))
144 
145         return self.keyring.get_password(name, "__token__")
146 
147     def delete_pypi_token(self, name):
148         if not self.keyring.is_available():
149             return self._config.auth_config_source.remove_property(
150                 "pypi-token.{}".format(name)
151             )
152 
153         self.keyring.delete_password(name, "__token__")
154 
155     def get_http_auth(self, name):
156         auth = self._config.get("http-basic.{}".format(name))
157         if not auth:
158             return None
159 
160         username, password = auth["username"], auth.get("password")
161         if password is None:
162             password = self.keyring.get_password(name, username)
163 
164         return {
165             "username": username,
166             "password": password,
167         }
168 
169     def set_http_password(self, name, username, password):
170         auth = {"username": username}
171 
172         if not self.keyring.is_available():
173             auth["password"] = password
174         else:
175             self.keyring.set_password(name, username, password)
176 
177         self._config.auth_config_source.add_property("http-basic.{}".format(name), auth)
178 
179     def delete_http_password(self, name):
180         auth = self.get_http_auth(name)
181         if not auth or "username" not in auth:
182             return
183 
184         try:
185             self.keyring.delete_password(name, auth["username"])
186         except KeyRingError:
187             pass
188 
189         self._config.auth_config_source.remove_property("http-basic.{}".format(name))
190
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/poetry/utils/password_manager.py b/poetry/utils/password_manager.py
--- a/poetry/utils/password_manager.py
+++ b/poetry/utils/password_manager.py
@@ -155,11 +155,14 @@
     def get_http_auth(self, name):
         auth = self._config.get("http-basic.{}".format(name))
         if not auth:
-            return None
-
-        username, password = auth["username"], auth.get("password")
-        if password is None:
-            password = self.keyring.get_password(name, username)
+            username = self._config.get("http-basic.{}.username".format(name))
+            password = self._config.get("http-basic.{}.password".format(name))
+            if not username and not password:
+                return None
+        else:
+            username, password = auth["username"], auth.get("password")
+            if password is None:
+                password = self.keyring.get_password(name, username)
 
         return {
             "username": username,

{"golden_diff": "diff --git a/poetry/utils/password_manager.py b/poetry/utils/password_manager.py\n--- a/poetry/utils/password_manager.py\n+++ b/poetry/utils/password_manager.py\n@@ -155,11 +155,14 @@\n     def get_http_auth(self, name):\n         auth = self._config.get(\"http-basic.{}\".format(name))\n         if not auth:\n-            return None\n-\n-        username, password = auth[\"username\"], auth.get(\"password\")\n-        if password is None:\n-            password = self.keyring.get_password(name, username)\n+            username = self._config.get(\"http-basic.{}.username\".format(name))\n+            password = self._config.get(\"http-basic.{}.password\".format(name))\n+            if not username and not password:\n+                return None\n+        else:\n+            username, password = auth[\"username\"], auth.get(\"password\")\n+            if password is None:\n+                password = self.keyring.get_password(name, username)\n \n         return {\n             \"username\": username,\n", "issue": "Setting credentials through env. variable are not working\n<!-- Checked checkbox should look like this: [x] -->\r\n- [ x ] I am on the [latest](https://github.com/python-poetry/poetry/releases/latest) Poetry version.\r\n- [ x ] I have searched the [issues](https://github.com/python-poetry/poetry/issues) of this repo and believe that this is not a duplicate.\r\n- [ x ] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).\r\n\r\n<!--\r\n  Once those are done, if you're able to fill in the following list with your information,\r\n  it'd be very helpful to whoever handles the issue.\r\n-->\r\n\r\n- **OS version and name**: *nix\r\n- **Poetry version**: Poetry version 1.0.0\r\n\r\n## Issue\r\n<!-- Now feel free to write your issue, but please be descriptive! Thanks again \ud83d\ude4c \u2764\ufe0f -->\r\nI'm failing to use env. variables to set custom pypi credentials. \r\n\r\nMy pyproject.toml contains private pypi's like this:\r\n```toml\r\n[[tool.poetry.source]]\r\nurl = \"https://XXXXX/nexus/repository/pypi-central/simple\"\r\nname = \"nexus\"\r\n```\r\nI'm running this script:\r\n```sh\r\nexport POETRY_HTTP_BASIC_NEXUS_USERNAME=****\r\nexport POETRY_HTTP_BASIC_NEXUS_PASSWORD=****\r\npoetry install\r\n```\r\nand it fails with:\r\n```\r\n[EnvCommandError]\r\nCommand ['/opt/.cache/pypoetry/virtualenvs/YYYY-4zvP7SOo-py3.8/bin/pip', 'install', '--no-deps', '--index-url', 'https://XXXXX/nexus/repository/pypi-central/simple', '--extra-index-url', 'https://pypi.org/', 'six==1.12.0'] errored with the following return code 2, and output: \r\nLooking in indexes: https://RESOLVED-XXXXX/nexus/repository/pypi-central/simple, https://****:****@XXXXX/nexus/repository/epd-pypi/simple, https://pypi.org/\r\nCollecting six==1.12.0\r\n\r\n....\r\n\r\nFile \"/opt/.cache/pypoetry/virtualenvs/YYYY-4zvP7SOo-py3.8/lib/python3.8/site-packages/pip/_internal/download.py\", line 386, in handle_401\r\n    username, password, save = self._prompt_for_password(parsed.netloc)\r\n  File \"/opt/.cache/pypoetry/virtualenvs/YYYY-4zvP7SOo-py3.8/lib/python3.8/site-packages/pip/_internal/download.py\", line 358, in _prompt_for_password\r\n    username = ask_input(\"User for %s: \" % netloc)\r\n  File \"/opt/.cache/pypoetry/virtualenvs/YYYY-4zvP7SOo-py3.8/lib/python3.8/site-packages/pip/_internal/utils/misc.py\", line 281, in ask_input\r\n    return input(message)\r\nEOFError: EOF when reading a line\r\nUser for XXXXX: \r\n```\r\n\r\nI investigated the code and it seems that credentials are never acquired separately from config, but always as a pair. That means that code never ask for `http-basic.nexus.password` and `http-basic.nexus.username`, but for `http-basic.nexus` then the value is used as a dict (search for `password_manager.get_http_auth` usage). I could not find single test case, so I wrote one, fill free to use it:\r\n```diff\r\ndiff --git a/tests/config/test_config.py b/tests/config/test_config.py\r\nindex 07373ad..72ad236 100644\r\n--- a/tests/config/test_config.py\r\n+++ b/tests/config/test_config.py\r\n@@ -14,3 +14,13 @@ def test_config_get_from_environment_variable(config, environ):\r\n\r\n     os.environ[\"POETRY_VIRTUALENVS_CREATE\"] = \"false\"\r\n     assert not config.get(\"virtualenvs.create\")\r\n+\r\n+def test_basic_http_credentials_through_env(config, environ):\r\n+    assert config.get(\"http-basic.test_repo\") is None\r\n+\r\n+    os.environ[\"POETRY_HTTP_BASIC_TEST_REPO_USERNAME\"] = \"foo\"\r\n+    os.environ[\"POETRY_HTTP_BASIC_TEST_REPO_PASSWORD\"] = \"bar\"\r\n+    credentials = config.get(\"http-basic.test-repo\")\r\n+    assert credentials is not None\r\n+    assert credentials[\"username\"] == \"foo\"\r\n+    assert credentials[\"password\"] == \"bar\"\r\n```\n", "before_files": [{"content": "import logging\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass PasswordManagerError(Exception):\n\n    pass\n\n\nclass KeyRingError(Exception):\n\n    pass\n\n\nclass KeyRing:\n    def __init__(self, namespace):\n        self._namespace = namespace\n        self._is_available = True\n\n        self._check()\n\n    def is_available(self):\n        return self._is_available\n\n    def get_password(self, name, username):\n        if not self.is_available():\n            return\n\n        import keyring\n        import keyring.errors\n\n        name = self.get_entry_name(name)\n\n        try:\n            return keyring.get_password(name, username)\n        except (RuntimeError, keyring.errors.KeyringError):\n            raise KeyRingError(\n                \"Unable to retrieve the password for {} from the key ring\".format(name)\n            )\n\n    def set_password(self, name, username, password):\n        if not self.is_available():\n            return\n\n        import keyring\n        import keyring.errors\n\n        name = self.get_entry_name(name)\n\n        try:\n            keyring.set_password(name, username, password)\n        except (RuntimeError, keyring.errors.KeyringError) as e:\n            raise KeyRingError(\n                \"Unable to store the password for {} in the key ring: {}\".format(\n                    name, str(e)\n                )\n            )\n\n    def delete_password(self, name, username):\n        if not self.is_available():\n            return\n\n        import keyring\n        import keyring.errors\n\n        name = self.get_entry_name(name)\n\n        try:\n            keyring.delete_password(name, username)\n        except (RuntimeError, keyring.errors.KeyringError):\n            raise KeyRingError(\n                \"Unable to delete the password for {} from the key ring\".format(name)\n            )\n\n    def get_entry_name(self, name):\n        return \"{}-{}\".format(self._namespace, name)\n\n    def _check(self):\n        try:\n            import keyring\n        except Exception as e:\n            logger.debug(\"An error occurred while importing keyring: {}\".format(str(e)))\n            self._is_available = False\n\n            return\n\n        backend = keyring.get_keyring()\n        name = backend.name.split(\" \")[0]\n        if name == \"fail\":\n            logger.debug(\"No suitable keyring backend found\")\n            self._is_available = False\n        elif \"plaintext\" in backend.name.lower():\n            logger.debug(\"Only a plaintext keyring backend is available. Not using it.\")\n            self._is_available = False\n        elif name == \"chainer\":\n            try:\n                import keyring.backend\n\n                backends = keyring.backend.get_all_keyring()\n\n                self._is_available = any(\n                    [\n                        b.name.split(\" \")[0] not in [\"chainer\", \"fail\"]\n                        and \"plaintext\" not in b.name.lower()\n                        for b in backends\n                    ]\n                )\n            except Exception:\n                self._is_available = False\n\n        if not self._is_available:\n            logger.warning(\"No suitable keyring backends were found\")\n\n\nclass PasswordManager:\n    def __init__(self, config):\n        self._config = config\n        self._keyring = None\n\n    @property\n    def keyring(self):\n        if self._keyring is None:\n            self._keyring = KeyRing(\"poetry-repository\")\n            if not self._keyring.is_available():\n                logger.warning(\n                    \"Using a plaintext file to store and retrieve credentials\"\n                )\n\n        return self._keyring\n\n    def set_pypi_token(self, name, token):\n        if not self.keyring.is_available():\n            self._config.auth_config_source.add_property(\n                \"pypi-token.{}\".format(name), token\n            )\n        else:\n            self.keyring.set_password(name, \"__token__\", token)\n\n    def get_pypi_token(self, name):\n        if not self.keyring.is_available():\n            return self._config.get(\"pypi-token.{}\".format(name))\n\n        return self.keyring.get_password(name, \"__token__\")\n\n    def delete_pypi_token(self, name):\n        if not self.keyring.is_available():\n            return self._config.auth_config_source.remove_property(\n                \"pypi-token.{}\".format(name)\n            )\n\n        self.keyring.delete_password(name, \"__token__\")\n\n    def get_http_auth(self, name):\n        auth = self._config.get(\"http-basic.{}\".format(name))\n        if not auth:\n            return None\n\n        username, password = auth[\"username\"], auth.get(\"password\")\n        if password is None:\n            password = self.keyring.get_password(name, username)\n\n        return {\n            \"username\": username,\n            \"password\": password,\n        }\n\n    def set_http_password(self, name, username, password):\n        auth = {\"username\": username}\n\n        if not self.keyring.is_available():\n            auth[\"password\"] = password\n        else:\n            self.keyring.set_password(name, username, password)\n\n        self._config.auth_config_source.add_property(\"http-basic.{}\".format(name), auth)\n\n    def delete_http_password(self, name):\n        auth = self.get_http_auth(name)\n        if not auth or \"username\" not in auth:\n            return\n\n        try:\n            self.keyring.delete_password(name, auth[\"username\"])\n        except KeyRingError:\n            pass\n\n        self._config.auth_config_source.remove_property(\"http-basic.{}\".format(name))\n", "path": "poetry/utils/password_manager.py"}], "after_files": [{"content": "import logging\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass PasswordManagerError(Exception):\n\n    pass\n\n\nclass KeyRingError(Exception):\n\n    pass\n\n\nclass KeyRing:\n    def __init__(self, namespace):\n        self._namespace = namespace\n        self._is_available = True\n\n        self._check()\n\n    def is_available(self):\n        return self._is_available\n\n    def get_password(self, name, username):\n        if not self.is_available():\n            return\n\n        import keyring\n        import keyring.errors\n\n        name = self.get_entry_name(name)\n\n        try:\n            return keyring.get_password(name, username)\n        except (RuntimeError, keyring.errors.KeyringError):\n            raise KeyRingError(\n                \"Unable to retrieve the password for {} from the key ring\".format(name)\n            )\n\n    def set_password(self, name, username, password):\n        if not self.is_available():\n            return\n\n        import keyring\n        import keyring.errors\n\n        name = self.get_entry_name(name)\n\n        try:\n            keyring.set_password(name, username, password)\n        except (RuntimeError, keyring.errors.KeyringError) as e:\n            raise KeyRingError(\n                \"Unable to store the password for {} in the key ring: {}\".format(\n                    name, str(e)\n                )\n            )\n\n    def delete_password(self, name, username):\n        if not self.is_available():\n            return\n\n        import keyring\n        import keyring.errors\n\n        name = self.get_entry_name(name)\n\n        try:\n            keyring.delete_password(name, username)\n        except (RuntimeError, keyring.errors.KeyringError):\n            raise KeyRingError(\n                \"Unable to delete the password for {} from the key ring\".format(name)\n            )\n\n    def get_entry_name(self, name):\n        return \"{}-{}\".format(self._namespace, name)\n\n    def _check(self):\n        try:\n            import keyring\n        except Exception as e:\n            logger.debug(\"An error occurred while importing keyring: {}\".format(str(e)))\n            self._is_available = False\n\n            return\n\n        backend = keyring.get_keyring()\n        name = backend.name.split(\" \")[0]\n        if name == \"fail\":\n            logger.debug(\"No suitable keyring backend found\")\n            self._is_available = False\n        elif \"plaintext\" in backend.name.lower():\n            logger.debug(\"Only a plaintext keyring backend is available. Not using it.\")\n            self._is_available = False\n        elif name == \"chainer\":\n            try:\n                import keyring.backend\n\n                backends = keyring.backend.get_all_keyring()\n\n                self._is_available = any(\n                    [\n                        b.name.split(\" \")[0] not in [\"chainer\", \"fail\"]\n                        and \"plaintext\" not in b.name.lower()\n                        for b in backends\n                    ]\n                )\n            except Exception:\n                self._is_available = False\n\n        if not self._is_available:\n            logger.warning(\"No suitable keyring backends were found\")\n\n\nclass PasswordManager:\n    def __init__(self, config):\n        self._config = config\n        self._keyring = None\n\n    @property\n    def keyring(self):\n        if self._keyring is None:\n            self._keyring = KeyRing(\"poetry-repository\")\n            if not self._keyring.is_available():\n                logger.warning(\n                    \"Using a plaintext file to store and retrieve credentials\"\n                )\n\n        return self._keyring\n\n    def set_pypi_token(self, name, token):\n        if not self.keyring.is_available():\n            self._config.auth_config_source.add_property(\n                \"pypi-token.{}\".format(name), token\n            )\n        else:\n            self.keyring.set_password(name, \"__token__\", token)\n\n    def get_pypi_token(self, name):\n        if not self.keyring.is_available():\n            return self._config.get(\"pypi-token.{}\".format(name))\n\n        return self.keyring.get_password(name, \"__token__\")\n\n    def delete_pypi_token(self, name):\n        if not self.keyring.is_available():\n            return self._config.auth_config_source.remove_property(\n                \"pypi-token.{}\".format(name)\n            )\n\n        self.keyring.delete_password(name, \"__token__\")\n\n    def get_http_auth(self, name):\n        auth = self._config.get(\"http-basic.{}\".format(name))\n        if not auth:\n            username = self._config.get(\"http-basic.{}.username\".format(name))\n            password = self._config.get(\"http-basic.{}.password\".format(name))\n            if not username and not password:\n                return None\n        else:\n            username, password = auth[\"username\"], auth.get(\"password\")\n            if password is None:\n                password = self.keyring.get_password(name, username)\n\n        return {\n            \"username\": username,\n            \"password\": password,\n        }\n\n    def set_http_password(self, name, username, password):\n        auth = {\"username\": username}\n\n        if not self.keyring.is_available():\n            auth[\"password\"] = password\n        else:\n            self.keyring.set_password(name, username, password)\n\n        self._config.auth_config_source.add_property(\"http-basic.{}\".format(name), auth)\n\n    def delete_http_password(self, name):\n        auth = self.get_http_auth(name)\n        if not auth or \"username\" not in auth:\n            return\n\n        try:\n            self.keyring.delete_password(name, auth[\"username\"])\n        except KeyRingError:\n            pass\n\n        self._config.auth_config_source.remove_property(\"http-basic.{}\".format(name))\n", "path": "poetry/utils/password_manager.py"}]}