oscerd opened a new pull request, #29744:
URL: https://github.com/apache/camel/pull/29744

   ## What this does
   
   `camel-openfga` moves a relationship tuple through `OpenFgaProducer` as a 
three-field holder of `user`, `relation` and `object`. A tuple can also carry a 
*relationship condition* — a condition name plus an optional context — which 
the OpenFGA SDK models on the `ClientTupleKey` subtype and the server returns 
on a read.
   
   Before this change, that condition was lost on both paths:
   
   - `writeTuples` matched the input against the 
`ClientTupleKeyWithoutCondition` supertype and rebuilt a fresh `ClientTupleKey` 
from only the three identity fields, so a condition set on the input — or given 
as a `condition` entry on a `Map` body — was dropped and the tuple was written 
unconditioned, with no error.
   - `readTuples` and `readChanges` projected only `user`, `relation`, `object` 
(and `operation`) and `timestamp`, omitting a condition the server returned.
   
   ## The change
   
   - `toTuple` captures the condition from a `ClientTupleKey`, and from a 
`condition` entry on a `Map` body (a map of a `name` and an optional `context`).
   - `writeTuples` sets the condition on the outgoing `ClientTupleKey` when one 
is present. A tuple with no condition is still written unconditioned.
   - `readTuples` and `readChanges` add a `condition` map (`name`, `context`) 
to each result entry when the stored tuple has one, so a route can read it back 
and round-trip it into a write.
   - `deleteTuples` is unchanged: OpenFGA deletes by identity, so a condition 
on a delete body is ignored.
   
   The component documentation and the 4.24 upgrade guide are updated to 
describe the condition on write and the new `condition` key in read and change 
results.
   
   ## Tests
   
   A new `OpenFgaTupleConditionTest` covers: a condition preserved on a single 
`ClientTupleKey`, across a collection, and from a `Map` body; an unconditioned 
write staying unconditioned; `deleteTuples` staying identity-only; and 
`readTuples`/`readChanges` projecting a stored condition. The full 
`camel-openfga` suite passes.
   
   _Claude Code on behalf of oscerd_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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