From 8e2d171f2047768d4768e98d1e687f81aa454a95 Mon Sep 17 00:00:00 2001 From: Rennan Chagas Date: Mon, 11 Oct 2021 08:21:40 -0500 Subject: [PATCH] add authentication scheme argument to be possible to use bearer --- src/corva/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corva/api.py b/src/corva/api.py index 61fd4e98..55e7e5ee 100644 --- a/src/corva/api.py +++ b/src/corva/api.py @@ -23,17 +23,19 @@ def __init__( api_key: str, app_key: str, timeout: Optional[int] = None, + authentication_scheme: Optional[str] = 'API' ): self.api_url = api_url self.data_api_url = data_api_url self.api_key = api_key self.app_key = app_key self.timeout = timeout or self.TIMEOUT_LIMITS[1] + self.authentication_scheme = authentication_scheme @property def default_headers(self): return { - 'Authorization': f'API {self.api_key}', + 'Authorization': f'{self.authentication_scheme} {self.api_key}', 'X-Corva-App': self.app_key, }