authentik.core.urls

authentik URL Configuration

  1"""authentik URL Configuration"""
  2
  3from django.conf import settings
  4from django.urls import path
  5
  6from authentik.core.api.application_entitlements import ApplicationEntitlementViewSet
  7from authentik.core.api.applications import ApplicationViewSet
  8from authentik.core.api.authenticated_sessions import AuthenticatedSessionViewSet
  9from authentik.core.api.devices import AdminDeviceViewSet, DeviceViewSet
 10from authentik.core.api.groups import GroupViewSet
 11from authentik.core.api.property_mappings import PropertyMappingViewSet
 12from authentik.core.api.providers import ProviderViewSet
 13from authentik.core.api.sources import (
 14    GroupSourceConnectionViewSet,
 15    SourceViewSet,
 16    UserSourceConnectionViewSet,
 17)
 18from authentik.core.api.tokens import TokenViewSet
 19from authentik.core.api.transactional_applications import TransactionalApplicationView
 20from authentik.core.api.users import UserViewSet
 21from authentik.core.setup.views import SetupView
 22from authentik.core.views.apps import RedirectToAppLaunch
 23from authentik.core.views.debug import AccessDeniedView
 24from authentik.core.views.interface import (
 25    BrandDefaultRedirectView,
 26    InterfaceView,
 27    RootRedirectView,
 28)
 29from authentik.flows.views.interface import FlowInterfaceView
 30from authentik.root.asgi_middleware import AuthMiddlewareStack
 31from authentik.root.middleware import ChannelsLoggingMiddleware
 32from authentik.root.ws.consumer import MessageConsumer
 33from authentik.tenants.channels import TenantsAwareMiddleware
 34
 35urlpatterns = [
 36    path(
 37        "",
 38        RootRedirectView.as_view(),
 39        name="root-redirect",
 40    ),
 41    path(
 42        # We have to use this format since everything else uses application/o or application/saml
 43        "application/launch/<slug:application_slug>/",
 44        RedirectToAppLaunch.as_view(),
 45        name="application-launch",
 46    ),
 47    # Interfaces
 48    path(
 49        "if/admin/",
 50        BrandDefaultRedirectView.as_view(template_name="if/admin.html"),
 51        name="if-admin",
 52    ),
 53    path(
 54        "if/user/",
 55        BrandDefaultRedirectView.as_view(template_name="if/user.html"),
 56        name="if-user",
 57    ),
 58    path(
 59        "if/flow/<slug:flow_slug>/",
 60        # FIXME: move this url to the flows app...also will cause all
 61        # of the reverse calls to be adjusted
 62        FlowInterfaceView.as_view(),
 63        name="if-flow",
 64    ),
 65    path(
 66        "setup",
 67        SetupView.as_view(),
 68        name="setup",
 69    ),
 70    # Fallback for WS
 71    path("ws/outpost/<uuid:pk>/", InterfaceView.as_view(template_name="if/admin.html")),
 72    path(
 73        "ws/client/",
 74        InterfaceView.as_view(template_name="if/admin.html"),
 75    ),
 76]
 77
 78api_urlpatterns = [
 79    ("core/authenticated_sessions", AuthenticatedSessionViewSet),
 80    ("core/applications", ApplicationViewSet),
 81    ("core/application_entitlements", ApplicationEntitlementViewSet),
 82    path(
 83        "core/transactional/applications/",
 84        TransactionalApplicationView.as_view(),
 85        name="core-transactional-application",
 86    ),
 87    ("core/groups", GroupViewSet),
 88    ("core/users", UserViewSet),
 89    ("core/tokens", TokenViewSet),
 90    ("sources/all", SourceViewSet),
 91    ("sources/user_connections/all", UserSourceConnectionViewSet),
 92    ("sources/group_connections/all", GroupSourceConnectionViewSet),
 93    ("providers/all", ProviderViewSet),
 94    ("propertymappings/all", PropertyMappingViewSet),
 95    ("authenticators/all", DeviceViewSet, "device"),
 96    (
 97        "authenticators/admin/all",
 98        AdminDeviceViewSet,
 99        "admin-device",
100    ),
101]
102
103websocket_urlpatterns = [
104    path(
105        "ws/client/",
106        ChannelsLoggingMiddleware(
107            TenantsAwareMiddleware(AuthMiddlewareStack(MessageConsumer.as_asgi()))
108        ),
109    ),
110]
111
112if settings.DEBUG:
113    urlpatterns += [
114        path("debug/policy/deny/", AccessDeniedView.as_view(), name="debug-policy-deny"),
115    ]
urlpatterns = [<URLPattern '' [name='root-redirect']>, <URLPattern 'application/launch/<slug:application_slug>/' [name='application-launch']>, <URLPattern 'if/admin/' [name='if-admin']>, <URLPattern 'if/user/' [name='if-user']>, <URLPattern 'if/flow/<slug:flow_slug>/' [name='if-flow']>, <URLPattern 'setup' [name='setup']>, <URLPattern 'ws/outpost/<uuid:pk>/'>, <URLPattern 'ws/client/'>]
api_urlpatterns = [('core/authenticated_sessions', <class 'authentik.core.api.authenticated_sessions.AuthenticatedSessionViewSet'>), ('core/applications', <class 'authentik.core.api.applications.ApplicationViewSet'>), ('core/application_entitlements', <class 'authentik.core.api.application_entitlements.ApplicationEntitlementViewSet'>), <URLPattern 'core/transactional/applications/' [name='core-transactional-application']>, ('core/groups', <class 'authentik.core.api.groups.GroupViewSet'>), ('core/users', <class 'authentik.core.api.users.UserViewSet'>), ('core/tokens', <class 'authentik.core.api.tokens.TokenViewSet'>), ('sources/all', <class 'authentik.core.api.sources.SourceViewSet'>), ('sources/user_connections/all', <class 'authentik.core.api.sources.UserSourceConnectionViewSet'>), ('sources/group_connections/all', <class 'authentik.core.api.sources.GroupSourceConnectionViewSet'>), ('providers/all', <class 'authentik.core.api.providers.ProviderViewSet'>), ('propertymappings/all', <class 'authentik.core.api.property_mappings.PropertyMappingViewSet'>), ('authenticators/all', <class 'authentik.core.api.devices.DeviceViewSet'>, 'device'), ('authenticators/admin/all', <class 'authentik.core.api.devices.AdminDeviceViewSet'>, 'admin-device')]
websocket_urlpatterns = [<URLPattern 'ws/client/'>]