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: openfga/v1/openfga_service.proto
+35-3Lines changed: 35 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,9 @@ service OpenFGAService {
154
154
"type definitions allow OpenFGA to determine whether a "
155
155
"relationship exists between an object and an user.\n"
156
156
"In the body, `writes` adds new tuples and `deletes` removes existing tuples. When deleting a tuple, any `condition` specified with it is ignored.\n"
157
-
"The API is not idempotent: if, later on, you try to add the same tuple key (even if the `condition` is different), or if you try to delete a non-existing tuple, it will throw an error.\n"
157
+
"The API is not idempotent by default: if, later on, you try to add the same tuple key (even if the `condition` is different), or if you try to delete a non-existing tuple, it will throw an error.\n"
158
+
"In order to allow writes in case an identical tuple already exists in the database, you may modify the behavior using `\"on_duplicate\": \"ON_DUPLICATE_IGNORE\"`\n"
159
+
"In order to allow deletes in case a tuple was already deleted from the database, you may modify the behavior using `\"on_missing\": \"ON_MISSING_IGNORE\"`\n"
158
160
"The API will not allow you to write tuples such as `document:2021-budget#viewer@document:2021-budget#viewer`, because they are implicit.\n"
159
161
"An `authorization_model_id` may be specified in the body. If it is, it will be used to assert that each written tuple (not deleted) "
160
162
"is valid for the model specified. If it is not specified, the latest authorization model ID will be used.\n"
ON_DUPLICATE_UNSPECIFIED=0; // If set to 'ON_DUPLICATE_UNSPECIFIED' OR not set, the API will behave as if it was set to 'ON_DUPLICATE_ERROR'.
1250
+
ON_DUPLICATE_ERROR=1; // If set to 'ON_DUPLICATE_ERROR', the API will return an error if a tuple already exists.
1251
+
ON_DUPLICATE_IGNORE=2; // If set to 'ON_DUPLICATE_IGNORE', the API will not return an error if a tuple already exists and all the attributes (including condition and context ) are matching.
description: "If set to 'ON_DUPLICATE_ERROR', the API will return an error if a tuple already exists. If set to 'ON_DUPLICATE_IGNORE', the API will not return an error if a tuple already exists and all the attributes are matching."
1267
+
}
1268
+
];
1269
+
}
1270
+
1271
+
enumOnMissing {
1272
+
ON_MISSING_UNSPECIFIED=0; // If set to 'ON_DUPLICATE_UNSPECIFIED' OR not set, the API will behave as if it was set to 'ON_MISSING_ERROR'.
1273
+
ON_MISSING_ERROR=1; // If set to 'ON_MISSING_ERROR', the API will return an error if a tuple does not exist.
1274
+
ON_MISSING_IGNORE=2; // If set to 'ON_MISSING_IGNORE', the API will not return an error if a tuple does not exist.
description: "If set to 'ON_MISSING_ERROR', the API will return an error if a tuple does not exist. If set to 'ON_MISSING_IGNORE', the API will not return an error if a tuple does not exist."
0 commit comments