Policies
The demo server hosts these bundles. Each bundle has example inputs. Open a policy to see its files, ask the decision server for its decision, or step through it in the debugger.
- RBAC for an HTTP API
The API of a reports service lets a user call an endpoint if a role of the user permits the method and the path. A user can always read the profile of that user.
Bundle
default, decisiondata.httpapi.authz.decision - Kubernetes admission
A validating admission webhook. The API server sends an AdmissionReview of a pod. The policy refuses a pod with an image from an untrusted registry, a privileged container, or a container with no memory limit.
Bundle
kubernetes, decisiondata.kubernetes.admission.review - Data filtering
A document store asks which documents a user can read, and shows only those. Each document has a department and a classification. An auditor reads the documents of all departments, up to the clearance of the auditor.
Bundle
documents, decisiondata.documents.filter.visible - Change windows
A deployment pipeline asks if it can deploy a change now. A standard change needs the change window in London and no freeze. An emergency change needs an approver. The policy reads the time with time.now_ns, a provided value: a signed decision records it.
Bundle
change-windows, decisiondata.changes.window.decision - Expense approval with http.send
An expense needs the approval of the manager of the employee. The policy asks the staff directory for the manager with http.send. The demo answers http.send in memory: alice and bob report to carol, and carol reports to erin. The server does not sign the decision, because http.send is impure.
Bundle
expenses, decisiondata.expenses.approval.decision - Order approval with a shared library
A purchasing system asks if a user can place an order. The bundle has a shared library of roles, money and strings, and the decision uses only a few of its rules. Tree shaking removes the other rules, the unused library module, the tests and the data that the decision does not read.
Bundle
orders, decisiondata.orders.approval.decision