Skip to content

Commit

Permalink
Removed beautifulsoup4 lib
Browse files Browse the repository at this point in the history
  • Loading branch information
ishans-crest committed Sep 18, 2024
1 parent c61f44a commit 32f7568
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
7 changes: 0 additions & 7 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,3 @@ Splunk SOAR SMTP
Copyright (c) 2016-2024 Splunk Inc.

Third-party Software Attributions:

Library: beautifulsoup4
Version: 4.9.1
License: MIT
Copyright 2004-2017 Leonard Richardson
Copyright 2004-2019 Leonard Richardson
Copyright 2018 Isaac Muse
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
beautifulsoup4==4.9.1
bleach==6.0.0
bleach-allowlist==1.0.3
bleach[css]
18 changes: 7 additions & 11 deletions smtp_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _with_oauth_type(self, action_result):
self._access_token = self.decrypt_state(self._access_token, "access")
if self._refresh_token:
self._refresh_token = self.decrypt_state(self._refresh_token, "refresh")

except Exception as e:
self.debug_print("{}: {}".format(SMTP_DECRYPTION_ERROR, self._get_error_message_from_exception(e)))
return self.set_status(phantom.APP_ERROR, SMTP_DECRYPTION_ERROR)
Expand Down Expand Up @@ -442,8 +441,8 @@ def _set_interactive_auth(self, action_result):

# Run the initial authentication flow only if current action is test connectivity
if self.get_action_identifier() != self.ACTION_ID_TEST_CONNECTIVITY:
# if not self._access_token:
# return phantom.APP_ERROR, "Unable to get access token. Has Test Connectivity been run?"
if not self._access_token:
return phantom.APP_ERROR, "Unable to get access token. Has Test Connectivity been run?"

try:
ret_val = self._connect_to_server(action_result)
Expand Down Expand Up @@ -629,14 +628,11 @@ def _connect_to_server(self, action_result, first_try=True):
decoded_str = decoded_bytes.decode("ascii")
json_str = json.loads(decoded_str)

if "gmail" in config[phantom.APP_JSON_SERVER]:
pass
else:
if json_str.get("status") == "400":
return action_result.set_status(
phantom.APP_ERROR,
"Could not connect to server, please check your asset configuration and re-run test connectivity"
)
if "gmail" not in config[phantom.APP_JSON_SERVER] and json_str.get("status") == "400":
return action_result.set_status(
phantom.APP_ERROR,
"Could not connect to server, please check your asset configuration and re-run test connectivity"
)
ret_val, message = self._interactive_auth_refresh()
if not ret_val:
return action_result.set_status(phantom.APP_ERROR, message)
Expand Down

0 comments on commit 32f7568

Please sign in to comment.