Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Add TODOs for basic security
Tomas Valenta3838402cc8a3
diff --git a/api-service/app.py b/api-service/app.pyindex f0064a71f..ad674b47e 100644--- a/api-service/app.py+++ b/api-service/app.py@@ -37,6 +37,7 @@ async def health():return "OK"+# TODO: SECURITY - Check if user invoking this request has permission to generate and deploy to this project@app.route("/generate", methods=["POST"])async def generate():body = await request.jsondiff --git a/components/Editor/index.tsx b/components/Editor/index.tsxindex 5bc55d73d..70762cf5d 100644--- a/components/Editor/index.tsx+++ b/components/Editor/index.tsx@@ -16,7 +16,6 @@ import RightSidebar from './RightSidebar'import Routes from './Routes'import Link from 'next/link'-// TODO: Prod API hostconst apiHost = process.env.NODE_ENV === 'development'? 'http://0.0.0.0:5000': 'https://ai-api-service-7d2cl2hooq-uc.a.run.app'diff --git a/hooks/useLatestDeployment.tsx b/hooks/useLatestDeployment.tsxindex f7752fb90..a8257e7e8 100644--- a/hooks/useLatestDeployment.tsx+++ b/hooks/useLatestDeployment.tsx@@ -16,6 +16,7 @@ export function useLatestDeployment(project: projects, route?: Route) {if (!route?.id) return(async function () {+ // TODO: SECURITY - Enable row security for all tables and secure access to deployments.const deployment = await client.from(deploymentsTable).select('*')@@ -30,9 +31,14 @@ export function useLatestDeployment(project: projects, route?: Route) {}())}, [client, project.id, route?.id])+ // Sometimes a large field from realtime server can be missing because of the internal POSTGRES/TOAST workings.+ // We changed the table replication to full with `ALTER TABLE events REPLICA IDENTITY FULL;` to fix this.+ // https://github.com/supabase/realtime/issues/223 mentioned that we may need to check the `old_record` field of the payload for the actual value,+ // but so far it seems we don't have to.useEffect(function subscribe() {if (!route?.id) return+ // TODO: SECURITY - Enable row security for all tables and configure access to deployments.const insertSub = client.channel('any').on('postgres_changes',{@@ -47,10 +53,7 @@ export function useLatestDeployment(project: projects, route?: Route) {}).subscribe()- // Sometimes a large field from realtime server can be missing because of the internal POSTGRES/TOAST workings.- // We changed the table replication to full with `ALTER TABLE events REPLICA IDENTITY FULL;` to fix this.- // https://github.com/supabase/realtime/issues/223 mentioned that we may need to check the `old_record` field of the payload for the actual value,- // but so far it seems we don't have to.+ // TODO: SECURITY - Enable row security for all tables and configure access to deployments.const updateSub = client.channel('any').on('postgres_changes',{diff --git a/state/store.ts b/state/store.tsindex ef69b931e..694443a92 100644--- a/state/store.ts+++ b/state/store.ts@@ -152,12 +152,14 @@ export function createStore(project: projects, client?: SupabaseClient<Database>return null},removeItem: async () => {+ // TODO: SECURITY - Enable row security for all tables and configure access to projects.const res = await client.from(projectsTable).update({ data: {} }).eq('id', project.id).single()if (res.error) {throw res.error}},setItem: async (name, value) => {+ // TODO: SECURITY - Enable row security for all tables and configure access to projects.const res = await client.from(projectsTable).update({ data: value as any }).eq('id', project.id)if (res.error) {throw res.error