open-policy-agent / library Goto Github PK
View Code? Open in Web Editor NEWThe Open Policy Agent project standard library.
License: Apache License 2.0
The Open Policy Agent project standard library.
License: Apache License 2.0
According to https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/ the response needs to look like this
{
"apiVersion": "admission.k8s.io/v1",
"kind": "AdmissionReview",
"response": {
"uid": "<value from request.uid>",
"allowed": true
}
}
Each PR should be tested and checked before merge is allowed. See OPA for Travis CI setup.
The library should include a Makefile with common targets to help develop policies.
test
: run all tests (see open-policy-agent/opa#428)check
: run all linters (for now this would be a wrapper around opa fmt
)Repeatedly, the handling of time and date using nanoseconds has gotten people stumbling.
The situation could perhaps be improved if we had some rego-only helper methods? I'm imaging something like
days(n) = x {
x := n * hours(24)
}
hours(n) = x {
x := n * minutes(60)
}
minutes(n) = x {
x := n * seconds(60)
}
seconds(n) = x {
x := n * 1000000000
}
So that you could write time.now_ns() - time.days(1)
etc.
This would be similar to how golang does it in time
's constants.
When adding a patch for an annotation with a path like /metadata/annotations/kubernetes.io/role
the annotation isn't added, and any existing annotations are removed.
This happens whether or not there are any existing annotations in that path.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.