memesearch
AI-Validated SQL Endpoint

AI-Validated SQL Endpoint

Download Find similar pictures
Text on the meme
Shayan @ImSh4yy X.com PRO TIP: REST is overengineering. Just expose one endpoint called /api that accepts SQL queries directly. Based on security concerns, I've added AI validation to the snippet. import { Hono } from 'hono' import { cors } from 'hono/cors' import { generateObject } from 'ai' import { openai } from '@ai-sdk/openai' import { z } from 'zod' const app = new Hono() const pool = new Pool({ connectionString: 'postgresql://daddy:itsIns1de@216.52.128.47:5432/anal' }) app.post('/api', async (c) => { const { sql } = await c.req.json() const { object } = await generateObject({ model: openai('gpt-5-pro'), schema: z.object({ isSafe: z.boolean() }), prompt: `Analyze this SQL query for security risks: ${sql}` }) if (!object.isSafe) { return c.json({ error: 'Query not allowed' }, 403) } const result = await pool.query(sql) return c.json(result.rows) }) export default app
What it means

Скриншот поста в X с якобы «безопасным» советом напрямую открыть API-эндпоинт для SQL-запросов. Шутка в том, что автор добавляет поверх крайне опасной архитектуры лишь поверхностную AI-проверку безопасности, что подчёркивает абсурдность решения.

Objects
Tags
Source
Type
image
Size
509×800 · 55.3 KiB
Mood
саркастичный абсурд
Language
en
Added

Similar memes