From 7f382a91603f97a2a37e8158894787ece549f324 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:18:19 -0500 Subject: [PATCH 1/2] fix(client): correctly use custom http client auth (#117) --- src/orb/_base_client.py | 13 +++++++++++-- src/orb/_types.py | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/orb/_base_client.py b/src/orb/_base_client.py index 481171a4..53a53d80 100644 --- a/src/orb/_base_client.py +++ b/src/orb/_base_client.py @@ -58,6 +58,7 @@ PostParser, ProxiesTypes, RequestFiles, + HttpxSendArgs, AsyncTransport, RequestOptions, UnknownResponse, @@ -873,11 +874,15 @@ def _request( request = self._build_request(options) self._prepare_request(request) + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth + try: response = self._client.send( request, - auth=self.custom_auth, stream=stream or self._should_stream_response_body(request=request), + **kwargs, ) except httpx.TimeoutException as err: if retries > 0: @@ -1335,11 +1340,15 @@ async def _request( request = self._build_request(options) await self._prepare_request(request) + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth + try: response = await self._client.send( request, - auth=self.custom_auth, stream=stream or self._should_stream_response_body(request=request), + **kwargs, ) except httpx.TimeoutException as err: if retries > 0: diff --git a/src/orb/_types.py b/src/orb/_types.py index 7dace930..1c73ee6c 100644 --- a/src/orb/_types.py +++ b/src/orb/_types.py @@ -28,6 +28,7 @@ runtime_checkable, ) +import httpx import pydantic from httpx import URL, Proxy, Timeout, Response, BaseTransport, AsyncBaseTransport @@ -369,3 +370,7 @@ class InheritsGeneric(Protocol): class _GenericAlias(Protocol): __origin__: type[object] + + +class HttpxSendArgs(TypedDict, total=False): + auth: httpx.Auth From dffd253423a42548dd92af24126dd8cae463dcfd Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:18:36 -0500 Subject: [PATCH 2/2] release: 1.35.2 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/orb/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 21b274b1..5554412d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.35.1" + ".": "1.35.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f90488a..8f5b523f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.35.2 (2023-12-28) + +Full Changelog: [v1.35.1...v1.35.2](https://github.com/orbcorp/orb-python/compare/v1.35.1...v1.35.2) + +### Bug Fixes + +* **client:** correctly use custom http client auth ([#117](https://github.com/orbcorp/orb-python/issues/117)) ([863ebe8](https://github.com/orbcorp/orb-python/commit/863ebe87f4881f01afa7a39286a5b154ca047305)) + ## 1.35.1 (2023-12-26) Full Changelog: [v1.35.0...v1.35.1](https://github.com/orbcorp/orb-python/compare/v1.35.0...v1.35.1) diff --git a/pyproject.toml b/pyproject.toml index 84ed9080..d2eb25f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "1.35.1" +version = "1.35.2" description = "The official Python library for the orb API" readme = "README.md" license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index 4c9285bc..50077ecb 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. __title__ = "orb" -__version__ = "1.35.1" # x-release-please-version +__version__ = "1.35.2" # x-release-please-version