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: README.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,48 @@ Below is the example configuration one might use in `declarative_config`:
95
95
| `tuple`<br/>_required_<br/><br/>**Type:** record | - | Tuple key for authorization |
96
96
| `contextual_tuples`<br/>_optional_<br/><br/>**Type:** set | {} | Set of contextual tuples for authorization |
97
97
98
+
## Tuple Definition
99
+
100
+
The `Tuple key` is a structure used to define the relationship between a user, relation, and object. It supports both direct string values and Lua expressions that return a string. The Lua expressions run in the Kong Plugin Sandbox for security.
101
+
102
+
### Fields
103
+
104
+
- `user`: A string representing the user.
105
+
- `user_by_lua`: A Lua expression that returns a string representing the user.
106
+
- `relation`: A string representing the relation.
107
+
- `relation_by_lua`: A Lua expression that returns a string representing the relation.
108
+
- `object`: A string representing the object.
109
+
- `object_by_lua`: A Lua expression that returns a string representing the object.
110
+
111
+
### Entity Checks
112
+
113
+
- Only one of `user` or `user_by_lua` must be provided.
114
+
- At least one of `user` or `user_by_lua` must be provided.
115
+
- Only one of `relation` or `relation_by_lua` must be provided.
116
+
- At least one of `relation` or `relation_by_lua` must be provided.
117
+
- Only one of `object` or `object_by_lua` must be provided.
118
+
- At least one of `object` or `object_by_lua` must be provided.
119
+
120
+
### Example
121
+
122
+
Below is an example configuration using `Tuple key` in `declarative_config`:
0 commit comments