From 0d14d5585535882c31be6f86f15f195c8d95218a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 02:18:22 +0000 Subject: [PATCH 1/2] chore(deps): update pylint requirement from ~=2.14.5 to ~=3.2.3 Updates the requirements on [pylint](https://github.com/pylint-dev/pylint) to permit the latest version. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v2.14.5...v3.2.3) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2eaedbb..374088b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,6 @@ setuptools~=70.0.0 requests~=2.32.3 pyyaml~=6.0 pyOpenSSL~=24.1.0 -pylint~=2.14.5 +pylint~=3.2.3 html2text~=2024.2.26 pdoc3~=0.10.0 From 324302273112656e1559d0008bdd1b9da5420e36 Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Tue, 11 Jun 2024 09:31:38 -0600 Subject: [PATCH 2/2] fix: ensure requests have timeout set --- examples/scripts/listener_with_custom_connector.py | 3 ++- mail2beyond/connectors/discord.py | 3 ++- mail2beyond/connectors/google_chat.py | 3 ++- mail2beyond/connectors/microsoft_teams.py | 3 ++- mail2beyond/connectors/slack.py | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/scripts/listener_with_custom_connector.py b/examples/scripts/listener_with_custom_connector.py index 7c1c17f..6041d69 100644 --- a/examples/scripts/listener_with_custom_connector.py +++ b/examples/scripts/listener_with_custom_connector.py @@ -33,7 +33,8 @@ def submit(self, parser): resp = requests.post( url=self.config["url"], headers={'Content-Type': 'application/json'}, - json={"msg": f"{subject}\n{content}\n{date}\n{some_specific_header}"} + json={"msg": f"{subject}\n{content}\n{date}\n{some_specific_header}"}, + timeout=30 ) self.log.debug(f"connector 'my_custom_connector' responded with {resp.status_code} status {resp.text}") except Exception as req_err: diff --git a/mail2beyond/connectors/discord.py b/mail2beyond/connectors/discord.py index 348c59b..34b7ca1 100644 --- a/mail2beyond/connectors/discord.py +++ b/mail2beyond/connectors/discord.py @@ -18,7 +18,8 @@ def submit(self, parser): resp = requests.post( url=self.config["webhook_url"], headers={'Content-Type': 'application/json'}, - json={"content": f"*{parser.subject}*\n\n{parser.content}"} + json={"content": f"*{parser.subject}*\n\n{parser.content}"}, + timeout=30 ) self.log.debug(f"connector '{self}' responded with {resp.status_code} status {resp.text}") except Exception as discord_req_err: diff --git a/mail2beyond/connectors/google_chat.py b/mail2beyond/connectors/google_chat.py index c12ea49..e7fa784 100644 --- a/mail2beyond/connectors/google_chat.py +++ b/mail2beyond/connectors/google_chat.py @@ -18,7 +18,8 @@ def submit(self, parser): resp = requests.post( url=self.config["webhook_url"], headers={'Content-Type': 'application/json; charset=UTF-8'}, - json={"text": f"*{parser.subject}*\n\n{parser.content}"} + json={"text": f"*{parser.subject}*\n\n{parser.content}"}, + timeout=30 ) self.log.debug(f"connector '{self}' responded with {resp.status_code} status {resp.text}") except Exception as google_chat_req_err: diff --git a/mail2beyond/connectors/microsoft_teams.py b/mail2beyond/connectors/microsoft_teams.py index 293283e..3e54a10 100644 --- a/mail2beyond/connectors/microsoft_teams.py +++ b/mail2beyond/connectors/microsoft_teams.py @@ -19,7 +19,8 @@ def submit(self, parser): resp = requests.post( url=self.config["webhook_url"], headers={'Content-Type': 'application/json; charset=utf-8'}, - json={"text": f"*{parser.subject}*\n\n{parser.content}"} + json={"text": f"*{parser.subject}*\n\n{parser.content}"}, + timeout=30 ) self.log.debug(f"connector '{self}' responded with {resp.status_code} status {resp.text}") except Exception as microsoft_teams_req_err: diff --git a/mail2beyond/connectors/slack.py b/mail2beyond/connectors/slack.py index af2e23c..da00296 100644 --- a/mail2beyond/connectors/slack.py +++ b/mail2beyond/connectors/slack.py @@ -18,7 +18,8 @@ def submit(self, parser): resp = requests.post( url=self.config["webhook_url"], headers={'Content-Type': 'application/json'}, - json={"text": f"*{parser.subject}*\n\n{parser.content}"} + json={"text": f"*{parser.subject}*\n\n{parser.content}"}, + timeout=30 ) self.log.debug(f"connector '{self}' responded with {resp.status_code} status {resp.text}") except Exception as slack_req_err: