Skip to content

Commit 8a88f2d

Browse files
committed
fix(talk_bot): remove the dead appconfig_ex bot-secret fallback
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 36b42d8 commit 8a88f2d

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

nc_py_api/talk_bot.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,24 +357,16 @@ def __get_bot_secret(callback_url: str) -> str:
357357

358358

359359
def get_bot_secret(callback_url: str) -> bytes | None:
360-
"""Returns the bot's secret from an environment variable or from the application's configuration on the server."""
360+
"""Returns the bot's secret from the environment variable populated when the bot was registered."""
361361
secret_key = __get_bot_secret(callback_url)
362362
if secret_key in os.environ:
363363
return os.environ[secret_key].encode("UTF-8")
364-
secret_value = NextcloudApp().appconfig_ex.get_value(secret_key)
365-
if secret_value is not None:
366-
os.environ[secret_key] = secret_value
367-
return secret_value.encode("UTF-8")
368364
return None
369365

370366

371367
async def aget_bot_secret(callback_url: str) -> bytes | None:
372-
"""Returns the bot's secret from an environment variable or from the application's configuration on the server."""
368+
"""Returns the bot's secret from the environment variable populated when the bot was registered."""
373369
secret_key = __get_bot_secret(callback_url)
374370
if secret_key in os.environ:
375371
return os.environ[secret_key].encode("UTF-8")
376-
secret_value = await AsyncNextcloudApp().appconfig_ex.get_value(secret_key)
377-
if secret_value is not None:
378-
os.environ[secret_key] = secret_value
379-
return secret_value.encode("UTF-8")
380372
return None

0 commit comments

Comments
 (0)