From 9f9d477e85aeaf802ac7bedd7d491ed5f3f781ae Mon Sep 17 00:00:00 2001 From: Henry Fontanier Date: Thu, 16 Nov 2023 16:30:50 +0100 Subject: [PATCH] dev/dust only for now --- .../api/v1/w/[wId]/data_sources/[name]/databases/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/front/pages/api/v1/w/[wId]/data_sources/[name]/databases/index.ts b/front/pages/api/v1/w/[wId]/data_sources/[name]/databases/index.ts index 55ba8257d62d..eb8fd9a0a6e9 100644 --- a/front/pages/api/v1/w/[wId]/data_sources/[name]/databases/index.ts +++ b/front/pages/api/v1/w/[wId]/data_sources/[name]/databases/index.ts @@ -6,6 +6,7 @@ import { NextApiRequest, NextApiResponse } from "next"; import { getDataSource } from "@app/lib/api/data_sources"; import { Authenticator, getAPIKey } from "@app/lib/auth"; import { CoreAPI, CoreAPIDatabase } from "@app/lib/core_api"; +import { isDevelopmentOrDustWorkspace } from "@app/lib/development"; import { generateModelSId } from "@app/lib/utils"; import logger from "@app/logger/logger"; import { apiError, withLogging } from "@app/logger/withlogging"; @@ -51,6 +52,11 @@ async function handler( }); } + if (!isDevelopmentOrDustWorkspace(owner)) { + res.status(404).end(); + return; + } + const dataSource = await getDataSource(auth, req.query.name as string); if (!dataSource) { return apiError(req, res, {