# Supabase

Describes Keryn 0.5.2 and keryn-rules 0.8.0.

> Write findings and verdicts to a Postgres table through Supabase: endpoint, key, and what is sent.

Source: https://keryn.dev/docs/reference/connectors/supabase/

Findings and verdicts go into a table you create with the SQL the app shows under the connector. The table has row level security on and grants nothing to `anon`, because a project's anon key is public and findings describe weaknesses. The `service_role` key bypasses row level security, so use it only in a tab you trust, and prefer not to remember it.

## Endpoint and protocol

| Fact | Value |
|---|---|
| Endpoint | `<Project URL>/rest/v1/<Table>` (PostgREST) |
| Key | the *service_role key* in an `apikey` header; a legacy JWT-form key is also sent as the bearer |
| Writes | an upsert on `id`, 500 rows per request, so sending the same scan again replaces its rows |
| Page can reach it | yes for `https://*.supabase.co`; a custom or self-hosted domain needs a page whose policy lists it |

## Fields

| Field | Kind | Default | Notes |
|---|---|---|---|
| Project URL | address |  | for example `https://<ref>.supabase.co` |
| service_role key | secret |  | Writes bypass row level security; the table grants nothing to anon. Kept in this tab unless remembered. |
| Table | text | `keryn_findings` |  |

How keys and values are stored is on the [connectors overview](https://keryn.dev/docs/reference/connectors/#storage).

## What leaves your machine

> **Leaves your machine, only when you press Send:** The rows go to the project URL you entered, and to nowhere else. No code excerpts are included.
>
> - One row per finding: scan_id, subject, revision, rule_id, severity, message, path, line, col, end_line, end_col, engine, confidence, proof_level, proof_rung, finding_class, cwe, owasp, fingerprint, triage_verdict, triage_confidence, triage_grounds, triage_fix.
> - Inventory matches are not findings; they are not written as rows.
> - The service_role key, in the request headers.

**Test** reads one row id from the table, which proves the address, the key and that the table exists.

*Generated from the product's connector catalog (monorepo 27434c1bb57f) by `tools/extract-product-facts.mjs`.*
