One addition to the custom-fetch suggestion: I would test the “server committed, response lost” case before enabling retries across all Supabase operations. Apple’s QA1941 explains why -1005 alone cannot tell you whether the server applied a request: https://developer.apple.com/library/archive/qa/qa1941/_index.html For a write RPC, a useful staging test would be: 1. Send the operation with a client-generated request ID. 2. Let the server commit the operation, then deliberately discard its response in the test harness. 3. Retry with the same request ID. 4. Verify that the business operation happened once and the client can recover the original result. 5. Submit two concurrent requests with that same ID and verify the same outcome. For deduplication, the request-ID check and database mutation need to be coordinated atomically. A separate “check whether ID exists, then perform operation” sequence can race. Scope the ID to the authenticated actor and operation, and reject reuse with a different payload. I would make write retries opt-in per operation rather than infer that every POST is replayable. Auth, storage uploads, and arbitrary Edge Functions have different semantics. A fetch wrapper also needs a replayable request body and should preserve cancellation. RFC 9110 describes the relevant retry boundary: https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.2 This does not establish the cause of your HTTP/3 failure. It would strengthen the client workaround while the networking issue is investigated. Does your current retry testing include a committed write whose response is lost, or only requests that fail before reaching the handler?
Thanks for documenting the results and verification limits. I would record the two remaining requirements separately. **1. Strict catalog-only SQL access** Under your stated constraints—arbitrary direct SQL, existing PUBLIC grants left intact, and no authority to change the relevant managed-object privileges—the role settings you have tested cannot enforce the full requirement. PostgreSQL privileges are additive. A role retains a privilege available through PUBLIC even when its own direct grant is revoked: https://www.postgresql.org/docs/17/sql-revoke.html `default_transaction_read_only` also does not establish an approved-query boundary. PostgreSQL describes it as the default transaction mode, and read-only transactions are not a general prohibition on every possible side effect: https://www.postgresql.org/docs/17/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-READ-ONLY I would therefore record the original direct-SQL requirement as **not satisfied by the evaluated controls**. That is narrower than claiming that every possible hosted Supabase architecture is unsupported. A reviewed metadata export or a service executing only fixed, approved catalog queries is a reasonable replacement architecture. Explicitly approve that change in requirements. The service should accept validated parameters rather than SQL fragments, use a minimally privileged backend role, and expose only the reviewed metadata. A finite review of 25 routines does not establish a guarantee about all callable routines or future defaults. **2. Retirement and Supavisor invalidation** Your evidence establishes the recorded role settings, the rejected direct connection attempt, and zero observed inspector database sessions at the inspection time. It does not independently establish NOLOGIN enforcement or absence of pooler frontend clients. I would preserve the retired state. Re-enabling the role would not reconstruct whether an old client survived the original retirement. For the remaining evidence, ask Supabase whether they can confirm, for this project and role: - Whether any frontend clients or pooled backends remain associated with it. - Whether cached authentication state exists and how role retirement affects it. - Whether a supported, role-scoped invalidation operation is available without affecting unrelated clients. I have not found a documented customer-facing procedure that proves those hosted guarantees from PostgreSQL metadata alone. Until Supabase confirms them, I would leave that part explicitly unverified rather than infer it from `pg_stat_activity`. No further database changes are needed to document these conclusions.
For B13, I would make the verification distinguish a new client connection to Supavisor from a new PostgreSQL backend connection. A pooled backend can outlive the client that originally caused it to be opened. These read-only checks could supplement your existing metadata collection: ```sql select rolname, rolcanlogin, rolinherit, rolsuper, rolbypassrls, rolconnlimit from pg_roles where rolname = 'sf_g2_inspector'; select pid, usename, application_name, backend_start, state, xact_start from pg_stat_activity where usename = 'sf_g2_inspector'; ``` The second query identifies database sessions; it does not enumerate Supavisor frontend clients. Some activity details also depend on the observer's privileges. After a separately authorised `NOLOGIN` change, I would record three outcomes independently: 1. A fresh direct PostgreSQL connection using the previously working inspector credentials. 2. A fresh session-pooler client connection using those credentials. 3. A connection that was already open before the change. For any successful connection, this metadata-only query helps establish the effective identities and backend: ```sql select session_user, current_user, pg_backend_pid(); ``` Compare its PID with `backend_start` in `pg_stat_activity`; a newly opened pooler client is not necessarily using a newly created database backend. PostgreSQL documents `LOGIN` as controlling whether a role can be the initial identity of a database connection: https://www.postgresql.org/docs/17/role-attributes.html Backend timing and activity fields are documented here: https://www.postgresql.org/docs/17/monitoring-stats.html This test matrix would distinguish PostgreSQL login denial, existing-session survival, and pooler behaviour without querying application data. It does not establish hosted Supavisor's authentication-cache or invalidation guarantees; that still needs confirmation from Supabase. Given your constraint that no database changes are authorised, I would keep the current work to the read-only checks. Also, a zero-row database-session result alone would not prove that no pooler clients remain connected.
To build on the slug/project checks above, I would compare the previously successful dashboard invocation with one failing external request before redeploying again. Supabase distinguishes **Invocations** (request/response information) from **Logs** (execution events and custom messages): https://supabase.com/docs/guides/functions/logging For one request through each route, record: - UTC timestamp and HTTP method. - The project reference and exact function slug. - Response status/body. - Whether a corresponding invocation or execution log appears. Keep credentials and request payloads out of anything shared here. The important distinction is whether the dashboard test still succeeds **now**. A historical success proves the function ran at that time, but does not establish that the current public URL resolves to the same deployment. If a current dashboard test succeeds while the external request returns `NOT_FOUND`, compare their target project and slug first. If they match, those paired timestamps give support a much stronger routing/deployment case to investigate. If both now fail, include the current deployment status/version and the function-list output alongside the failing timestamp. A listed deployment alone does not prove the invocation path is healthy. The [[status-code documentation](https://supabase.com/docs/guides/functions/status-codes)] associates 404 with a missing function or incorrect URL. An absent execution log is useful supporting evidence, but I would not treat that alone as proof that the handler never ran. Could you confirm whether the dashboard invocation still succeeds, and share the redacted results of that comparison? I have not invoked your endpoint or inspected your project.
The helper proposed above uses a documented PostgREST interface: `request.jwt.claims` is a transaction-scoped setting available through `current_setting()`. See the [[PostgREST transaction documentation source](https://github.com/PostgREST/postgrest/blob/main/docs/references/transactions.rst)]. I would distinguish the actor identity from the database execution identity when validating this approach: - The JWT `sub` identifies the authenticated actor. - Inside a `SECURITY DEFINER` RPC, database privileges come from the function owner. Policies restricted to `authenticated` therefore should not be assumed to cover a custom execution role automatically. Your non-owning, `NOBYPASSRLS` execution-role design is relevant here: verify that the applicable policies cover that role and that the actual RPC owner has only the intended privileges. PostgreSQL documents the owner-versus-caller behaviour under [[CREATE FUNCTION](https://www.postgresql.org/docs/17/sql-createfunction.html)]. For a hosted staging test, I would call the real RPC through the Data API with two different users and verify: 1. User A can perform the permitted operation on A’s rows. 2. A cannot read or modify B’s rows, including changing ownership to B. 3. B receives the corresponding isolated behaviour. 4. An unauthenticated request cannot perform the privileged operation. 5. Calls made sequentially through pooled connections do not retain the previous actor’s identity. Keep the claims helper as `SECURITY INVOKER`; extracting the setting does not require elevated privileges. For the privileged RPC itself, pin `search_path`, schema-qualify referenced objects, and restrict `EXECUTE` to the intended callers. Supabase’s [[RLS guide](https://supabase.com/docs/guides/database/postgres/row-level-security)] covers these function and policy considerations. Also check that no callable RPC lets clients overwrite request claims or execute arbitrary SQL. The helper reads claims established by the request-processing path; it does not independently verify a JWT. This supports the technical basis of the alternative, but I have not tested your hosted configuration. Supabase would still need to confirm the supported provisioning route or any platform-specific restrictions. Could you share the redacted RPC definition, owner attributes, and policies so the effective privilege path can be checked?
I found a source-level detail relevant to hostname verification, although it does not establish the managed service’s deployed configuration. The [[SSL enforcement documentation](https://supabase.com/docs/guides/platform/ssl-enforcement)](https://supabase.com/docs/guides/platform/ssl-enforcement) says enforcement covers both client-to-pooler and pooler-to-Postgres connections. Encryption and upstream server-identity verification still need to be considered separately. In [[Supavisor’s ](https://github.com/supabase/supavisor/blob/639ea814de61c3e1bf746c20175f0bf4d7bf202f/lib/supavisor/db_handler.ex#L835)`[ssl_connect](https://github.com/supabase/supavisor/blob/639ea814de61c3e1bf746c20175f0bf4d7bf202f/lib/supavisor/db_handler.ex#L835)`[ implementation at commit ](https://github.com/supabase/supavisor/blob/639ea814de61c3e1bf746c20175f0bf4d7bf202f/lib/supavisor/db_handler.ex#L835)`[639ea814](https://github.com/supabase/supavisor/blob/639ea814de61c3e1bf746c20175f0bf4d7bf202f/lib/supavisor/db_handler.ex#L835)`](https://github.com/supabase/supavisor/blob/639ea814de61c3e1bf746c20175f0bf4d7bf202f/lib/supavisor/db_handler.ex#L835), the `upstream_verify = :peer` branch configures CA verification and SNI, but also includes: `customize_hostname_check: [{:match_fun, fn _, _ -> true end}]` The `:none`/`nil` branch uses `:verify_none`. I therefore would not treat `upstream_verify = :peer` or SNI alone as proof of strict hostname matching. That custom matcher is a specific point for maintainers to clarify, including whether this revision and configuration apply to hosted shared Supavisor. Likewise, an application connecting to the pooler with `sslmode=verify-full` verifies the server terminating that connection. It does not configure or attest to the pooler’s separate upstream connection. PostgreSQL explains the client-side verification modes (https://www.postgresql.org/docs/current/libpq-ssl.html)](https://www.postgresql.org/docs/current/libpq-ssl.html). The remaining hosted-service questions seem to be: 1. Which upstream certificate-chain and hostname checks are guaranteed with enforcement enabled? 2. Does hosted Supavisor use the hostname-matching behaviour above? 3. On upstream verification failure, does reconnection always preserve the same verification requirements? The documentation also says changing enforcement restarts the database, so interrupted connections should be expected. It does not establish that existing pooled sessions or transactions survive. This is based on public documentation and source inspection, rather than a hosted-infrastructure test. A maintainer’s confirmation of the deployed behaviour would still be needed to answer your guarantee question fully.