Rezin Core Rezin Core
Docs

Getting started

How Rezin Core is organised

Five ideas explain almost everything else in these pages.

Workspace

A workspace is the account that owns projects: your company, your team, or you. Signing up gives you one of your own. Its members are console accounts with one of three roles: owner, developer or read-only. See Team and roles.

Project

A project is one application's backend. It has its own section of the database, its own users, files, keys, secrets, webhooks and logs. Nothing in one project can reach another: each project's database roles are confined to that project's section. A workspace can hold 5 live projects.

Organizations

An organization is one of your application's own customers or tenants: one company, one team, one household, whatever your application serves many of.

  • Every user of your application belongs to exactly one organization.
  • Every request acts for one organization. A signed-in user acts for theirs.
  • A table that has an organization_id column gets it filled in by the API with the caller's organization, and your policies compare it with core.app_org().
  • Files belong to an organization too.

A new project has one organization. If your application has no notion of tenants, keep that one and put everyone in it. If it does, add organizations on the project's Sign-in page; each is separate from the others at the database.

Users

A user is a person who signs in to your application. Users are separate from console accounts: a user cannot open the console, and a console account is not a user of your application.

A user signs in through your project's key and gets a token. The token identifies them on every request until it ends: after 15 minutes without use, after 12 hours in any case, on sign-out, or when the account is disabled. A project can make those two times shorter, never longer.

Keys and who a request acts for

The request carriesIt acts for
A publishable key and a user's tokenThat user, in their organization
A secret key and a user's tokenThat user, in their organization
A secret key, no token, and x-organization-id: <id>That organization, with no person signed in (core.app_user() is null)
A publishable key and no tokenNobody. Only sign-up and sign-in work.

In every case the database checks your policies. A secret key does not skip row-level security; it only lets your own server act for an organization without a user.

Database roles

Each project has two database roles, and you will see both mentioned:

  • The application's role. Every API request runs as this role. Row-level security applies to it. What it may do to each table is set under "The application may" on the Access rules page.
  • The project's own confined role. The SQL workspace, the table editor, the command-line tool and the connector run as this role. It reaches the project's section of the database and nothing else on the server. It sees all of the project's rows regardless of policies, because the people who may use it are the project's own members.

So: what you see in the SQL workspace is not what the application gets. Use View as on the Access rules page to see what a user is given.

The two kinds of sign-in, side by side

Console accountUser of your application
WhoYou and your teamThe people who use what you build
Signs in atconsole.rezincore.comYour application, through api.rezincore.com
Made bySign-up with an invite code, or added to a workspace by an ownerSelf sign-up (if the project allows it) or first sign-in with Google or GitHub
Identified byA console sessionA token sent as Authorization: Bearer …
ToolsPersonal access tokens for the command line and the connectorProject keys

This page as Markdown · llms.txt · Rezin Core is in development and available by invitation.