Skip to content

Commit

Permalink
docs: Add warning about saving credentials (#5726)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Secrus and neersighted authored May 31, 2022
1 parent 30c582d commit 6757343
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions docs/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ poetry source add foo https://pypi.example.org/simple/
Then, assuming the repository requires authentication, configure credentials for it.

```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.

```bash
Expand All @@ -66,7 +71,7 @@ recommended to use a different name for your publishing repository.

```bash
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 %}}
Expand Down Expand Up @@ -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:

```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.
Expand All @@ -324,7 +329,7 @@ If you still want to use your username and password, you can do so with the foll
call to `config`.

```bash
poetry config http-basic.pypi username password
poetry config http-basic.pypi <username> <password>
```

{{% /note %}}
Expand Down Expand Up @@ -355,8 +360,8 @@ Alternatively, you can use environment variables to provide the credentials:

```bash
export POETRY_PYPI_TOKEN_PYPI=my-token
export POETRY_HTTP_BASIC_PYPI_USERNAME=username
export POETRY_HTTP_BASIC_PYPI_PASSWORD=password
export POETRY_HTTP_BASIC_PYPI_USERNAME=<username>
export POETRY_HTTP_BASIC_PYPI_PASSWORD=<password>
```

See [Using environment variables]({{< relref "configuration#using-environment-variables" >}}) for more information
Expand Down

0 comments on commit 6757343

Please sign in to comment.