TurboPanel Docs
Database

Identity

Who a person is to the control plane: the Better Auth-compatible user, credential, session and verification tables.

Tables in this group: account, custodian, nonce, passkey, rotation, session, totp, user, verification.

account

One sign-in credential per user and provider: the local password account (credential) or a linked GitHub/Google identity; unique on provider plus subject.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
user_iduuidyesParent user row (on delete cascade).
provider_idtextyescredential for the local password account, or the OAuth provider id github or google for a linked identity.
provider_user_idtextyesProvider-side subject: the user's own uuid on credential rows, else the GitHub/Google account id; unique together with provider_id.
passwordtextnoArgon2id PHC-format hash ($argon2id$v=19$m=N,t=N,p=N$salt$digest) on credential rows, set at sign-up, install and password reset; null on OAuth rows.

custodian

A sign-in passkey a superadmin marked to approve control plane key changes, with the frozen key servers pin; kept as history once unmarked.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
passkey_iduuidnoThe marked sign-in passkey; ON DELETE RESTRICT so it cannot be deleted while marked, and cleared when the passkey is unmarked.
pkidtextyesRotation passkey id servers pin: base64url SHA-256 of the raw credential id; unique among marked rows.
algtextyesSignature algorithm of the pinned key, ES256 or EdDSA.
public_key_rawtextyesBase64url raw public key servers verify approvals with: a 65-byte P-256 point or a 32-byte Ed25519 key, copied when marked.
rp_idtextyesWebAuthn relying party id the passkey belongs to: the primary hostname when the first passkey was marked.
labeltextnoPasskey name and owner when marked, for mail and the audit trail.
marked_keysetintegeryesKey set number of the statement that marked it.
unmarked_keysetintegernoKey set number of the statement that unmarked it; NULL while marked.
unmarked_attimestamp(3) with time zonenoWhen it was unmarked; NULL while it still approves key changes.

nonce

Daemon challenge ids and request nonces already used, kept until expires_at so a replay inside the window is refused; pruned by the sweep.

ColumnTypeRequiredDescription
valuetextyesThe used value: the nonce of a sign-in challenge or of a signed daemon request.
kindtextyesWhat the value protected: challenge (enroll or session sign-in) or request (a signed daemon request).
expires_attimestamp(3) with time zoneyesWhen the challenge or request stops being valid; the row is deleted after this.

passkey

One WebAuthn credential registered by a user (several per user allowed), unique by credential_id; inserted at registration, updated on each passkey sign-in.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
user_iduuidyesParent user row (on delete cascade).
nametextnoUser-chosen label given at registration (the device or authenticator it lives on); shown in the Security screen, never used for matching.
aaguidtextnoAuthenticator model AAGUID decoded from the attestation as a dashed lowercase UUID string; identifies the make, not the individual key.
public_keytextyesCredential public key as a JSON-serialised JWK (ES256, EdDSA or RS256) converted from the attestation's COSE key; verifies sign-in assertions.
credential_idtextyesBase64url credential id from the attestation; unique across the instance and the lookup key for passkey sign-in.
counterbigintyesAuthenticator signature counter from the last accepted assertion; a lower value rejects the sign-in (clone detection) and updates are compare-and-swap.
device_typevarchar(32)yesmultiDevice when the attestation flags the credential backup-eligible, else singleDevice; derived once at registration.
transportstextnoJSON array string of WebAuthn transports reported at registration (for example internal, usb, hybrid), or null when none were reported.
is_backed_upbooleanyesBackup-state flag from the attestation (credential synced by its provider); with device_type it drives the Synced / Multi-device / This device label.

rotation

One approved key-set statement of the control plane: the chain every server follows to a new key or passkey set, kept forever in keyset order.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
approved_by_user_iduuidnoSuperadmin who approved it; ON DELETE SET NULL so the chain outlives the account.
kindtextyesWhat it changes: rotate or revoke the key, or passkeys (mark or unmark rotation passkeys).
keysetintegeryesKey set number the statement moves servers to; unique and one above the previous statement.
statetextyeslive when served to servers; awaiting_key while a High Availability secret does not hold the new key yet.
prev_kidtextyesFingerprint of the key the statement replaces or keeps; servers apply it only when this is their pinned key.
current_kidtextyesFingerprint of the key servers pin after the statement.
bodytextyesExact statement bytes as base64url; the passkey challenge is SHA-256 of these bytes, so they are never rebuilt.
approvalstextyesJSON array of the WebAuthn assertions that approved the statement, served to servers as written.
prev_keytextnoBase64url raw public key of prev_kid, served with the signature; NULL for a revoke.
prev_key_signaturetextnoBase64url Ed25519 signature by the replaced key over tp-keyset, a newline and the statement bytes; NULL for a revoke, which two passkeys approve.
live_attimestamp(3) with time zonenoWhen the statement started being served; NULL while awaiting_key.

session

One row per signed-in session keyed by the opaque cookie token; rows are deleted (never extended) on sign-out or security changes and ignored once expired.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
user_iduuidyesParent user row (on delete cascade).
expires_attimestamp(3) with time zoneyesFixed at creation to now + 7 days (SESSION_EXPIRES_IN_MS); never extended, and lookups treat rows past it as absent.
tokentextyesOpaque server-generated value, 32 random bytes base64url-encoded; unique, carried by the session cookie and matched verbatim.
ip_addressvarchar(45)noClient address captured at sign-in as IPv4 or IPv6 text (hence 45 chars); informational only, null when unknown.
user_agenttextnoBrowser UA request header captured at sign-in; informational only, null when unknown.

totp

TOTP enrolment for a user, at most one row per user (uniq_totp_user_id); inserted or reset on enable, verified once, and deleted when two-factor is disabled.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
user_iduuidyesEnrolled user; unique, so re-enabling resets the existing row instead of adding one, and disable deletes it.
secrettextyesTOTP shared secret sealed as a tpsecret envelope with the data-encryption key; never plaintext and never returned after enrolment.
backup_codestextyesJSON array of HMAC verifier envelopes (tpotp.vN.hex) for the ten one-time backup codes, [] until verified; a used code is removed from the array.
is_verifiedbooleanyesFalse until the user proves the first six-digit code; only a verified row turns on user.is_2fa_enabled and receives backup codes.

user

One row per person who can sign in to the instance, keyed by unique email; created by password sign-up, OTP sign-in, OAuth sign-up or the install wizard.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
namevarchar(255)noOptional display name copied at creation from the OAuth profile or the OTP sign-in form (1-255 chars); absent on password sign-up and never edited later.
emailvarchar(255)yesUnique sign-in address, trimmed at write; the identity that accounts, sessions, OTP flows and invitation accepts are matched against.
roletextyesInstance role user, admin or superadmin; sign-ups get user, the install wizard mints the one superadmin, and admins bypass org grants.
time_zonevarchar(64)noIANA zone (from the supported list) in which quiet hours on the personal channels of this user are read; NULL means UTC.
is_email_verifiedbooleanyesTrue once the address is proven: set at creation by OTP or OAuth sign-up and the install wizard, or later by the verify-email link and OTP routes.
is_2fa_enabledbooleanyesDerived flag kept in step with the totp row: set true when TOTP enrolment is verified and false when two-factor is disabled.
is_disabledbooleanyesSign-in gate read by every authn path (password, OTP, passkey, OAuth) and refused with account_disabled; no control-plane route writes it today.
is_all_organizations_notifiedbooleanyesAn administrator chose to hear every organization, not only those they belong to; their own preferences still decide what arrives.

verification

Short-lived email verification tokens and OTP verifiers keyed by unique identifier; rows are upserted per purpose and deleted or left to expire on use.

ColumnTypeRequiredDescription
iduuidyesPrimary key (uuidv7(), time-ordered).
created_attimestamp(3) with time zoneyesRow creation time.
updated_attimestamp(3) with time zoneyesLast write time; the ORM sets it to now() on every update.
expires_attimestamp(3) with time zoneyesHard expiry compared at read: 24 h for verify-email links, 300 s for OTPs and their attempt counters; expired rows are ignored and replaced.
identifiervarchar(255)yesLookup key: the bare email for verify-email links, otp:TYPE:sha256(email) for an OTP and otp-attempts:TYPE:sha256(email) for its attempt counter.
valuetextyesNever the raw secret: SHA-256 hex of the link token, a keyed HMAC envelope tpotp.vN.hex for an OTP, or the decimal failed-attempt count.
Edit on GitHub

Last updated on

On this page