Hello,
I encountered a problem creating relationships with caveat context using the v1 api.
here is a snippet of my code
import protobuf from 'google-protobuf/google/protobuf/struct_pb.js';
const { Struct } = protobuf;
const context = {
authorized_labels: ["confidential"]
};
const structContext = Struct.fromJavaScript(context);
logger.debug(JSON.stringify(structContext.toJavaScript()))
updates.push({
relationship: Relationship.create({
resource: ObjectReference.create({
objectType: resourceType,
objectId: resourceId,
}),
relation: "bindings",
subject: SubjectReference.create({
object: ObjectReference.create({
objectType: "binding",
objectId: bindingId,
}),
}),
optionalCaveat: {
caveatName: "my_caveat",
context: structContext,
},
}),
operation: RelationshipUpdate_Operation.TOUCH,
});
when I execute a zed relationship read i get the caveatName set correctly but the context is empty object.
when i used zed to create the relationship with the caveat it worked very well.
Did I do something wrong or is there a limitation in the API and the caveat is not available yet ?
Thanks in advace 🙏
Hello,
I encountered a problem creating relationships with caveat context using the v1 api.
here is a snippet of my code
when I execute a zed relationship read i get the caveatName set correctly but the context is empty object.
when i used zed to create the relationship with the caveat it worked very well.
Did I do something wrong or is there a limitation in the API and the caveat is not available yet ?
Thanks in advace 🙏