From 5a3f9b211c556a7232754b36ea198163fea3a806 Mon Sep 17 00:00:00 2001 From: Joshua Hiller <74007258+jshcodes@users.noreply.github.com> Date: Tue, 4 Jan 2022 18:40:03 -0500 Subject: [PATCH] Resolve PyCharm warning: Service Class auth_object (#506) * Update CHANGELOG.md * Define auth_object explicitly * Update wordlist.txt --- .github/wordlist.txt | 3 ++- CHANGELOG.md | 4 ++++ src/falconpy/_service_class.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/wordlist.txt b/.github/wordlist.txt index 68e8f0d1d..ce41cf250 100644 --- a/.github/wordlist.txt +++ b/.github/wordlist.txt @@ -602,4 +602,5 @@ GetBehaviorDetections MessageCenter yaleman Fal -morcef \ No newline at end of file +morcef +PyCharm \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 08eec72d5..479add9ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ print(detects.token_fail_reason) ``` +## Issues resolved ++ Fixed: Code hint warning in PyCharm for missing auth_object definition within _service_class.py. + + # Version 0.8.11 ## Added features and functionality + Added: FileVantage Service Class and all related endpoints. diff --git a/src/falconpy/_service_class.py b/src/falconpy/_service_class.py index a1555c886..a1d196bca 100644 --- a/src/falconpy/_service_class.py +++ b/src/falconpy/_service_class.py @@ -89,6 +89,7 @@ def __init__(self: object, auth_object: object = None, self.refreshable = False self.token_fail_reason = None self.token_status = None + self.auth_object = None client_id = kwargs.get("client_id", None) client_secret = kwargs.get("client_secret", None) if client_id and client_secret and not creds: @@ -161,7 +162,6 @@ def __init__(self: object, auth_object: object = None, self.headers = {} self.refreshable = True else: - self.auth_object = None self.headers = {"Authorization": f"Bearer {access_token}"} self.proxy = proxy