This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/authentik/root/websocket.py

22 lines
584 B
Python

"""root Websocket URLS"""
from importlib import import_module
from structlog.stdlib import get_logger
from authentik.lib.utils.reflection import get_apps
LOGGER = get_logger()
websocket_urlpatterns = []
for _authentik_app in get_apps():
mountpoint = getattr(_authentik_app, "ws_mountpoint", None)
if not mountpoint:
continue
ws_paths = import_module(mountpoint)
websocket_urlpatterns.extend(getattr(ws_paths, "websocket_urlpatterns"))
LOGGER.debug(
"Mounted URLs",
app_name=_authentik_app.name,
app_mountpoint=mountpoint,
)