oscerd commented on code in PR #29838:
URL: https://github.com/apache/camel/pull/29838#discussion_r4583865254


##########
components/camel-openfga/src/main/docs/openfga-component.adoc:
##########
@@ -347,6 +347,38 @@ producer fails and names the part that is missing.
 A typed wildcard — `user:*`, OpenFGA's "everyone" — is accepted here, because 
writing that tuple is how a resource
 is shared publicly and is a deliberate act by the route. It is *refused* as 
the subject of a check; see below.
 
+=== Mutation conflicts and atomic updates
+
+By default, `onDuplicate=error` makes an existing relationship fail a write, 
and `onMissing=error` makes an absent
+relationship fail a delete. On OpenFGA 1.10.0 or later, select 
`onDuplicate=ignore` or `onMissing=ignore` explicitly
+for reconciliation routes that should leave an already-satisfied operation 
unchanged. These options apply to
+`writeTuples` and `deleteTuples`, respectively, and both apply to `write`.
+
+Use `write` to grant and revoke relationships in one atomic request. With no 
configured `user`/`relation`/`object`,
+the body is a Map containing `writes` and/or `deletes` collections. Each entry 
is an ordinary Map containing exactly
+`user`, `relation` and `object`; other body shapes or entry fields are 
rejected. For example:
+
+[source,java]
+------------------------------------------------------------
+Map<String, Object> changes = Map.of(
+    "writes", List.of(Map.of("user", "user:anne", "relation", "writer", 
"object", "document:budget")),
+    "deletes", List.of(Map.of("user", "user:anne", "relation", "reader", 
"object", "document:budget")));
+template.requestBody("openfga:write?storeId={{fga.store}}&authorizationModelId={{fga.model}}",
 changes);
+------------------------------------------------------------
+
+At least one tuple is required, and the sum of writes and deletes cannot 
exceed 100. Larger transactions are rejected
+before calling OpenFGA; the component never splits this atomic update into 
independently committed requests. A failed
+transaction remains a failure even when `failOpen=true`. An 
endpoint-configured model revision is applied to the

Review Comment:
   Reworded in (cc22d5abf383): "The component applies an endpoint-configured 
model revision to the transaction".
   
   _Claude Code on behalf of oscerd_



##########
components/camel-openfga/src/main/docs/openfga-component.adoc:
##########
@@ -347,6 +347,38 @@ producer fails and names the part that is missing.
 A typed wildcard — `user:*`, OpenFGA's "everyone" — is accepted here, because 
writing that tuple is how a resource
 is shared publicly and is a deliberate act by the route. It is *refused* as 
the subject of a check; see below.
 
+=== Mutation conflicts and atomic updates
+
+By default, `onDuplicate=error` makes an existing relationship fail a write, 
and `onMissing=error` makes an absent
+relationship fail a delete. On OpenFGA 1.10.0 or later, select 
`onDuplicate=ignore` or `onMissing=ignore` explicitly
+for reconciliation routes that should leave an already-satisfied operation 
unchanged. These options apply to
+`writeTuples` and `deleteTuples`, respectively, and both apply to `write`.
+
+Use `write` to grant and revoke relationships in one atomic request. With no 
configured `user`/`relation`/`object`,
+the body is a Map containing `writes` and/or `deletes` collections. Each entry 
is an ordinary Map containing exactly
+`user`, `relation` and `object`; other body shapes or entry fields are 
rejected. For example:
+
+[source,java]
+------------------------------------------------------------
+Map<String, Object> changes = Map.of(
+    "writes", List.of(Map.of("user", "user:anne", "relation", "writer", 
"object", "document:budget")),
+    "deletes", List.of(Map.of("user", "user:anne", "relation", "reader", 
"object", "document:budget")));
+template.requestBody("openfga:write?storeId={{fga.store}}&authorizationModelId={{fga.model}}",
 changes);
+------------------------------------------------------------
+
+At least one tuple is required, and the sum of writes and deletes cannot 
exceed 100. Larger transactions are rejected
+before calling OpenFGA; the component never splits this atomic update into 
independently committed requests. A failed
+transaction remains a failure even when `failOpen=true`. An 
endpoint-configured model revision is applied to the
+transaction. A server configured with a lower tuple limit can reject a request 
within the component's limit.

Review Comment:
   Reworded in (cc22d5abf383), see the first thread on this line.
   
   _Claude Code on behalf of oscerd_



##########
components/camel-openfga/src/main/docs/openfga-component.adoc:
##########
@@ -347,6 +347,38 @@ producer fails and names the part that is missing.
 A typed wildcard — `user:*`, OpenFGA's "everyone" — is accepted here, because 
writing that tuple is how a resource
 is shared publicly and is a deliberate act by the route. It is *refused* as 
the subject of a check; see below.
 
+=== Mutation conflicts and atomic updates
+
+By default, `onDuplicate=error` makes an existing relationship fail a write, 
and `onMissing=error` makes an absent
+relationship fail a delete. On OpenFGA 1.10.0 or later, select 
`onDuplicate=ignore` or `onMissing=ignore` explicitly
+for reconciliation routes that should leave an already-satisfied operation 
unchanged. These options apply to
+`writeTuples` and `deleteTuples`, respectively, and both apply to `write`.
+
+Use `write` to grant and revoke relationships in one atomic request. With no 
configured `user`/`relation`/`object`,
+the body is a Map containing `writes` and/or `deletes` collections. Each entry 
is an ordinary Map containing exactly
+`user`, `relation` and `object`; other body shapes or entry fields are 
rejected. For example:
+
+[source,java]
+------------------------------------------------------------
+Map<String, Object> changes = Map.of(
+    "writes", List.of(Map.of("user", "user:anne", "relation", "writer", 
"object", "document:budget")),
+    "deletes", List.of(Map.of("user", "user:anne", "relation", "reader", 
"object", "document:budget")));
+template.requestBody("openfga:write?storeId={{fga.store}}&authorizationModelId={{fga.model}}",
 changes);
+------------------------------------------------------------
+
+At least one tuple is required, and the sum of writes and deletes cannot 
exceed 100. Larger transactions are rejected
+before calling OpenFGA; the component never splits this atomic update into 
independently committed requests. A failed
+transaction remains a failure even when `failOpen=true`. An 
endpoint-configured model revision is applied to the
+transaction. A server configured with a lower tuple limit can reject a request 
within the component's limit.
+
+The configured-tuple precedence also applies to `write`: when any of 
`user`/`relation`/`object` is configured, that
+triple supplies one write, the body is ignored, and no deletes are taken from 
it. A missing configured part fails
+rather than falling back to the body.
+
+Successful mutations preserve the input body. `CamelOpenFgaWrittenTuples` and 
`CamelOpenFgaDeletedTuples` report the
+number of submitted operations, including any skipped by the selected ignore 
mode; they do not report the number of

Review Comment:
   Reworded in (cc22d5abf383): "including any that the selected ignore mode 
skipped".
   
   _Claude Code on behalf of oscerd_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to