This message was deleted.
# opal
s
This message was deleted.
o
Hi @Maurice Brand-Freitag are you asking about OPAL or #C02RTML2WNN? OPA and OPAL have no concept of users or tenants. Still when triggering a data update you can override the value of an entire key. Also you can perform a PATCH operation, which does have the ability to mutate the existing value instead of just overriding it.
m
Hi, sorry, let me clarify. I'm talking about OPAL. The example is data in the format OPA uses to evaluate our policies, i.e.
data.tenants["tenantA"].users["userA"]
. When changes to policy relevant data happen we call the data update API on the OPAL server. This works fine when updating data incrementally, question is, if there is a way to remove data from OPA. Using PATCH would still leave the empty user within the data set.
o
All good :) I believe a PATCH call with a remove operation on
data/tenants/tenantA/users/userA
would produce the right outcome https://www.rfc-editor.org/rfc/rfc6902#section-4.2
You can use a custom data-fetcher to return the right PATCH command. That being said I guess it wouldn't hurt to more natively support patch commands or even specificly delete as part of a data update. If interested, can you open a GitHub issue for this?
m
Will do, thanks 👍
o
Thank you. I've added a comment on the issue as well. If you could do a PR, that would be great, I could review and approve it.