Expressions are configured in the parameter exec_if_expr, which is located one level above config { }. These parameter used to configure logic defining if a valve should be executed or not based on runtime data, such as request parameter values.
Example
Copy {
" name " : " DumpState " ,
" exec_if_expr " : " request.used_auth == ('unpw') || request.used_auth == ('otp') " ,
" config " : {}
} Example - Exec if request param equals with OR.
Copy " exec_if_expr " : " request.used_auth == ('unpw') || request.used_auth == ('otp') " , Example - Exec if no items exist
Copy " exec_if_expr " : " state.items == null || state.items.isEmpty() " Example - Exec if the item property iam_role exist, but the value is empty
Copy " exec_if_expr " : " items.length > 0 && items[0].iam_role == '' " Example - Exec if the item property iam_role exist with the value Admin
Example - Exec if the item property pwdLastSet exist
Example - Exec if the item property pwdLastSet is missing
Example - Include items memberOf a specific group
Example - Exec if no items exist, the request property used_auth has the value frejaEidPlus and the request property co does not have the value SE.
More details are found here
Expressions chevron-right Last updated 8 months ago