From 99a7002a875dc409d044fc8a0825b8f58275fdff Mon Sep 17 00:00:00 2001 From: shahargl Date: Mon, 2 Sep 2024 11:09:00 +0300 Subject: [PATCH 1/2] fix: topology --- keep/api/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keep/api/api.py b/keep/api/api.py index 11904bd98..a517f1fba 100644 --- a/keep/api/api.py +++ b/keep/api/api.py @@ -41,6 +41,7 @@ settings, status, tags, + topology, whoami, workflows, ) @@ -218,6 +219,7 @@ def get_app( ) app.include_router(dashboard.router, prefix="/dashboard", tags=["dashboard"]) app.include_router(tags.router, prefix="/tags", tags=["tags"]) + app.include_router(topology.router, prefix="/topology", tags=["topology"]) # if its single tenant with authentication, add signin endpoint logger.info(f"Starting Keep with authentication type: {AUTH_TYPE}") From 7430e43c39a97b31a6422f6ea46761c7f8c4b1cd Mon Sep 17 00:00:00 2001 From: shahargl Date: Mon, 2 Sep 2024 11:29:45 +0300 Subject: [PATCH 2/2] fix: topology --- keep/api/routes/topology.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keep/api/routes/topology.py b/keep/api/routes/topology.py index a8c0e56bd..8e2be6678 100644 --- a/keep/api/routes/topology.py +++ b/keep/api/routes/topology.py @@ -6,8 +6,9 @@ from keep.api.core.db import ( # Assuming this function exists to fetch topology data get_all_topology_data, ) -from keep.api.core.dependencies import AuthenticatedEntity, AuthVerifier from keep.api.models.db.topology import TopologyServiceDtoOut +from keep.identitymanager.authenticatedentity import AuthenticatedEntity +from keep.identitymanager.identitymanagerfactory import IdentityManagerFactory logger = logging.getLogger(__name__) router = APIRouter() @@ -22,7 +23,7 @@ def get_topology_data( service_id: Optional[str] = None, environment: Optional[str] = None, authenticated_entity: AuthenticatedEntity = Depends( - AuthVerifier(["read:topology"]) + IdentityManagerFactory.get_auth_verifier(["read:topology"]) ), ) -> List[TopologyServiceDtoOut]: tenant_id = authenticated_entity.tenant_id