Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/app/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,10 @@
"USER_FILTER_PARSER": "scim.filters.UserFilterQuery",
}

EDGE_PROXY_INSTALLED = importlib.util.find_spec("edge_proxy") is not None
if EDGE_PROXY_INSTALLED:
INSTALLED_APPS.append("edge_proxy")

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

# Used to keep edge identities in sync by forwarding the http requests
Expand Down
12 changes: 12 additions & 0 deletions api/app/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import importlib

from common.core.urls import urlpatterns as core_urlpatterns
from common.core.utils import is_saas
from django.conf import settings
from django.contrib import admin
from django.urls import include, path, re_path
Expand Down Expand Up @@ -124,6 +125,17 @@
),
]

# Self-hosted / private-cloud only: SaaS images ship the private wheel, so the
# runtime is_saas() check is the gate, not the module's presence.
if settings.EDGE_PROXY_INSTALLED and not is_saas(): # pragma: no cover
urlpatterns += [
path(
"api/v1/organisations/<int:organisation_pk>/edge-proxy/",
include("edge_proxy.management_urls"),
),
path("api/v1/proxy/", include("edge_proxy.urls")),
]

if settings.WORKFLOWS_LOGIC_INSTALLED: # pragma: no cover
workflow_views = importlib.import_module("workflows_logic.views")
urlpatterns += [
Expand Down
4 changes: 4 additions & 0 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ ignore_missing_imports = true
module = ["rbac.*"]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = ["edge_proxy.*"]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = ["saml.*"]
ignore_missing_imports = true
Expand Down
Loading