Open charlieegan3 opened 1 month ago
Seems like a bug. I would have expected /input/emails/0/email
to be upserted.
@RohitRox reported that there is a case I'd missed that does cover this case, but with the assertion that it's a no-op. https://github.com/open-policy-agent/opa/blob/main/plugins/logs/mask_test.go#L481C1-L482C1
So since that's not consistent with the docs, then one needs to change. I think we should be able to support this case as it seems valid to me.
We also support more obscure things like injecting values into bodies:
upsert: undefined object: missing key, provided value
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. Although currently inactive, the issue could still be considered and actively worked on in the future. More details about the use-case this issue attempts to address, the value provided by completing it or possible solutions to resolve it would help to prioritize the issue.
From the docs, this should be supported:
However, I am unable to get this to work. Reported here and in Slack.
input.json
policy.rego
system.rego
I see this output (not redacted):
updating system.rego to:
I see this output: (field upserted to
foo
)updating system.rego to
I see this output: (field removed)
So in summary, it looks like upsert is not working when there is an array element in the path.
In
mask_test.rego
I can't see any tests for upserting when there's an array element in the path.