+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ OPA is a general purpose policy engine . All these software that we see on the right at some point of time understands that it needs a policy decision. So what it is does it cobles on whatever policy decision that it needs about as a policy query and hands that query over to OPA . And OPA makes the decision and returns into the service , it is the services responsibility to enforce that decision . It is OPA responsibility to make that decision. For example if that service was a kubernetes API server . Kubernetes will decide that some user is trying to create a new resource on it , POD or ingress lets say on the kubernetes cluster . Kubernetes would take that 100 or 500 line of code of JSON or YAMLthat describes the new resource the user trying to deploy on to the cluster and it will hand that entire JSON or YAML code to OPA - OPA
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ How to do some Equality Checks Equality Expressions : Array is above one , below is sets . Sets are sometimes surprising to people. These two sets has got all the same element . The order in which they appear is Irrelevant and the number of times each of this appears is irrelevant. There is another kind of Equality operator. The x in the first bracket , it finds x is not the same as the one on the right and it assume x as variable and assigns the value 2 on the right to x on the left. Rego Build in Functions : Build in functions do a loads of comparisons and functions .
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Boolean Rules & Evaluation OPA Policy Authorization : Through out we will be using API policy evaluation . This is very simple use case and a common use case. Boolean Rules : Remember that every rule is an IF statement . When you are going to write an IF statement you are going to assign a value . Multiple Rules : In all of those rules we were thinking of them in Isolation . But with OPA you can goahead and write multiple rule and if you do that you will end up with writing a logical OR. Even though you can write multiple . What happens when non of the Rules Succeed. Then the value of that rule is undefined. But in some cases you do not want the default "undefined" result and - if non of the rules succeed. default is_read = false This is achieved by defining the result as - false This says that non of the value s
Comments
Post a Comment