Modules

rego4k is a group of modules. Each module is a Maven artifact in the group dev.rego4k.

The BOM rego4k-bom gives each module the same version. Choose the modules with the dependencies of your application.

Each module has a README in the repository that explains its bounded context.

Module Artifact Contents
modules/core rego4k-core Values, the AST, the parser, the compiler, the evaluator and Rego. It has no builtins, and its only dependency is parser4k.
modules/builtins/stdlib rego4k-builtins-stdlib All the builtins of the library of OPA, the Open Policy Agent, that rego4k has: Builtins.stdlib(regex). It depends on the modules of the pure, provided, impure and yaml.* builtins.
modules/builtins/stdlib-pure rego4k-builtins-stdlib-pure The pure builtins of OPA's standard library: Builtins.Pure.stdlib(regex), with the regex engine that you give. No dependencies except core.
modules/builtins/stdlib-provided rego4k-builtins-stdlib-provided The provided builtins of OPA's standard library: Builtins.Provided.stdlib. time.now_ns, the time.* builtins with the time zone data, the expiry checks of JWTs and x509 certificates, and opa.runtime.
modules/builtins/stdlib-impure rego4k-builtins-stdlib-impure The impure builtins of OPA's standard library: Builtins.Impure.stdlib. http.send, net.lookup_ip_addr, rand.intn, uuid.rfc4122 and the ES* and PS* signatures of a JWT.
modules/builtins/yaml rego4k-builtins-yaml The yaml.* builtins: Builtins.yaml. The only module that uses snakeyaml.
modules/builtins/re2 rego4k-builtins-re2 Re2Engine: the regex engine of OPA (RE2, with re2j), for Builtins.Pure.stdlib(Re2Engine). The only module that uses re2j.
modules/builtins/http4k-send rego4k-builtins-http4k-send Builtins.httpSend(handler): http.send on an http4k HttpHandler, the HTTP handler of the http4k Kotlin library, with the results of OPA.
modules/http4k-json rego4k-http4k-json Conversion between the nodes of an http4k Json (Moshi, Kondor, Gson, ...) and Values.
modules/bundles/core rego4k-bundles-core OPA bundles: read a .tar.gz or a directory, write a deterministic .tar.gz, and tree shaking (Bundle.shake), with the list of the builtins that the shaken bundle needs, and its dry run (Bundle.shakeDryRun): the lines of each file that tree shaking keeps, deletes and adds.
modules/opa/core rego4k-opa-core The capabilities of OPA as interfaces, for example Evaluation and WasmBuilding, and the sets Toolchain and Opa. Write against them, and choose OPA or rego4k as the engine. WasmModules.rebuiltBy(opa) gives a shaken bundle new wasm modules.
modules/opa/command-line rego4k-opa-command-line Opa.cli(): all the capabilities, with the opa binary and the JDK's ProcessBuilder.
modules/opa/server rego4k-opa-server OpaServer: the capabilities of OPA's REST API (evaluation and partial evaluation), through an http4k HttpHandler, for OPA's server or rego4k's server.
modules/opa/embedded rego4k-opa-embedded Toolchain.embedded(rego): the capabilities that rego4k shares with OPA, with rego4k in the process.
modules/signing/utils rego4k-signing-utils The JWS, the signature algorithms and the PEM keys of OPA, and the canonical JSON form of a value. Bundle signing and decision signing use them.
modules/bundles/signing rego4k-bundles-signing The verification and the signing of OPA bundles, with the same algorithms and options as OPA.
modules/signing/verifier rego4k-signing-verifier The verification of a signed decision by its signature, for a system that receives decisions. No engine, bundles or builtins.
modules/signing/signer rego4k-signing-signer Signed decisions: the output of a query as an in-toto attestation (a format for software attestations) in a DSSE envelope (a format for signatures), and its verification by a new evaluation.
modules/server/core rego4k-server-core The base of the decision server on http4k: DecisionServer and its modules, the hosted bundles, and the plumbing of OPA's REST API. See modules/server.
modules/server/policies rego4k-server-policies OPA's Data API, Query API and health check for the bundles of the server.
modules/testing/core rego4k-testing-core The Rego tests of policies, as opa test runs them: TestRunner, the results of the tests and test cases, and the text of opa test (PrettyReport).
modules/testing/junit rego4k-testing-junit RegoTests.junit: the Rego tests as JUnit 5 dynamic tests, with the file and the line of each test rule.
modules/cli/core rego4k-cli-core The base of the command line: Command, Flags (read as OPA reads them) and Cli, the dispatch to the commands.
modules/cli/opa rego4k-cli-opa The commands of opa with rego4k: eval, check, fmt, parse, test and build, with OPA's flags, output and exit codes. A test runs 216 command lines through opa and rego4k, and compares them.
modules/cli/decision-signing rego4k-cli-decision-signing The commands of signed decisions: sign-decision, verify-decision, reproduce-decision and sign-input.
modules/cli/shaking rego4k-cli-shaking rego4k shake: the tree shaking of a bundle for its entrypoints, its dry run, and with --wasm, the build of its wasm modules by opa build -t wasm.
modules/cli/server rego4k-cli-server rego4k run --server: the decision server, with the flags of opa run --server that it can honour, and flags for the debugger, tree shaking, the docs and signed decisions. A test compares its Data API with opa run --server.
modules/cli/full rego4k-cli-full rego4k (just cli): the commands of each module in modules/cli, with OPA's builtins, in one runnable jar.
modules/formatter rego4k-formatter A formatter for Rego v1 modules. Its output is the output of opa fmt of OPA 1.23.0, byte for byte.
modules/server/lsp rego4k-server-lsp A language server for Rego (LSP, with lsp4j): the diagnostics of the parser and the compiler, go to definition, references, hover, the outline and formatting.
modules/server/debugger rego4k-server-debugger A policy debugger in the browser: it steps through the Rego while the evaluator evaluates it, and shows the bindings, the part of the input that each step reads, and the output document as the rules make it. ./gradlew :server-debugger:run. It can also run on the decision server, below a path such as /debugger, behind its authentication filter, with the bundles of the server.
modules/server/signing rego4k-server-signing The signed decisions of the decision server, with a key and its certificate chain. Each signed decision names the principal that the authentication filter of the application gives.
modules/server/shaking rego4k-server-shaking The dry run of tree shaking for the bundles of the decision server: for a bundle and its entrypoints, the lines that tree shaking keeps, deletes and adds in each file, as JSON (/v1/shaking) and as a page in the browser below /shaking, with the explorer and the code view of the debugger.
modules/bom rego4k-bom A Maven BOM that names the same version for each module in modules. The build makes the list from the modules.
verification/benchmark The benchmark against native OPA and OPA's WebAssembly build.
verification/fuzz Differential testing against native OPA, with generated and mutated cases (./gradlew fuzz).
verification/capabilities The contract tests of the capabilities of OPA: one suite of cases for each capability, against each engine.
verification/mutation Mutation testing with PIT, the mutation testing tool for the JVM (./gradlew pitest), to find the gaps in the tests.
verification/soak The long run of fuzzing and mutation testing on one machine (./gradlew soak -Phours=48).
verification/unused-code The check that fails the build if a declaration has no use.