Repository navigation
Adds SereneDB as a storage backend, fixes two
upserts that failed on SQL Server, and makes list_permissions report
truncation correctly. Nothing to do on upgrade for existing deployments.
Added
-
SereneDB storage backend (#792).
--database-type=serenedbwith a PostgreSQL-style--database-url(SereneDB listens on7890by default). Requires SereneDB 26.11 or later; tested against 26.11.2. Queries run through the existing SQL provider unchanged; two things differ underneath:- Schema. SereneDB reports
varchar(n)astext, so GORM's automatic migration issued anALTER COLUMN ... TYPEon every restart, which SereneDB refuses on an indexed column. The schema is instead created and upgraded by hand-written, versioned migrations, recorded in a newauthorizer_schema_migrationstable. Each version runs in one transaction with its record, so a failed migration leaves nothing behind. Instances that boot at the same time can't conflict. - Write conflicts. SereneDB aborts contended writes with SQLSTATE 40001 instead of making them wait. Single statements are retried, and the four cascade deletes (user, client, organization, webhook) are re-run as a whole. No other backend changes behaviour: the retry is enabled only for SereneDB.
SereneDB is not an OpenFGA datastore, so FGA needs an explicit
--fga-store. See Databases. - Schema. SereneDB reports
Fixed
- SQL Server: re-requesting a verification email, or enrolling an MFA method a second time, failed with a duplicate-key error (#792).
gorm.io/driver/sqlserverbuilds every upsert'sMERGEfrom the primary key and ignores the conflict columns, soAddVerificationRequest(keyed on email + identifier) andAddAuthenticator(keyed on user + method) never matched the existing row and failed on the unique index (mssql ... (2601)). Every other SQL backend replaced the row. SQL Server now builds theMERGEon the conflict columns, withWITH (HOLDLOCK)so two concurrent upserts of the same key cannot both insert. These were the two SQL Server tests known to fail; SQL Server is now part ofmake test-all-db. list_permissionsreturnedtruncated: falsewhile dropping results (#903). The embedded OpenFGA engine capped each list call at 1000 results, the same as the service's own cap. A relation with more matches came back as exactly 1000 with no signal that more existed. The engine cap is now one above the service cap, sotruncatedis set. For an RFC 8693 delegated caller, the agent's and the user's results are capped separately before they are intersected, so the response is now also marked truncated when either side hit the cap.
Changed
- Documentation: CockroachDB must be configured as
--database-type=cockroachdb. The docs previously showedpostgres, which skips CockroachDB's migration fixes. No code change.