feat(security): add approved rooms/users/domains as env variables (#277)

* feat(security): add approved rooms/users/domains as env variables
* chore(lint): fix R0902
* chore(lint): fix C0114
* chore(lint): fix C0116
* chore(lint): fix C0413
This commit is contained in:
2024-08-30 19:38:56 +01:00
committed by GitHub
parent 56f1cb924e
commit b758d0dfda
8 changed files with 109 additions and 28 deletions

View File

@ -2,14 +2,12 @@
import sentry_sdk
from sentry_sdk.integrations.stdlib import StdlibIntegration
from webex_bot.webex_bot import WebexBot
from app.commands.exit import ExitCommand
from app.commands.submit_task import SubmitTaskCommand
from app.utils.config import config
if config.sentry_enabled:
apm = sentry_sdk.init(
dsn=config.sentry_dsn,
@ -17,7 +15,7 @@ if config.sentry_enabled:
environment=config.environment,
release=config.version,
integrations=[StdlibIntegration()],
spotlight=True
spotlight=True,
)
@ -26,7 +24,9 @@ def create_bot() -> WebexBot:
webex_bot: WebexBot = WebexBot(
bot_name=config.bot_name,
teams_bot_token=config.webex_token,
approved_domains=["cisco.com"],
approved_domains=config.approved_domains,
approved_rooms=config.approved_rooms,
approved_users=config.approved_users,
)
webex_bot.commands.clear()
webex_bot.add_command(SubmitTaskCommand())