Peter Mutwiri commited on
Commit Β·
784ea15
1
Parent(s): 4eed1ee
updated prefix for va in datasources json to be accessible
Browse files- app/main.py +9 -8
- app/routers/datasources.py +1 -1
- app/routers/ingress.py +0 -16
app/main.py
CHANGED
|
@@ -24,6 +24,7 @@ from fastapi.responses import JSONResponse
|
|
| 24 |
from contextlib import asynccontextmanager
|
| 25 |
|
| 26 |
# βββ Router Imports βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 27 |
from app.routers import (
|
| 28 |
health, # Health & monitoring
|
| 29 |
datasources, # Data ingestion
|
|
@@ -31,7 +32,7 @@ from app.routers import (
|
|
| 31 |
flags, # Feature flags
|
| 32 |
scheduler, # Background jobs
|
| 33 |
run, # Analytics execution
|
| 34 |
-
|
| 35 |
)
|
| 36 |
|
| 37 |
# βββ Dependencies βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -135,7 +136,7 @@ app = FastAPI(
|
|
| 135 |
"email": "enterprise@mutsynchub.com"
|
| 136 |
},
|
| 137 |
license_info={
|
| 138 |
-
"name": "
|
| 139 |
}
|
| 140 |
)
|
| 141 |
|
|
@@ -238,12 +239,12 @@ PUBLIC_ROUTERS = [
|
|
| 238 |
|
| 239 |
# Protected routers (require X-API-KEY)
|
| 240 |
PROTECTED_ROUTERS = [
|
| 241 |
-
(datasources.router, "/api/datasources"),
|
| 242 |
-
(reports.router, "/api/reports"),
|
| 243 |
-
(flags.router, "/api/flags"),
|
| 244 |
-
(scheduler.router, "/api/scheduler"),
|
| 245 |
-
(run.router, "/api/run"),
|
| 246 |
-
|
| 247 |
]
|
| 248 |
|
| 249 |
# Register routers with tags for OpenAPI
|
|
|
|
| 24 |
from contextlib import asynccontextmanager
|
| 25 |
|
| 26 |
# βββ Router Imports βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 27 |
+
# Import ALL routers
|
| 28 |
from app.routers import (
|
| 29 |
health, # Health & monitoring
|
| 30 |
datasources, # Data ingestion
|
|
|
|
| 32 |
flags, # Feature flags
|
| 33 |
scheduler, # Background jobs
|
| 34 |
run, # Analytics execution
|
| 35 |
+
socket, # Real-time updates
|
| 36 |
)
|
| 37 |
|
| 38 |
# βββ Dependencies βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 136 |
"email": "enterprise@mutsynchub.com"
|
| 137 |
},
|
| 138 |
license_info={
|
| 139 |
+
"name": "MIT License",
|
| 140 |
}
|
| 141 |
)
|
| 142 |
|
|
|
|
| 239 |
|
| 240 |
# Protected routers (require X-API-KEY)
|
| 241 |
PROTECTED_ROUTERS = [
|
| 242 |
+
(datasources.router, "/api/v1/datasources"),
|
| 243 |
+
(reports.router, "/api/v1/reports"),
|
| 244 |
+
(flags.router, "/api/v1/flags"),
|
| 245 |
+
(scheduler.router, "/api/v1/scheduler"),
|
| 246 |
+
(run.router, "/api/v1/run"),
|
| 247 |
+
(socket.router, "/api/v1/socket"),
|
| 248 |
]
|
| 249 |
|
| 250 |
# Register routers with tags for OpenAPI
|
app/routers/datasources.py
CHANGED
|
@@ -10,7 +10,7 @@ from app.routers.socket import sio
|
|
| 10 |
import pandas as pd
|
| 11 |
import json
|
| 12 |
|
| 13 |
-
router = APIRouter(
|
| 14 |
|
| 15 |
|
| 16 |
# =======================================================================
|
|
|
|
| 10 |
import pandas as pd
|
| 11 |
import json
|
| 12 |
|
| 13 |
+
router = APIRouter(tags=["datasources"]) # Remove
|
| 14 |
|
| 15 |
|
| 16 |
# =======================================================================
|
app/routers/ingress.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
# from fastapi import APIRouter, Depends
|
| 2 |
-
# from pydantic import BaseModel
|
| 3 |
-
# from app.deps import verify_key
|
| 4 |
-
|
| 5 |
-
# router = APIRouter(prefix="/api/v1", tags=["datasources"])
|
| 6 |
-
|
| 7 |
-
# class NewSource(BaseModel):
|
| 8 |
-
# orgId: str
|
| 9 |
-
# sourceId: str
|
| 10 |
-
# type: str
|
| 11 |
-
# config: dict
|
| 12 |
-
|
| 13 |
-
# @router.post("/datasources")
|
| 14 |
-
# def create_source(payload: NewSource, _: str = Depends(verify_key)):
|
| 15 |
-
# print("[analytics] new source", payload)
|
| 16 |
-
# return {"id": payload.sourceId, "status": "sync_queued"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|