Skip to content

Commit 74afce8

Browse files
authored
Merge branch 'main' into fix/docs/reader-relation-mismatch
2 parents 6275cad + 8a92dc8 commit 74afce8

File tree

12 files changed

+61
-95
lines changed

12 files changed

+61
-95
lines changed

.github/workflows/checks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
steps:
5353
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
54-
- uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368
54+
- uses: tcort/github-action-markdown-link-check@a800ad5f1c35bf61987946fd31c15726a1c9f2ba # v1.1.0
5555
with:
5656
file-extension: '.md'
5757
use-quiet-mode: 'yes'
@@ -61,7 +61,7 @@ jobs:
6161
runs-on: ubuntu-latest
6262
steps:
6363
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
64-
- uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368
64+
- uses: tcort/github-action-markdown-link-check@a800ad5f1c35bf61987946fd31c15726a1c9f2ba # v1.1.0
6565
with:
6666
file-extension: '.mdx'
6767
use-quiet-mode: 'yes'

docs/content/best-practices/adoption-patterns.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ On the other hand, adding another service increases latency, adds additional com
159159

160160
## Shadowing the <ProductName format={ProductNameFormat.ShortForm}/> API
161161

162-
When migrating from an existing authorization system to <ProductName format={ProductNameFormat.ShortForm}/>, it's recommended to first run both systems in parallel, with <ProductName format={ProductNameFormat.ShortForm}/> in "shadow mode". This means that while the existing system continues to make the actual authorization decisions, you also make calls to <ProductName format={ProductNameFormat.ShortForm}/> asynchornously and compare the results.
162+
When migrating from an existing authorization system to <ProductName format={ProductNameFormat.ShortForm}/>, it's recommended to first run both systems in parallel, with <ProductName format={ProductNameFormat.ShortForm}/> in "shadow mode". This means that while the existing system continues to make the actual authorization decisions, you also make calls to <ProductName format={ProductNameFormat.ShortForm}/> asynchronously and compare the results.
163163

164164
This approach has several benefits:
165165

docs/content/configuration-language.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Please familiarize yourself with basic <ProductConcept /> and [How to get starte
3434
Below is a sample authorization model. The next sections discuss the basics of the <ProductName format={ProductNameFormat.ShortForm}/> configuration language.
3535

3636
<AuthzModelSnippetViewer
37+
syntaxesToShow={[SyntaxFormat.Dsl, SyntaxFormat.Json]}
3738
configuration={{
3839
schema_version: '1.1',
3940
type_definitions: [
@@ -978,7 +979,6 @@ relation {
978979
In the <ProductName format={ProductNameFormat.ShortForm}/> DSL, it becomes:
979980

980981
<AuthzModelSnippetViewer
981-
onlyShow={SyntaxFormat.Friendly2}
982982
configuration={{
983983
schema_version: '1.1',
984984
type_definitions: [
@@ -1042,7 +1042,7 @@ In the <ProductName format={ProductNameFormat.ShortForm}/> DSL, it becomes:
10421042
In the <ProductName format={ProductNameFormat.ShortForm}/> JSON, it becomes:
10431043

10441044
<AuthzModelSnippetViewer
1045-
onlyShow={SyntaxFormat.Api}
1045+
syntaxesToShow={[SyntaxFormat.Json]}
10461046
configuration={{
10471047
schema_version: '1.1',
10481048
type_definitions: [

docs/content/getting-started/setup-openfga/docker-setup.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ docker network create openfga
4242
You can then start Postgres in the network you created above:
4343

4444
```shell
45-
docker run -d --name postgres --network=openfga -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password postgres:14
45+
docker run -d --name postgres --network=openfga -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password postgres:17
4646
```
4747

4848
You should now have Postgres running in a container in the `openfga` network. However, it will not have the tables required for running OpenFGA. You can use the `migrate` command to create the tables. Using the OpenFGA container, this will look like:
@@ -74,7 +74,7 @@ networks:
7474

7575
services:
7676
postgres:
77-
image: postgres:14
77+
image: postgres:17
7878
container_name: postgres
7979
networks:
8080
- openfga

docs/content/interacting/relationship-queries.mdx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,24 @@ For example, you can call Batch Check to determine whether `bob` has `can_view_n
181181

182182
The <ProductName format={ProductNameFormat.ShortForm}/> API will return `true` depending on the level of access assigned to that user and the implied relationships inherited in the authorization model.
183183

184-
185184
### Caveats and when not to use it
186185

187186
If you are making less than 10 checks, it may be faster to call the [Check API](/api/service#Relationship%20Queries/Check) in parallel instead of Batch Check.
188187

189-
The new BatchCheck endpoint is currently supported by the JS SDK (>=[v0.8.0](https://github.com/openfga/js-sdk/releases/tag/v0.8.0) and the Python SDK (>=[v0.9.0](https://github.com/openfga/python-sdk/releases/tag/v0.9.0)). Support in the other SDKs is being worked on.
188+
:::note
189+
The BatchCheck endpoint is currently supported by the following SDKs:
190+
- Go SDK ([>=0.7.0](https://github.com/openfga/go-sdk/releases/tag/v0.7.0))
191+
- JavaScript SDK ([>=v0.8.0](https://github.com/openfga/js-sdk/releases/tag/v0.8.0))
192+
- Python SDK ([>=v0.9.0](https://github.com/openfga/python-sdk/releases/tag/v0.9.0))
193+
- Java SDK ([>=0.8.1](https://github.com/openfga/java-sdk/releases/tag/v0.8.1))
194+
- Support for .NET is in progress and coming soon.
195+
196+
In SDKs that support the `BatchCheck` endpoint (server-side batch checks), the previous `BatchCheck` method has been renamed to `ClientBatchCheck`. `ClientBatchCheck` performs client-side batch checks by making multiple check requests with limited parallelization.
197+
198+
The .NET SDK does not yet support the `BatchCheck` endpoint (coming soon). Until then, the `BatchCheck` method maintains its current behavior, performing client-side batch checks equivalent to `ClientBatchCheck` in other SDKs.
199+
200+
Refer to the README for each SDK for more information. Refer to the release notes of the relevant SDK version for more information on how to migrate from client-side to the server-side `BatchCheck`.
201+
:::
190202

191203
## Read
192204

docs/content/modeling/advanced/slack.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ Upcoming tutorials will dive deeper into <ProductName format={ProductNameFormat.
901901
<Playground title="Slack" preset="slack" example="Slack" store="slack" />
902902

903903
If you are interested in learning more about Authorization and Role Management at Slack, check out the Auth0 Fine-Grained Authorization (FGA) team's chat with the Slack engineering team.
904-
904+
<!-- markdown-link-check-disable -->
905905
<figure className="video_container">
906906
<iframe
907907
style={{ marginTop: 36, borderRadius: 8 }}
@@ -913,6 +913,7 @@ If you are interested in learning more about Authorization and Role Management a
913913
allowFullScreen
914914
/>
915915
</figure>
916+
<!-- markdown-link-check-enable -->
916917

917918
### Exercises for you
918919

docs/content/modeling/getting-started.mdx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ We will also need to add "User" to the list as it establishes the type of user w
331331
Now that we have a list of object types we can start defining them using the <UpdateProductNameInLinks link="../configuration-language" name="{ProductName} Configuration Language" />:
332332

333333
<AuthzModelSnippetViewer
334-
onlyShow={SyntaxFormat.Friendly2}
335334
configuration={{
336335
schema_version: '1.1',
337336
type_definitions: [
@@ -554,7 +553,6 @@ Relation names in <ProductName format={ProductNameFormat.ShortForm}/> are arbitr
554553
Remember _"How a user is added as a member to an organization is beyond the scope of this feature."_ For the purposes of this model the relation definition should be:
555554

556555
<AuthzModelSnippetViewer
557-
onlyShow={SyntaxFormat.Friendly2}
558556
configuration={{
559557
schema_version: '1.1',
560558
type_definitions: [
@@ -611,7 +609,6 @@ If you want to learn more, you can read further about this in [Modeling User Gro
611609
The complete <ProductConcept section="what-is-a-type-definition" linkName="type definition" /> for the **organization** type is:
612610

613611
<AuthzModelSnippetViewer
614-
onlyShow={SyntaxFormat.Friendly2}
615612
configuration={{
616613
schema_version: '1.1',
617614
type_definitions: [
@@ -659,7 +656,6 @@ When a document is created, a relationship tuple will be stored in <ProductName
659656
The relation definition then should be:
660657

661658
<AuthzModelSnippetViewer
662-
onlyShow={SyntaxFormat.Friendly2}
663659
configuration={{
664660
schema_version: '1.1',
665661
type_definitions: [
@@ -694,7 +690,6 @@ When a user shares a document with another user or set of users as editor, a rel
694690
The relation definition then should be:
695691

696692
<AuthzModelSnippetViewer
697-
onlyShow={SyntaxFormat.Friendly2}
698693
configuration={{
699694
schema_version: '1.1',
700695
type_definitions: [
@@ -739,7 +734,6 @@ You can learn more about this in [Modeling User Groups](./user-groups.mdx).
739734
The viewer relation is similar to the document's [editor relation](#relation-editor). It will be defined like this:
740735

741736
<AuthzModelSnippetViewer
742-
onlyShow={SyntaxFormat.Friendly2}
743737
configuration={{
744738
schema_version: '1.1',
745739
type_definitions: [
@@ -772,7 +766,6 @@ This relation is different from the others we have seen so far, as it is a relat
772766
When a document is created a relationship tuple will be stored in <ProductName format={ProductNameFormat.ShortForm}/> to represent this relationship between parent and document. The relation definition then should be:
773767

774768
<AuthzModelSnippetViewer
775-
onlyShow={SyntaxFormat.Friendly2}
776769
configuration={
777770
{
778771
type: 'document',
@@ -811,7 +804,6 @@ _A user can share a document with another user or an organization as either edit
811804
We can achieve that with the following definition using <UpdateProductNameInLinks link="../configuration-language" name="{ProductName} Configuration Language" />:
812805

813806
<AuthzModelSnippetViewer
814-
onlyShow={SyntaxFormat.Friendly2}
815807
skipVersion={true}
816808
configuration={
817809
{
@@ -870,7 +862,6 @@ _A user can view a document if they are an owner, viewer or editor of a document
870862
Similar to the [can_share relation](#relation-can_share), we can achieve that with the following definition using <UpdateProductNameInLinks link="../configuration-language" name="{ProductName} Configuration Language" />:
871863

872864
<AuthzModelSnippetViewer
873-
onlyShow={SyntaxFormat.Friendly2}
874865
skipVersion={true}
875866
configuration={{
876867
type: 'document',
@@ -937,7 +928,6 @@ _A user can write a document if they are an owner or editor of a document or if
937928
Similar to the [can_share relation](#relation-can_share), we can achieve that with the following definition using <UpdateProductNameInLinks link="../configuration-language" name="{ProductName} Configuration Language" />:
938929

939930
<AuthzModelSnippetViewer
940-
onlyShow={SyntaxFormat.Friendly2}
941931
skipVersion={true}
942932
configuration={{
943933
type: 'document',
@@ -986,7 +976,6 @@ _A user can change the owner of a document if they are an owner of the document.
986976
Similar to the [can_share relation](#relation-can_share), we can achieve that with the following definition using <UpdateProductNameInLinks link="../configuration-language" name="{ProductName} Configuration Language" />:
987977

988978
<AuthzModelSnippetViewer
989-
onlyShow={SyntaxFormat.Friendly2}
990979
skipVersion={true}
991980
configuration={{
992981
type: 'document',
@@ -1007,7 +996,6 @@ Similar to the [can_share relation](#relation-can_share), we can achieve that wi
1007996
The complete <ProductConcept section="what-is-a-type-definition" linkName="type definition" /> for the document type is:
1008997

1009998
<AuthzModelSnippetViewer
1010-
onlyShow={SyntaxFormat.Friendly2}
1011999
configuration={{
10121000
schema_version: '1.1',
10131001
type_definitions: [
@@ -1169,7 +1157,6 @@ The complete <ProductConcept section="what-is-a-type-definition" linkName="type
11691157
Combining the type definitions for document and organization, we have
11701158

11711159
<AuthzModelSnippetViewer
1172-
onlyShow={SyntaxFormat.Friendly2}
11731160
configuration={{
11741161
schema_version: '1.1',
11751162
type_definitions: [

docs/content/modeling/testing-models.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The `.fga.yaml` contains tests for <ProductName format={ProductNameFormat.ShortF
2626
| Object | Description |
2727
| -------- | -------- |
2828
| `name` (optional) | A descriptive name for the test file |
29-
| `model` or `model_file` | An <ProductName format={ProductNameFormat.ShortForm}/> model or a reference to an external model file in `fga` or `json` format |
29+
| `model` or `model_file` | An <ProductName format={ProductNameFormat.ShortForm}/> model or a reference to an external model file in `fga`, `json` or `mod` format |
3030
|`tuples or tuple_file` (optional) | A set of tuples or a reference to an external tuple file in `json`, `yaml` or `csv` format. These are considered for all tests. |
3131
|`tests` | A set of tests that verify the return values of <ProductName format={ProductNameFormat.ShortForm}/> API calls |
3232

@@ -51,7 +51,7 @@ model: |
5151
current_time < grant_time + grant_duration
5252
}
5353
54-
# tuple_file: ./tuples.yaml # you can specify an external file, or include it inline
54+
# tuple_file: ./tuples.yaml # you can specify an external file, include it inline, or both
5555
tuples:
5656

5757
# Anne is a member of the Acme organization
@@ -79,7 +79,7 @@ Tests have the following structure:
7979
| Object | Description |
8080
| -------- | -------- |
8181
|`name` (optional) | A descriptive name for the test, like “Organization Membership” |
82-
|`tuples` | A set of tuples that are only considered for the test |
82+
|`tuple_file` or `tuples` | A set of tuples that are only considered for the test |
8383
|`check` | A set of tests for Check calls, each with a user/object and a set of assertions |
8484
|`list_objects` | A set of tests for ListObjects calls, each one with a user/type and a set of assertions for any number of relations|
8585
|`list_users` | A set of tests for ListUsers calls, each one with an object and user filter and a set of assertions for the users for any number of relations |
@@ -187,6 +187,12 @@ The following is an example of using the `list_users` option in <ProductName for
187187
```
188188
The example above checks that the `organization:acme`, given the current time is February 2nd 2024, it has 'user:anne' as a `member`, nobody as an `admin`. If we tried with current time being February 1st 2024, then `user:peter` would be listed as an `admin`
189189

190+
## Testing with Modular Models
191+
192+
If you are using [Modular Models](./modular-models.mdx), you need to use the `fga.mod` as the `model_file`.
193+
194+
You can define the tests for each model in separate `.fga.yaml` files. All files should point to the `fga.mod` model. You can create a shared file with tuples and reference it with the `tuple_file` option. You can include module-specific tuples in each `fga.yaml` file.
195+
190196
## Running tests
191197

192198
Tests are run using the `model test` CLI command. For instructions on installing the OpenFGA CLI, visit the [OpenFGA CLI Github repository](https://github.com/openfga/cli).

docs/content/modeling/user-groups.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ There are possible use cases where a group of users have a certain role on or pe
9797

9898
To represent this in <ProductName format={ProductNameFormat.ShortForm}/>:
9999

100+
<!-- We disable the check for these links because markdown-link-check doesn't support reading the docusaurus syntax to define the link -->
101+
<!-- markdown-link-check-disable -->
100102
1. Introduce the concept of a `team` to the authorization model. [→](#step-1)
101103
2. Add users as `members` to the `team`. [→](#step-2)
102104
3. Assign the `team` members a relation to an object. [→](#step-3)
103105
4. Check an individual member's access to the object. [→](#step-4)
106+
<!-- markdown-link-check-enable -->
104107

105108
### 01. Introduce the concept of a team to the authorization model {#step-1}
106109

src/components/Docs/AuthorizationModel/AuthzModelCodeBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type AuthzModelCodeBlockProps = {
1313
const AuthzModelCodeBlock: React.FC<AuthzModelCodeBlockProps> = ({ configuration, syntaxFormat, skipVersion }) => {
1414
return (
1515
<CodeBlock
16-
className={`language-${syntaxFormat === SyntaxFormat.Api ? 'json' : tools.PrismExtensions.LANGUAGE_NAME}`}
16+
className={`language-${syntaxFormat === SyntaxFormat.Json ? 'json' : tools.PrismExtensions.LANGUAGE_NAME}`}
1717
>
1818
{loadSyntax(configuration, syntaxFormat, skipVersion)}
1919
</CodeBlock>

0 commit comments

Comments
 (0)