security:authorization:store
Differences
This shows you the differences between two versions of the page.
| security:authorization:store [2026/07/09 03:38] โ created phong2018 | security:authorization:store [2026/07/09 03:39] (current) โ removed phong2018 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== OpenFGA Store ====== | ||
| - | A **Store** is the top-level container in OpenFGA. Think of it as one project or | ||
| - | one workspace. Everything for one authorization setup lives inside it, and | ||
| - | nothing leaks out to other stores. | ||
| - | |||
| - | ===== Why stores exist ===== | ||
| - | |||
| - | You need a boundary. Without one, all your rules and data would sit in a single | ||
| - | shared pile. Stores give you clean separation. | ||
| - | |||
| - | Each store is fully isolated. A Check inside store A can never see tuples that | ||
| - | live in store B. This lets you keep different apps, or different environments | ||
| - | (dev, staging, production), | ||
| - | |||
| - | ===== What is inside a store ===== | ||
| - | |||
| - | A store holds three things. | ||
| - | |||
| - | ^ Part ^ What it is ^ | ||
| - | | **Authorization models** | The rules ('' | ||
| - | | **Relationship tuples** | The data. Small facts like '' | ||
| - | | **Assertions** | Saved tests: example questions with expected answers. | | ||
| - | |||
| - | ==== Authorization models ==== | ||
| - | |||
| - | The rules. A store can hold //many versions// of the model over time. Each | ||
| - | version gets its own model ID. When you change the rules, you write a new | ||
| - | version; the old one stays. Your tuples keep working, and you can point a Check | ||
| - | at a specific model version if you want. | ||
| - | |||
| - | ==== Relationship tuples ==== | ||
| - | |||
| - | The data. All the small facts like: | ||
| - | |||
| - | < | ||
| - | (account: | ||
| - | </ | ||
| - | |||
| - | This is usually the biggest part, sometimes millions of rows. | ||
| - | |||
| - | ==== Assertions ==== | ||
| - | |||
| - | Saved tests. You write example questions with expected answers, like " | ||
| - | should be allowed to approve โ true". They let you check that your model still | ||
| - | behaves correctly after a change. | ||
| - | |||
| - | ===== How you use a store ===== | ||
| - | |||
| - | Every store has a unique **store ID** (a long string). This ID is the key to | ||
| - | everything. | ||
| - | |||
| - | - **Create** a store once. OpenFGA gives you back its ID. | ||
| - | - **Scope** every API call to that ID (write a model, add tuples, run a Check). | ||
| - | - **Isolate** by design. One store' | ||
| - | |||
| - | ===== How many stores should you have ===== | ||
| - | |||
| - | This is a design choice, not a fixed rule. Common patterns: | ||
| - | |||
| - | * **One store per environment**: | ||
| - | * **One store per application**: | ||
| - | * **One store per tenant**: strong isolation, but more stores to manage. \\ Many teams instead keep all tenants in one store and separate them using object IDs (like '' | ||
| - | |||
| - | <note tip> | ||
| - | A good default: start with **one store per environment**, | ||
| - | when you have a real reason. | ||
| - | </ | ||
| - | |||
| - | ===== See also ===== | ||
| - | |||
| - | * [[https:// | ||
| - | * [[https:// | ||
security/authorization/store.1783568284.txt.gz ยท Last modified: by phong2018
