Skip to content

Commit

Permalink
fix certificates validation, add tests requirements (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
devqore authored Nov 8, 2023
1 parent 59bceb4 commit d5b526e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
8 changes: 8 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Release History
===============
2.0.2 (2023-11-06)
------------------
- Fix certificates verification after migration from `requtests` to `httpx`

2.0.1 (2023-10-31)
------------------
- Update doc and requires python 3.8 (#94)

2.0.0 (2023-10-19)
-------------------
- Add Async Client
Expand Down
2 changes: 1 addition & 1 deletion api4jenkins/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding: utf-8
__version__ = '2.0.1'
__version__ = '2.0.2'
__title__ = 'api4jenkins'
__description__ = 'Jenkins Python Client'
__url__ = 'https://github.com/joelee2012/api4jenkins'
Expand Down
26 changes: 24 additions & 2 deletions api4jenkins/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@ def check_response(response: Response) -> None:

def new_http_client(**kwargs) -> Client:
return Client(
transport=HTTPTransport(retries=kwargs.pop('retries', 0)),
transport=HTTPTransport(
verify=kwargs.pop('verify', True),
cert=kwargs.pop('cert', None),
http1=kwargs.pop('http1', True),
http2=kwargs.pop('http2', False),
trust_env=kwargs.pop('trust_env', True),
proxy=kwargs.pop('proxy', None),
uds=kwargs.pop('uds', None),
local_address=kwargs.pop('local_address', None),
retries=kwargs.pop('retries', 0),
socket_options=kwargs.pop('socket_options', None)
),
**kwargs,
event_hooks={'request': [log_request], 'response': [check_response]}
)
Expand All @@ -48,7 +59,18 @@ async def async_check_response(response: Response) -> None:

def new_async_http_client(**kwargs) -> AsyncClient:
return AsyncClient(
transport=AsyncHTTPTransport(retries=kwargs.pop('retries', 0)),
transport=AsyncHTTPTransport(
verify=kwargs.pop('verify', True),
cert=kwargs.pop('cert', None),
http1=kwargs.pop('http1', True),
http2=kwargs.pop('http2', False),
trust_env=kwargs.pop('trust_env', True),
proxy=kwargs.pop('proxy', None),
uds=kwargs.pop('uds', None),
local_address=kwargs.pop('local_address', None),
retries=kwargs.pop('retries', 0),
socket_options=kwargs.pop('socket_options', None)
),
**kwargs,
event_hooks={'request': [async_log_request],
'response': [async_check_response]}
Expand Down

0 comments on commit d5b526e

Please sign in to comment.