Skip to content

Commit eeafc26

Browse files
committed
remove custom auth header code
1 parent 04753d4 commit eeafc26

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

src/finch/_client.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,11 @@ def qs(self) -> Querystring:
216216
return Querystring(array_format="brackets")
217217

218218
@override
219-
def auth_headers(self) -> dict[str, str]:
220-
if self._bearer_auth:
221-
return self._bearer_auth
222-
if self._basic_auth:
223-
return self._basic_auth
224-
return {}
219+
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
220+
return {
221+
**(self._bearer_auth if security.get("bearer_auth", False) else {}),
222+
**(self._basic_auth if security.get("basic_auth", False) else {}),
223+
}
225224

226225
@property
227226
def _bearer_auth(self) -> dict[str, str]:
@@ -567,12 +566,11 @@ def qs(self) -> Querystring:
567566
return Querystring(array_format="brackets")
568567

569568
@override
570-
def auth_headers(self) -> dict[str, str]:
571-
if self._bearer_auth:
572-
return self._bearer_auth
573-
if self._basic_auth:
574-
return self._basic_auth
575-
return {}
569+
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
570+
return {
571+
**(self._bearer_auth if security.get("bearer_auth", False) else {}),
572+
**(self._basic_auth if security.get("basic_auth", False) else {}),
573+
}
576574

577575
@property
578576
def _bearer_auth(self) -> dict[str, str]:

0 commit comments

Comments
 (0)