Commit 6757343d by Bartosz Sokorski Committed by GitHub

docs: Add warning about saving credentials (#5726)

* docs: Add warning about saving credentials

- Added warning about saving credentials to command line history
- Added angle brackets around `username` and `password` in docs, to
signify templating

Co-authored-by: Bjorn Neergaard <bjorn@neersighted.com>
parent 30c582d8
...@@ -39,9 +39,14 @@ poetry source add foo https://pypi.example.org/simple/ ...@@ -39,9 +39,14 @@ poetry source add foo https://pypi.example.org/simple/
Then, assuming the repository requires authentication, configure credentials for it. Then, assuming the repository requires authentication, configure credentials for it.
```bash ```bash
poetry config http-basic.foo username password poetry config http-basic.foo <username> <password>
``` ```
{{% warning %}}
Depending on your system configuration, credentials might be saved in your command line history.
Many shells do not save commands to history when they are prefixed by a space character. For more information, please refer to your shell's documentation.
{{% /warning %}}
Once this is done, you can add dependencies to your project from this source. Once this is done, you can add dependencies to your project from this source.
```bash ```bash
...@@ -66,7 +71,7 @@ recommended to use a different name for your publishing repository. ...@@ -66,7 +71,7 @@ recommended to use a different name for your publishing repository.
```bash ```bash
poetry config repositories.foo-pub https://pypi.example.org/legacy/ poetry config repositories.foo-pub https://pypi.example.org/legacy/
poetry config http-basic.foo-pub username password poetry config http-basic.foo-pub <username> <password>
``` ```
{{% /note %}} {{% /note %}}
...@@ -303,7 +308,7 @@ well as the path (`/legacy`) are different to it's simple API (`https://test.pyp ...@@ -303,7 +308,7 @@ well as the path (`/legacy`) are different to it's simple API (`https://test.pyp
If you want to store your credentials for a specific repository, you can do so easily: If you want to store your credentials for a specific repository, you can do so easily:
```bash ```bash
poetry config http-basic.foo username password poetry config http-basic.foo <username> <password>
``` ```
If you do not specify the password you will be prompted to write it. If you do not specify the password you will be prompted to write it.
...@@ -324,7 +329,7 @@ If you still want to use your username and password, you can do so with the foll ...@@ -324,7 +329,7 @@ If you still want to use your username and password, you can do so with the foll
call to `config`. call to `config`.
```bash ```bash
poetry config http-basic.pypi username password poetry config http-basic.pypi <username> <password>
``` ```
{{% /note %}} {{% /note %}}
...@@ -355,8 +360,8 @@ Alternatively, you can use environment variables to provide the credentials: ...@@ -355,8 +360,8 @@ Alternatively, you can use environment variables to provide the credentials:
```bash ```bash
export POETRY_PYPI_TOKEN_PYPI=my-token export POETRY_PYPI_TOKEN_PYPI=my-token
export POETRY_HTTP_BASIC_PYPI_USERNAME=username export POETRY_HTTP_BASIC_PYPI_USERNAME=<username>
export POETRY_HTTP_BASIC_PYPI_PASSWORD=password export POETRY_HTTP_BASIC_PYPI_PASSWORD=<password>
``` ```
See [Using environment variables]({{< relref "configuration#using-environment-variables" >}}) for more information See [Using environment variables]({{< relref "configuration#using-environment-variables" >}}) for more information
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment