From 0fa4597e6b4c098cb9c89e50ef3197e9be8ecbe8 Mon Sep 17 00:00:00 2001
From: Ben Davis <45952064+bmdavis419@users.noreply.github.com>
Date: Wed, 9 Sep 2026 04:11:55 -0700
Subject: [PATCH 1/7] FEATURE: Add org, user, and membership tables with row
level security
Migration 0003 introduces orgs, users, memberships, and org_usage, adds
org_id to every tenant table, scopes the tag uniqueness to the org, and
enables forced row level security keyed on the transaction-local
app.current_org setting with an adrive_app role for production. The
PgSql layer pins CurrentOrg after BEGIN so the policies apply inside
every transaction; plain statements rely on their WHERE clause. Until
WorkOS sign-in lands, the passcode session upserts a bootstrap tenant
and the request layer acts as it. Every INSERT now sets org_id, and the
Postgres-backed tests upsert a shared test org first.
Co-Authored-By: Claude Fable 5.1
- Use this on plain-HTTP origins where the secure session cookie cannot be
- set.
-
- {authError}
+ {session.error}
- Sign out every browser and cancel pending device approvals. API keys
- keep working — revoke them above if one may have leaked. Changing the
- PASSCODE secret also signs out every browser on the next maintenance
- run.
-
Sign in to your drive
-
-
- Sign in with an API key
-
- Sessions
-