in the expression that is used to match JWT claims...
# help
j
in the expression that is used to match JWT claims, such as
Copy code
expr: request.aux_data.jwt.myclaim == "5"
how do i reference claims in the JWT that are arrays? for example, the "scope" claim is a list of comma separated values
d
"a,b,c,d".split(",")[1] == "b"
Policies support common expression language (CEL) and Cerbos extensions - quite a powerful language
j
hold on....the [1] part of the check....
that's telling cerbos to loop through all elements of the output from the split?
"a,b,c,d".split(",")[1] == "b"
i mean say my scope claim contains "a b c d"....and i want to check if "c" exists in it
d
"a,b,c,d".split(",")
gives an array
[i]
gets item by its index
… in the array
j
"a" in "a b c d".split(" ")
d
should give true
j
ah yes. got it!