-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(authorisation_model): adds roles to the authorisation model (#1438)
* feat(authorisation_model): adds roles to the authorisation model Adds roles to our authorisation model * style(openfga test): remove commented out test * Update openfga/README.md * docs(test structure): moves a small detail on test structure over to the readme
- Loading branch information
Showing
5 changed files
with
569 additions
and
443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# openfga | ||
|
||
## Introduction | ||
The OpenFGA package holds our authorisation model and a go embed to pass the auth model into tests. | ||
It also holds | ||
tests to ensure the authorisation model is working correctly. | ||
|
||
## Requirements | ||
|
||
### VSCode Extension | ||
Name: OpenFGA | ||
Id: openfga.openfga-vscode | ||
Description: Language support for OpenFGA authorization models | ||
Version: 0.2.24 | ||
Publisher: OpenFGA | ||
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode | ||
|
||
### OpenFGA CLI | ||
go install github.com/openfga/cli/cmd/fga@latest | ||
|
||
## Adding / modifying [to] the authorsation model | ||
1. Open the authorisation_model.fga | ||
2. Make your modification | ||
3. Open the Command Pallette using Ctrl+Shift+P (Windows) or Command+Shift+P (OSX) | ||
4. Select OpenFGA: Transform DSL to JSON | ||
5. Save the file over the existing authorisation_model.json | ||
6. Add tests to tests.fga.yaml - Learn more [here](https://openfga.dev/docs/modeling/testing) | ||
7. Run them via: `make test-auth-model` | ||
|
||
## Test Structure | ||
In order to avoid the potential entanglement of separate tests the tuples are artifically split into groups using this naming convention: (type):(2-letter test name)-(type)-(id) | ||
The GitHub action supports running all tests in a directory, but keeping them in a single file improves the local development experience because the CLI does not. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.