Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def prepare(self) -> None:
set_logging_level(self.LOGGERS, logging.WARNING)
ngrok.set_auth_token(self.config[CONFIG_CATEGORY_SERVICES][CONFIG_WEBHOOK][CONFIG_NGROK_TOKEN])
try:
self.webhook_host = os.getenv(ENV_WEBHOOK_ADDRESS, self.config[CONFIG_CATEGORY_SERVICES]
[CONFIG_WEBHOOK][CONFIG_WEB_IP])
except KeyError:
self.webhook_host = os.getenv(ENV_WEBHOOK_ADDRESS, DEFAULT_WEBHOOK_SERVER_IP)
try:
self.webhook_port = int(os.getenv(ENV_WEBHOOK_PORT, self.config[CONFIG_CATEGORY_SERVICES]
[CONFIG_WEBHOOK][CONFIG_WEB_PORT]))
except KeyError:
self.webhook_port = int(os.getenv(ENV_WEBHOOK_PORT, DEFAULT_WEBHOOK_SERVER_PORT))