Skip to content

Commit 81d4165

Browse files
committed
adopt feedback
1 parent 9bac693 commit 81d4165

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

pyiceberg/catalog/rest/auth.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class AuthManagerAdapter(AuthBase):
5454
5555
This adapter is useful when working with `requests.Session.auth`
5656
and allows reuse of authentication strategies defined by `AuthManager`.
57+
This AuthManagerAdapter is only intended to be used against the REST Catalog
58+
Server that expects the Authorization Header.
5759
"""
5860

5961
def __init__(self, auth_manager: AuthManager):
@@ -65,7 +67,7 @@ def __init__(self, auth_manager: AuthManager):
6567
"""
6668
self.auth_manager = auth_manager
6769

68-
def __call__(self, r: PreparedRequest) -> PreparedRequest:
70+
def __call__(self, request: PreparedRequest) -> PreparedRequest:
6971
"""
7072
Modify the outgoing request to include the Authorization header.
7173
@@ -75,7 +77,6 @@ def __call__(self, r: PreparedRequest) -> PreparedRequest:
7577
Returns:
7678
requests.PreparedRequest: The modified request with Authorization header.
7779
"""
78-
auth_header = self.auth_manager.auth_header()
79-
if auth_header:
80-
r.headers["Authorization"] = auth_header
81-
return r
80+
if auth_header := self.auth_manager.auth_header():
81+
request.headers["Authorization"] = auth_header
82+
return request

0 commit comments

Comments
 (0)