You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/spicedb/concepts/commands.mdx
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -454,7 +454,6 @@ spicedb serve [flags]
454
454
--dispatch-upstream-addr string upstream grpc address to dispatch to
455
455
--dispatch-upstream-ca-path string local path to the TLS CA used when connecting to the dispatch cluster
456
456
--dispatch-upstream-timeout duration maximum duration of a dispatch call an upstream cluster before it times out (default 1m0s)
457
-
--enable-experimental-relationship-expiration enables experimental support for first-class relationship expiration
458
457
--enable-experimental-watchable-schema-cache enables the experimental schema cache which makes use of the Watch API for automatic updates
459
458
--enable-performance-insight-metrics enables performance insight metrics, which are used to track the latency of API calls by shape
460
459
--enable-revision-heartbeat enables support for revision heartbeat, used to create a synthetic revision on an interval defined by the quantization window (postgres only) (default true)
Expiring Relationships is available from SpiceDB 1.40 onwards. Use the `--enable-experimental-relationship-expiration` flag when calling `spicedb serve` to enable it.
9
-
</Callout>
6
+
A common use case is granting a user access to a resource for a limited time.
10
7
11
-
A common use case is to model relationships that expire after a certain time.
12
-
This is useful for granting temporary access to a resource.
13
-
14
-
Before version 1.40, [caveats] were the recommended way to support time-bound permissions, but that has some limitations:
8
+
Before SpiceDB v1.40, [caveats] were the recommended way to support time-bound permissions, but that has some limitations:
15
9
16
10
[caveats]: caveats
17
11
@@ -20,7 +14,7 @@ This is additional complexity for clients.
20
14
- Expired caveats are not automatically garbage collected.
21
15
This can lead to many caveated relationships in the system and increase the costs of loading and evaluating those into the runtime.
22
16
23
-
SpiceDB supports expiring relationships, which lets users define relationships that expire at a given time.
17
+
After SpiceDB v1.4.0, and if you need to grant temporary access to a resource, you can do so by writing relationships that expire after a certain time.
24
18
25
19
The time must be specified in [RFC 3339 format].
26
20
@@ -35,28 +29,22 @@ The time must be specified in [RFC 3339 format].
35
29
36
30
## Schema
37
31
38
-
Expiring relationships follow a similar use to caveated subject types.
39
-
The novelty here is that users need to enable the feature using the `use` clause.
40
-
This is to disambiguate a caveat named `expiration` from the new expiration feature.
41
-
42
32
To enable expiration in your schema, add a `use expiration` clause to the top of the file.
43
33
Then the relations subject to expiration are marked using `<type> with expiration`:
44
34
45
35
```zed
46
36
use expiration
47
37
48
-
definition folder {}
38
+
definition user {}
49
39
50
40
definition resource {
51
-
relation folder: folder with expiration
41
+
relation viewer: user with expiration
52
42
}
53
43
```
54
44
55
45
## API
56
46
57
-
The expiration of a relationship is [on a per-relationship basis](https://buf.build/authzed/api/docs/63b8911ef2871c56e5048d1f40a8473f98457ca9:authzed.api.v1#authzed.api.v1.Relationship)
58
-
at write time, using `WriteRelationships` or `BulkImportRelationships` APIs.
59
-
The expiration is denoted with the `OptionalExpiresAt` field in the relationship.
47
+
To write a relationship that expires, use the `WriteRelationships` or `BulkImportRelationships` APIs, and set the `OptionalExpiresAt` field in the relationship:
60
48
61
49
```textproto
62
50
WriteRelationshipsRequest {
@@ -86,27 +74,27 @@ WriteRelationshipsRequest {
86
74
87
75
## Playground
88
76
89
-
Set expirations on relationships in the Playground with the format `[expiration:2025-12-31T23:59:59Z]`:
77
+
To write a relationship that expires, use the following format:
0 commit comments