Webhooks for the AT Protocol airglow.run
atproto atprotocol automation webhook
12
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: better block list warning

Hugo 75ca09ac 2c896cd2

+6 -1
+6 -1
app/routes/api/lexicons/[nsid].ts
··· 1 1 import { createRoute } from "honox/factory"; 2 2 import { getCached, setCache } from "@/lexicons/cache.js"; 3 - import { isValidNsid, resolve } from "@/lexicons/resolver.js"; 3 + import { isNsidAllowed, isValidNsid, resolve } from "@/lexicons/resolver.js"; 4 4 import { buildRecordSchema, type RecordSchema } from "@/lexicons/schema-tree.js"; 5 + import { config } from "@/config.js"; 5 6 6 7 export const GET = createRoute(async (c) => { 7 8 const nsid = c.req.param("nsid")!; 8 9 9 10 if (!isValidNsid(nsid)) { 10 11 return c.json({ error: "Invalid NSID format" }, 400); 12 + } 13 + 14 + if (!isNsidAllowed(nsid, config.nsidAllowlist, config.nsidBlocklist)) { 15 + return c.json({ error: "This lexicon is not allowed on this instance" }, 403); 11 16 } 12 17 13 18 let schema = await getCached(nsid);