File tree 2 files changed +8
-2
lines changed
end_to_end_tests/golden-record/my_test_api_client
integration-tests/integration_tests
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ class AuthenticatedClient(Client):
42
42
"""A Client which has been authenticated for use on secured endpoints"""
43
43
44
44
token : str
45
+ prefix : str = "Bearer"
46
+ auth_header_name : str = "Authorization"
45
47
46
48
def get_headers (self ) -> Dict [str , str ]:
49
+ auth_header_value = f"{ self .prefix } { self .token } " if self .prefix else self .token
47
50
"""Get headers to be used in authenticated endpoints"""
48
- return {"Authorization" : f"Bearer { self .token } " , ** self .headers }
51
+ return {self .auth_header_name : auth_header_value , ** self .headers }
Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ class AuthenticatedClient(Client):
42
42
"""A Client which has been authenticated for use on secured endpoints"""
43
43
44
44
token : str
45
+ prefix : str = "Bearer"
46
+ auth_header_name : str = "Authorization"
45
47
46
48
def get_headers (self ) -> Dict [str , str ]:
49
+ auth_header_value = f"{ self .prefix } { self .token } " if self .prefix else self .token
47
50
"""Get headers to be used in authenticated endpoints"""
48
- return {"Authorization" : f"Bearer { self .token } " , ** self .headers }
51
+ return {self .auth_header_name : auth_header_value , ** self .headers }
You can’t perform that action at this time.
0 commit comments