Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#OBS-I86 : commented routes having regex #243

Merged
merged 1 commit into from
Sep 11, 2024
Merged
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
2 changes: 1 addition & 1 deletion api-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import bodyParser from "body-parser";
import { errorHandler, obsrvErrorHandler } from "./middlewares/errors";
import { ResponseHandler } from "./helpers/ResponseHandler";

Check failure on line 8 in api-service/src/app.ts

View workflow job for this annotation

GitHub Actions / test-cases

'ResponseHandler' is defined but never used
import { config } from "./configs/Config";
import { alertsRouter } from "./routes/AlertsRouter";
import { interceptAuditEvents } from "./services/telemetry";
Expand All @@ -22,7 +22,7 @@
app.use("/", druidProxyRouter);
app.use("/alerts/v1", alertsRouter);
app.use("/", metricRouter);
app.use("*", ResponseHandler.routeNotFound);
// app.use("*", ResponseHandler.routeNotFound);
app.use(obsrvErrorHandler);

app.listen(config.api_port, () => {
Expand Down
22 changes: 11 additions & 11 deletions api-service/src/routes/DruidProxyRouter.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import express from "express";
import { Entity } from "../types/MetricModel";

Check failure on line 2 in api-service/src/routes/DruidProxyRouter.ts

View workflow job for this annotation

GitHub Actions / test-cases

'Entity' is defined but never used
import { wrapperService } from "../services/WrapperService";

Check failure on line 3 in api-service/src/routes/DruidProxyRouter.ts

View workflow job for this annotation

GitHub Actions / test-cases

'wrapperService' is defined but never used
import { onRequest } from "../metrics/prometheus/helpers";

Check failure on line 4 in api-service/src/routes/DruidProxyRouter.ts

View workflow job for this annotation

GitHub Actions / test-cases

'onRequest' is defined but never used
import { setDataToRequestObject } from "../middlewares/setDataToRequestObject";

Check failure on line 5 in api-service/src/routes/DruidProxyRouter.ts

View workflow job for this annotation

GitHub Actions / test-cases

'setDataToRequestObject' is defined but never used
import { healthService } from "../services/HealthService";

Check failure on line 6 in api-service/src/routes/DruidProxyRouter.ts

View workflow job for this annotation

GitHub Actions / test-cases

'healthService' is defined but never used
import { ResponseHandler } from "../helpers/ResponseHandler";

Check failure on line 7 in api-service/src/routes/DruidProxyRouter.ts

View workflow job for this annotation

GitHub Actions / test-cases

'ResponseHandler' is defined but never used

export const druidProxyRouter = express.Router();

// Send a 410 Gone response to all V1 API calls
druidProxyRouter.all("/datasets/v1/*", ResponseHandler.goneResponse)
druidProxyRouter.all("/dataset/v1/*", ResponseHandler.goneResponse)
druidProxyRouter.all("/datasources/v1/*", ResponseHandler.goneResponse)
druidProxyRouter.all("/data/v1/*", ResponseHandler.goneResponse)
druidProxyRouter.all("/template/v1/*", ResponseHandler.goneResponse)
// druidProxyRouter.all("/datasets/v1/*", ResponseHandler.goneResponse)
// druidProxyRouter.all("/dataset/v1/*", ResponseHandler.goneResponse)
// druidProxyRouter.all("/datasources/v1/*", ResponseHandler.goneResponse)
// druidProxyRouter.all("/data/v1/*", ResponseHandler.goneResponse)
// druidProxyRouter.all("/template/v1/*", ResponseHandler.goneResponse)

// Druid Proxy APIs for Metabase integration
druidProxyRouter.post(/\/druid\/v2.*/, setDataToRequestObject("query.wrapper.native.post"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNative)
druidProxyRouter.get(/\/druid\/v2.*/, setDataToRequestObject("query.wrapper.native.get"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNativeGet)
druidProxyRouter.delete("/druid/v2/:queryId", setDataToRequestObject("query.wrapper.native.delete"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNativeDel)
druidProxyRouter.get("/status", setDataToRequestObject("query.wrapper.status"), onRequest({ entity: Entity.DruidProxy }), wrapperService.nativeStatus)
druidProxyRouter.get("/health", setDataToRequestObject("api.health"), onRequest({ entity: Entity.DruidProxy }), healthService.checkDruidHealth)
// // Druid Proxy APIs for Metabase integration
// druidProxyRouter.post(/\/druid\/v2.*/, setDataToRequestObject("query.wrapper.native.post"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNative)
// druidProxyRouter.get(/\/druid\/v2.*/, setDataToRequestObject("query.wrapper.native.get"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNativeGet)
// druidProxyRouter.delete("/druid/v2/:queryId", setDataToRequestObject("query.wrapper.native.delete"), onRequest({ entity: Entity.DruidProxy }), wrapperService.forwardNativeDel)
// druidProxyRouter.get("/status", setDataToRequestObject("query.wrapper.status"), onRequest({ entity: Entity.DruidProxy }), wrapperService.nativeStatus)
// druidProxyRouter.get("/health", setDataToRequestObject("api.health"), onRequest({ entity: Entity.DruidProxy }), healthService.checkDruidHealth)
Loading