From 8a88f2de5c8677c7a7a9bed47fa3af255389f2bd Mon Sep 17 00:00:00 2001 From: Oleksander Piskun Date: Fri, 29 May 2026 17:31:20 +0000 Subject: [PATCH] fix(talk_bot): remove the dead appconfig_ex bot-secret fallback Signed-off-by: Oleksander Piskun --- nc_py_api/talk_bot.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/nc_py_api/talk_bot.py b/nc_py_api/talk_bot.py index bcc33220..7de0c8fa 100644 --- a/nc_py_api/talk_bot.py +++ b/nc_py_api/talk_bot.py @@ -357,24 +357,16 @@ def __get_bot_secret(callback_url: str) -> str: def get_bot_secret(callback_url: str) -> bytes | None: - """Returns the bot's secret from an environment variable or from the application's configuration on the server.""" + """Returns the bot's secret from the environment variable populated when the bot was registered.""" secret_key = __get_bot_secret(callback_url) if secret_key in os.environ: return os.environ[secret_key].encode("UTF-8") - secret_value = NextcloudApp().appconfig_ex.get_value(secret_key) - if secret_value is not None: - os.environ[secret_key] = secret_value - return secret_value.encode("UTF-8") return None async def aget_bot_secret(callback_url: str) -> bytes | None: - """Returns the bot's secret from an environment variable or from the application's configuration on the server.""" + """Returns the bot's secret from the environment variable populated when the bot was registered.""" secret_key = __get_bot_secret(callback_url) if secret_key in os.environ: return os.environ[secret_key].encode("UTF-8") - secret_value = await AsyncNextcloudApp().appconfig_ex.get_value(secret_key) - if secret_value is not None: - os.environ[secret_key] = secret_value - return secret_value.encode("UTF-8") return None