1
- import { Callout } from ' nextra/components'
2
- import YouTube from ' react-youtube'
1
+ import { Callout } from ' nextra/components' ;
2
+ import YouTube from ' react-youtube' ;
3
3
4
4
# Validation, Testing, Debugging SpiceDB Schemas
5
5
@@ -35,11 +35,13 @@ To support this, SpiceDB's v1 CheckPermission API supports a debug header that w
35
35
Instead, we recommend using [ zed's explain flag] for this purpose.
36
36
37
37
[ zed's explain flag ] : #explain-flag
38
+
38
39
</Callout >
39
40
40
41
Configuring this header is done by setting the header ` io.spicedb.requestdebuginfo ` to the string ` true ` .
41
42
42
43
The response will include a trailer, ` io.spicedb.respmeta.debuginfo ` , with a JSON-encoded tree.
44
+
43
45
## Playground
44
46
45
47
### Assertions
@@ -62,7 +64,8 @@ This enables an even tighter feedback-loop when developing a schema.
62
64
63
65
Below is an example of configuring a Check Watch:
64
66
65
- <br /><YouTube videoId="UmvGPU8iQ-0" />
67
+ <br />
68
+ <YouTube videoId="UmvGPU8iQ-0" />
66
69
67
70
### Expected Relations
68
71
@@ -85,6 +88,19 @@ project:docs#admin:
85
88
- " [user:rauchg] is <platform:vercel#admin>"
86
89
` ` `
87
90
91
+ ## Check Tracing
92
+
93
+ SpiceDB supports tracing of check requests to view the path(s) taken to compute the result, as well as timing information.
94
+
95
+ Request tracing information by setting ` with_tracing: true` in the request message and the information will be found in the response message.
96
+
97
+ <Callout type="warning">
98
+ **Warning:**
99
+ Versions older than v1.31.0
100
+
101
+ Request tracing information via a header and the information will be found in the response footer as JSON.
102
+ </Callout>
103
+
88
104
# # Zed
89
105
90
106
# ## Zed Validate
@@ -109,13 +125,13 @@ If you're interested in learning more about this functionality in SpiceDB, you c
109
125
110
126
Here's an example using `--explain` :
111
127
112
- ` ` ` ansi
128
+ ` ` ` ansi
113
129
$ zed permission check --explain document:firstdoc view user:fred
114
130
true
115
131
[32m✓[0m [37mdocument[0m:[37mfirstdoc[0m [38;5;35mview[0m (66.333µs)
116
132
├── [31m⨉[0m [90mdocument[0m:[90mfirstdoc[0m [90mwriter[0m (12.375µs)
117
133
└── [32m✓[0m [37mdocument[0m:[37mfirstdoc[0m [38;5;166mreader[0m (20.667µs)
118
- └── [38;5;99muser:fred [0m
134
+ └── [38;5;99muser:fred [0m
119
135
` ` `
120
136
121
137
This command will also highlight which parts of the traversal were cached and if a cycle is detected.
@@ -142,8 +158,8 @@ steps:
142
158
# ## [authzed/action-spicedb-validate](https://github.com/marketplace/actions/validate-spicedb-schema)
143
159
144
160
<Callout type="info">
145
- **Info:**
146
- This tool is highly recommended because it can prevent deployments of unverified changes.
161
+ **Info:** This tool is highly recommended because it can prevent deployments
162
+ of unverified changes.
147
163
</Callout>
148
164
149
165
The Playground offers a variety of tools that are useful for validating a design, but running the playground isn't designed for operating within a typical CI/CD environment.
0 commit comments