File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
end_to_end_tests/golden-record/my_test_api_client
integration-tests/integration_tests Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ class AuthenticatedClient(Client):
4242 """A Client which has been authenticated for use on secured endpoints"""
4343
4444 token : str
45+ prefix : str = "Bearer"
46+ auth_header_name : str = "Authorization"
4547
4648 def get_headers (self ) -> Dict [str , str ]:
49+ auth_header_value = f"{ self .prefix } { self .token } " if self .prefix else self .token
4750 """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):
4242 """A Client which has been authenticated for use on secured endpoints"""
4343
4444 token : str
45+ prefix : str = "Bearer"
46+ auth_header_name : str = "Authorization"
4547
4648 def get_headers (self ) -> Dict [str , str ]:
49+ auth_header_value = f"{ self .prefix } { self .token } " if self .prefix else self .token
4750 """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