Skip to content

Commit d56afb0

Browse files
authored
Merge pull request #2685 from Permify/mooreds/update-testing-page
docs(testing): grammar and clarity improvements
2 parents 2ce1c87 + e6fe29a commit d56afb0

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/getting-started/testing.mdx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ icon: 'vial'
44
title: 'Testing & Validation'
55
---
66

7-
Testing is critical process when building and maintaining an authorization system. This page explains how to ensure the new authorization model and related authorization data works as expected in Permify.
7+
Testing is a critical process when building and maintaining an authorization system. This page explains how to ensure the new authorization model and related authorization data works as expected in Permify.
88

99
Assuming that you're familiar with creating an authorization model and forming relation tuples in Permify. If not, we're strongly advising you to examine them before testing.
1010

@@ -40,10 +40,10 @@ If you don't know how to create Github action workflow and add a action to it, y
4040
4141
## Schema Validation File
4242
43-
Below you can examine an example schema validation yaml file. It consists 3 parts;
44-
- `schema` which is the authorization model you want to test,
45-
- `relationships` sample data to test your model,
46-
- `scenarios` to test access check queries within created scenarios.
43+
Below, you can examine an example schema validation yaml file. It consists of 3 parts;
44+
- `schema` which is the authorization model you want to test
45+
- `relationships` which is the sample data to test your model
46+
- `scenarios` which is the way to actually test access check queries within created scenarios
4747

4848
### Defining the Schema:
4949

@@ -149,17 +149,17 @@ scenarios:
149149
edit : ["58"]
150150
```
151151
152-
Assuming that you're well-familiar with the `schema` and `relationships` sections of the above YAML file. If not, please see the previous sections to learn how to create an authorization model (schema) and generate data (relationships) according to it.
152+
You should be familiar with the `schema` and `relationships` sections of the above YAML file. If not, please see the previous sections to learn how to [create an authorization model (the schema)](/getting-started/modeling) and [generate data (relationships)](/getting-started/sync-data) according to a schema.
153153

154-
We'll continue by examining how to create scenarios.
154+
Next, you'll examine how to create scenarios.
155155

156156
## Creating Test Scenarios
157157

158158
You can create multiple access checks at once to test whether your authorization logic behaves as expected or not.
159159

160160
Besides simple access checks you can also test subject filtering queries and data (entity) filtering with it.
161161

162-
Let's deconstruct the `scenarios`,
162+
Let's deconstruct the `scenarios` configuration.
163163

164164
### Scenarios
165165

@@ -187,7 +187,7 @@ checks:
187187
push : true
188188
```
189189

190-
Semantics for above check is: whether `user:1` can push to `repository:3`, additional to stored tuples take account that user:1 is owner of repository:3 (`repository:3#owner@user:1`). Expected result for that check it **true** - `push : true`
190+
Semantics for above check is: whether `user:1` can push to `repository:3`, in addition to stored tuples, take into account that user:1 is owner of repository:3 (`repository:3#owner@user:1`). Expected result for that check it **true** - `push : true`
191191

192192
### Depth Configuration
193193

@@ -211,8 +211,8 @@ checks:
211211
```
212212

213213
**When to use depth:**
214-
- Use a lower depth (e.g., 3-5) for shallow permission hierarchies to improve performance
215-
- Use a higher depth (e.g., 20-50) for deep nested relationships
214+
- Use a lower depth (e.g., 3-5) for a shallow permission hierarchy to improve performance
215+
- Use a higher depth (e.g., 20-50) for deeply nested relationships
216216
- If you encounter "depth not enough" errors, increase the depth value for that specific check
217217

218218
<Note>
@@ -228,19 +228,19 @@ You can create `entity_filters` within `scenarios` to test your data filtering q
228228
```yaml
229229
entity_filters:
230230
- entity_type: "repository" # entity that you want to filter
231-
subject: "user:1" # subject that you want to perform data filtering
231+
subject: "user:1" # subject for which you want to perform data filtering
232232
depth: 100 # depth limit for permission check (optional, default: 100, minimum: 3)
233233
context: null # additional data provided during an access check to be evaluated
234234
assertions:
235235
push : ["1", "3", "4", "5"] # IDs of the resources that we expected to return
236236
edit : []
237237
```
238238

239-
The major difference between `check` lies in the assertions part. Since we're performing data filtering with bulk data, instead of a true-false result, we enter the IDs of the resources that we expect to be returned
239+
The major difference between `entity_filters` and `checks` lies in the assertions part. Since we're performing data filtering with bulk data, instead of a true-false result, we enter the IDs of the resources that we expect to be returned.
240240

241241
### Subject Filtering
242242

243-
You can create `subject_filters` within `scenarios` to test your subject filtering queries, a.k.a which users can perform action Y or have permission X on entity:Z?
243+
You can create `subject_filters` within `scenarios` to test your subject filtering queries, such as which users can perform action Y or have permission X on entity:Z.
244244

245245
```yaml
246246
- subject_reference: "user"
@@ -270,7 +270,7 @@ The output of the example provided above is as follows.
270270

271271
You can also test your new authorization model in your local (Permify clone) without using [permify-validate-action] at all.
272272

273-
For that open up a new file and add a schema yaml file inside. Then build your project with, run `make build` command and run `./permify validate {path of your schema validation file}`.
273+
For that open up a new file and add a schema yaml file inside. Then build your project, run `make build` command and run `./permify validate {path of your schema validation file}`.
274274

275275
If we use the above example schema validation file, after running `./permify validate {path of your schema validation file}` it gives a result on the terminal as:
276276

@@ -301,7 +301,7 @@ You can find more details about our suggested workflow to handle schema changes
301301

302302
## Need any help ?
303303

304-
Our team is happy to help you get started with Permify. If you'd like to learn more about using Permify in your app or have any questions about it, [schedule a consultation call with one of our account executives](hhttps://calendly.com/d/cj79-kyf-b4z).
304+
Our team is happy to help you get started with Permify. If you'd like to learn more about using Permify in your app or have any questions about it, [schedule a consultation call with one of our account executives](https://calendly.com/d/cj79-kyf-b4z).
305305

306306

307307

0 commit comments

Comments
 (0)