Skip to content

Commit

Permalink
refactor: remove api key from the class
Browse files Browse the repository at this point in the history
  • Loading branch information
davidt99 committed Jan 15, 2023
1 parent b8e932a commit 82d95b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Unreleased
1.14.4
-------
- Add analysis time to analysis object

Expand Down
2 changes: 1 addition & 1 deletion intezer_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.14.3'
__version__ = '1.14.4'
6 changes: 3 additions & 3 deletions intezer_sdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,9 @@ def get_index_response(self, index_id: str) -> Response:

return response

def _set_access_token(self, api_key: str):
def _set_access_token(self):
response = requests.post(self.full_url + '/get-access-token',
json={'api_key': api_key},
json={'api_key': self.api_key},
verify=self._verify_ssl)

if response.status_code in (HTTPStatus.UNAUTHORIZED, HTTPStatus.BAD_REQUEST):
Expand All @@ -482,7 +482,7 @@ def set_session(self):
self._session = requests.session()
self._session.mount('https://', requests.adapters.HTTPAdapter(max_retries=3))
self._session.verify = self._verify_ssl
self._set_access_token(self.api_key)
self._set_access_token()
self._session.headers['Authorization'] = 'Bearer {}'.format(self._access_token)
self._session.headers['User-Agent'] = self.user_agent

Expand Down

0 comments on commit 82d95b2

Please sign in to comment.