feat(guardrails): secure-by-default rule and /guardrails scanner

Always-on rules/secure-by-default.md: hosting, a11y, Supabase RLS,
SMS/email consent, cloud functions, API hygiene incl. password storage.
Stdlib scanner (FAIL/WARN/MANUAL) + skill, 89-check suite, auditor
gate wiring, profiles, routing row (plus Explore rows confirmed
through the router dialog).
This commit is contained in:
bchanot committed 2026-10-18 18:10:20 +02:00
1 parent c5fad5ee8f
commit 558c49e1a1
45 files changed
+2473 -5

No files matched your search

@@ -0,0 +1,22 @@
import { Resend } from "npm:resend";
const resend = new Resend(Deno.env.get("RESEND_API_KEY"));
Deno.serve(async (request) => {
const user = await getUser(request);
const contact = await loadContact(user.id);
if (!contact.consent_at || contact.unsubscribed_at) {
return new Response("skipped");
}
const link = unsubscribeUrl(contact.id);
await resend.emails.send({
to: contact.email,
subject: "News",
html: `<p>Hello</p><a href="${link}">Unsubscribe</a>`,
headers: {
"List-Unsubscribe": `<${link}>`,
"List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
},
});
return new Response("sent");
});