Commit Graph

23 Commits

Author SHA1 Message Date
Kar Petrosyan
87713d2172
Define and expose the API from the same place (#3106)
* Tidy up imports

* Update tests/test_exported_members.py

---------

Co-authored-by: Tom Christie <tom@tomchristie.com>
2024-02-23 12:30:05 +00:00
Kar Petrosyan
371b6e946c
Use __future__.annotations (#3068)
* Switch to new typing style

* lint
2024-01-24 14:30:22 +00:00
Tereza Tomcova
99cba6ac64
Fix RFC 2069 mode digest authentication (#3045)
* Fix RFC 2069 mode digest authentication

* Update CHANGELOG.md
2024-01-10 10:08:42 +00:00
Petr Belskiy
87f39f12c9
add missing type hints to __init__(...) (#2938)
* add missing type hints to __init__

https://peps.python.org/pep-0484/

* add info to changelog

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-11-17 17:58:51 +04:00
Tom Christie
ad06741d1e
Lazily import 'netrc' module (#2910) 2023-10-30 20:07:42 +00:00
Musale Martin
88e8431437
Add cookies to the retried request when performing digest authentication. (#2846)
* Add cookies from the response to the retried request

* Conditionally add cookies from the response

* Fix failing auth module tests

* Fix linting error

* Add tests to check set cookies from server
2023-09-15 10:52:11 +01:00
Alex Prengère
c1cc6b2462
Fixes #2666: None is the default value of file for httpx.NetRCAuth (#2667) 2023-04-18 10:03:01 +01:00
Tom Christie
59914c7690
Add NetRCAuth() class. (#2535)
* NetRCAuth class

* Add docs for httpx.NetRCAuth()

* Drop failing cross-domain test for NetRCAuth()

* Update tests

* Update httpx/_auth.py

* Add tests for netrc file with no password
2023-01-12 11:27:46 +00:00
rettier
8327e13454
reuse the digest auth state to avoid unnecessary requests (#2463)
* reuse the digest auth challenge to avoid sending twice as many requests

* fix for digest testcase

* ran testing/linting scripts

* codereview changes, removed tomchristie username from all authentication tests

Co-authored-by: Philipp Reitter <p.reitter@accessio.at>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-29 17:05:37 +00:00
Adrian Garcia Badaracco
1b4e7fbb48
Typing: always fill in generic type parameters (#2468)
* Typing: always fill in generic type parameters

Being explicit about the parameters helps find bugs and makes the library
easier to use for users.

- Tell mypy to disallow generics without parameter values
- Give all generic types parameters values

* fix things that aren't coming in from other commits

* lint

Co-authored-by: Martijn Pieters <mj@zopatista.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-29 16:36:03 +00:00
Tom Christie
850b4801d6
Case insensitive algorithm detection for digest authentication. (#2204)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2022-05-09 10:42:57 +01:00
Johannes
32d37cfdf1
Small namedtuple refactor (#1329)
Plus order consistency because why not..
2020-09-27 22:15:04 +02:00
Tom Christie
8e4a8a1c73
Finesse URL properties (#1285)
* url.userinfo should be URL encoded bytes

* Neater copy_with implementation

* Finesse API around URL properties and copy_with

* Docstring for URL, and drop url.authority

* Support url.copy_with(raw_path=...)

* Docstrings on URL methods

* Tweak docstring
2020-09-21 11:35:25 +01:00
Tom Christie
fbb21fb1ae
Drop ContentStream (#1295)
* Drop ContentStream
2020-09-18 08:41:09 +01:00
Florimond Manca
016e4ee210
Add support for sync-specific or async-specific auth flows (#1217)
* Add support for async auth flows

* Move body logic to Auth, add sync_auth_flow, add NoAuth

* Update tests

* Stick to next() / __anext__()

* Fix undefined name errors

* Add docs

* Add unit tests for auth classes

Co-authored-by: Tom Christie <tom@tomchristie.com>
2020-09-09 14:37:20 +01:00
Tom Christie
33d339a262
Handle multiple auth headers correctly (#1240)
Handle multiple auth headers correctly
2020-09-01 14:08:10 +01:00
Tom Christie
9409900898
Exception hierarchy (#1095)
* Exception heirachy

* Exception heirarchy

* Formatting tweaks

* Update httpx/_exceptions.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Update httpx/_exceptions.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Update httpx/_exceptions.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Update httpx/_exceptions.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-31 12:57:49 +01:00
Tom Christie
6421575f5f
Tighten public API on auth classes (#1084)
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-26 19:05:33 +01:00
Tom Christie
083d2e9aa0
Include 'request' on TooManyRedirect and RequestBodyUnavailable (#1077) 2020-07-23 09:55:21 +01:00
Taneli Hukkinen
2f0e0480da
Remove needless whitespace strips (#1048) 2020-07-05 11:58:44 +02:00
Florimond Manca
4c01117dd2
Move types definitions to a dedicated module (#902) 2020-04-15 13:12:09 +02:00
George Kettleborough
b3db9ff0b6
Add Auth.requires_response_body attribute (#803)
* Add Auth.requires_response_body attribute

If set then responses are read by the client before being sent back into the auth flow

* Update tests and docs

* PR fixes

* Change example methods
2020-02-10 12:10:11 +00:00
Florimond Manca
82dc6f32f8 Switch to private module names (#785)
* Rename modules

* Update names in package

* Fix tests

* Review docs
2020-01-28 14:34:43 +00:00