Identity plugin · listing tai42/accounts-postgresInstall
Permissions
Provides
accounts-postgres
Identity — Postgres-backed accounts/identity provider — owns user accounts, password login, sessions, and invites.
login
Router — The public /api/login/* routes.
users
Router — The authed /api/auth/users* user-administration routes.
Provides human logins on Postgres — an email and password, a session, and a role —
and contributes the Studio’s Users screen. The account model itself stays central;
see Accounts. This page wires the provider and
its two routers.
accounts-postgres
The identity provider. Mount it with both routers and register it as an auth provider:manifest.yml
Connect the database
The provider carries no connection of its own. It binds to a named database throughTAI_DB_BINDING_TAI42_ACCOUNTS_POSTGRES (default default) and uses that database’s
connection, keeping its own tables inside it. A single-database deployment leaves the
binding unset and configures TAI_DATABASE_DEFAULT_PG_*; give accounts its own
database by binding it to another declared name and configuring that one:
TAI_DATABASE_<NAME>_PG_*), not a variable of this package’s own. Sessions live in
Postgres; login backoff and the bootstrap token live in Redis, which arrives from the
access-control configuration.
Run the migrations
The plugin ships amigrations/ folder and declares it in its descriptor, so the
shared runner discovers it as the tai42-accounts-postgres component and applies it
alongside the core chain:
tai db migrate.
Tune sessions and login limits
login
The public/api/login/* routes. The first owner is created through POST /api/login/bootstrap, and the Studio’s login screen offers it while no user exists.
The call is gated by a bootstrap token:
admin role and
refuses with a conflict once any user exists. Passwords are at least ten characters.
users
The authed/api/auth/users* user-administration routes. There is no outbound email —
creating a user returns a one-time invite link you deliver yourself. role names an
existing access-control role template; an unknown name is rejected and no user is
created. The response carries an invite token and a /login?invite=... path relative
to your origin; the invitee sets a password through POST /api/login/invite/accept,
which consumes the token and mints a session in one step. Re-issue an invite with
POST /api/auth/users/{user_id}/invite — it refuses once that user has a password.
The Studio’s Users screen drives the same routes, and the last enabled admin cannot be
demoted, disabled, or deleted.
See also
- Accounts — the model behind these routes.
- Access control — the policy every identity resolves to.

