From eeafc26b57c631113ec60f3e1880ecb8fffd6b44 Mon Sep 17 00:00:00 2001 From: jordanbrauer Date: Mon, 11 May 2026 13:19:24 -0500 Subject: [PATCH] remove custom auth header code --- src/finch/_client.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/finch/_client.py b/src/finch/_client.py index 02e7c9c0..9b9e76bf 100644 --- a/src/finch/_client.py +++ b/src/finch/_client.py @@ -216,12 +216,11 @@ def qs(self) -> Querystring: return Querystring(array_format="brackets") @override - def auth_headers(self) -> dict[str, str]: - if self._bearer_auth: - return self._bearer_auth - if self._basic_auth: - return self._basic_auth - return {} + def _auth_headers(self, security: SecurityOptions) -> dict[str, str]: + return { + **(self._bearer_auth if security.get("bearer_auth", False) else {}), + **(self._basic_auth if security.get("basic_auth", False) else {}), + } @property def _bearer_auth(self) -> dict[str, str]: @@ -567,12 +566,11 @@ def qs(self) -> Querystring: return Querystring(array_format="brackets") @override - def auth_headers(self) -> dict[str, str]: - if self._bearer_auth: - return self._bearer_auth - if self._basic_auth: - return self._basic_auth - return {} + def _auth_headers(self, security: SecurityOptions) -> dict[str, str]: + return { + **(self._bearer_auth if security.get("bearer_auth", False) else {}), + **(self._basic_auth if security.get("basic_auth", False) else {}), + } @property def _bearer_auth(self) -> dict[str, str]: