Skip to content

Comments

Support required auth configuration on the pbincli API.#13

Open
blacklight wants to merge 2 commits intoPioverpie:masterfrom
blacklight:master
Open

Support required auth configuration on the pbincli API.#13
blacklight wants to merge 2 commits intoPioverpie:masterfrom
blacklight:master

Conversation

@blacklight
Copy link

@blacklight blacklight commented Feb 18, 2025

Uploads fail if it is not defined.

This also adds support for authenticated uploads. Two different modes are currently supported by pbcli:

  • auth="basic", with auth_user and auth_pass.

  • auth="custom", with a custom auth_headers dict.

This also adds a round of LINT+Black to the modified files.

Closes: #12

Uploads fail if it is not defined.

This also adds support for authented uploads. Two different modes are
currently supported by `pbcli`:

- `auth="basic"`, with `auth_user` and `auth_pass`.

- `auth="custom"`, with a custom `auth_headers` dict.

This also adds a round of LINT+Black to the modified files.

Closes: Pioverpie#12
@blacklight
Copy link
Author

Btw tests fail because some of the parametrized hostnames are now gone, have implemented rate limiting, run outdated versions or have changed their configuration:

FAILED tests/test_all.py::test_full[https://vim.cx-tests/__init__.py] - SystemExit: 1
FAILED tests/test_all.py::test_full[https://privatebin.gittermann1.de/-tests/__init__.py] - requests.exceptions.ConnectionError: HTTPSConnectionPool(host='privatebin.gittermann1.de', port=443): Max retries exceeded with url: /?j...
FAILED tests/test_all.py::test_async_full[https://vim.cx-tests/__init__.py] - SystemExit: 1
FAILED tests/test_all.py::test_async_full[https://privatebin.gittermann1.de/-tests/__init__.py] - requests.exceptions.ConnectionError: HTTPSConnectionPool(host='privatebin.gittermann1.de', port=443): Max retries exceeded with url: /?j...
FAILED tests/test_all.py::test_async_full[https://paste.carrade.eu/-tests/__init__.py] - TypeError: AsyncClient.__init__() got an unexpected keyword argument 'proxies'
FAILED tests/test_all.py::test_bad_server - SystemExit: 1
FAILED tests/test_all.py::test_good_basic_auth_config[https://vim.cx-tests/__init__.py] - SystemExit: 1
FAILED tests/test_all.py::test_good_basic_auth_config[https://privatebin.gittermann1.de/-tests/__init__.py] - requests.exceptions.ConnectionError: HTTPSConnectionPool(host='privatebin.gittermann1.de', port=443): Max retries exceeded with url: /?j...
FAILED tests/test_all.py::test_good_basic_auth_config[https://paste.carrade.eu/-tests/__init__.py] - privatebinapi.exceptions.PrivateBinAPIError: Please wait 10 seconds between each post.
FAILED tests/test_all.py::test_good_custom_auth_config[https://vim.cx-tests/__init__.py] - SystemExit: 1
FAILED tests/test_all.py::test_good_custom_auth_config[https://privatebin.gittermann1.de/-tests/__init__.py] - requests.exceptions.Connection
Error: HTTPSConnectionPool(host='privatebin.gittermann1.de', port=443): Max retries exceeded with url: /?j...
FAILED tests/test_all.py::test_good_custom_auth_config[https://paste.carrade.eu/-tests/__init__.py] - privatebinapi.exceptions.PrivateBinAPIError: Please wait 10 seconds between each post.

Worth updating the list?

@blacklight
Copy link
Author

FYI I've also opened an issue on PBinCli to make the parsing of the settings more robust.

While support for authorized uploads is definitely almost a must-have, I also think that PBinCli shouldn't break downstream implementations between releases by adding new expected fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

send breaks with recent versions of pbincli

1 participant