From 2aa07002c45816c23d728b760f0d1c84b03183f3 Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:02:00 +0300 Subject: [PATCH] app_api-2.0: fixed forgot about slash removal (#213) Subj, **make CI green**. --------- Signed-off-by: Alexander Piskun --- .github/workflows/analysis-coverage.yml | 8 ++++---- nc_py_api/talk_bot.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/analysis-coverage.yml b/.github/workflows/analysis-coverage.yml index 2df51c65..dc7bd654 100644 --- a/.github/workflows/analysis-coverage.yml +++ b/.github/workflows/analysis-coverage.yml @@ -155,7 +155,7 @@ jobs: - name: Uninstall NcPyApi run: | - php occ app_api:app:unregister "$APP_ID" --silent + php occ app_api:app:unregister "$APP_ID" --silent --force php occ app_api:daemon:unregister manual_install - name: Generate coverage report (2) @@ -316,7 +316,7 @@ jobs: - name: Uninstall NcPyApi run: | - php occ app_api:app:unregister "$APP_ID" --silent + php occ app_api:app:unregister "$APP_ID" --silent --force php occ app_api:daemon:unregister manual_install - name: Generate coverage report (2) @@ -610,7 +610,7 @@ jobs: - name: Uninstall NcPyApi run: | - php occ app_api:app:unregister "$APP_ID" --silent + php occ app_api:app:unregister "$APP_ID" --silent --force php occ app_api:daemon:unregister manual_install - name: Generate coverage report (2) @@ -790,7 +790,7 @@ jobs: - name: Uninstall NcPyApi run: | - php occ app_api:app:unregister "$APP_ID" --silent + php occ app_api:app:unregister "$APP_ID" --silent --force php occ app_api:daemon:unregister manual_install - name: Generate coverage report (2) diff --git a/nc_py_api/talk_bot.py b/nc_py_api/talk_bot.py index afd0c868..3a0c3270 100644 --- a/nc_py_api/talk_bot.py +++ b/nc_py_api/talk_bot.py @@ -211,7 +211,7 @@ def __init__(self, callback_url: str, display_name: str, description: str = ""): :param display_name: The display name of the bot that is shown as author when it posts a message or reaction. :param description: Description of the bot helping moderators to decide if they want to enable this bot. """ - self.callback_url = callback_url + self.callback_url = callback_url.lstrip("/") self.display_name = display_name self.description = description @@ -318,7 +318,7 @@ async def _sign_send_request(self, method: str, url_suffix: str, data: dict, dat def __get_bot_secret(callback_url: str) -> str: sha_1 = hashlib.sha1(usedforsecurity=False) - string_to_hash = os.environ["APP_ID"] + "_" + callback_url + string_to_hash = os.environ["APP_ID"] + "_" + callback_url.lstrip("/") sha_1.update(string_to_hash.encode("UTF-8")) return sha_1.hexdigest()