Skip to content
Discussion options

You must be logged in to vote

Maybe I missed something, but why reconstruct input with identical fields from the actual input? The input object is global and can be read from any policy. This:

result := true if {
    my_single_policy_from_another_file with input as {
        "name": input.name,
        "id": input.id,
        "code": input.code,
        "phone": input.phone
    }
}

Is really just a more fragile (as you've noticed) way to express this:

result if {
    my_single_policy_from_another_file
}

Now if you for some reason really need to define a new object from input that has the same defined/undefined properties (perhaps with some added variations), you could build an incremental object rule and use that:

obj["

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@renatosc
Comment options

Comment options

You must be logged in to vote
2 replies
@renatosc
Comment options

@anderseknert
Comment options

Answer selected by renatosc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants