feat(jans-cedarling): Support JSON logic for principal boolean operations #10590
Labels
comp-jans-cedarling
Touching folder /jans-cedarling
enhancement
kind-feature
Issue or PR is a new feature request
Milestone
Is your feature request related to a problem? Please describe.
The current
CEDARLING_USER_WORKLOAD_BOOLEAN_OPERATION
bootstrap property is restrictive, allowing only basicAND
orOR
operations to combine the results of multiple principals. This limitation prevents the implementation of more complex decision-making logic or the inclusion of additional custom principals.Describe the solution you'd like
Replace the
CEDARLING_USER_WORKLOAD_BOOLEAN_OPERATION
property with a newCEDARLING_PRINCIPAL_BOOLEAN_OPERATION
property that accepts a JSON Logic expression. This enhancement would enable users to define more flexible and complex logic for combining principal results.Examples
AND
in JSON Logic:OR
in JSON Logic:ALLOW
decision is returned only if either theJans::Workload
orJans::User
principal is allowed, and a custom principal (Another::Custom
) is also allowed:JSON Logic for Rust
There are multiple crates that we can try and use to parse the JSON logic:
It also seems like
jsonlogic
isn't really being maintained anymore.Describe alternatives you've considered
N/A
Additional context
To explore and test JSON Logic expressions, visit: https://jsonlogic.com/play.html
Example Rule:
Example data:
The text was updated successfully, but these errors were encountered: