Jackson-based OPA IR deserialization for the java-opa-sdk.
This module provides the JacksonPolicyReader, a PolicyReader SPI implementation that deserializes OPA Intermediate Representation (IR) plans using Jackson. It is automatically discovered at runtime via java.util.ServiceLoader when loading bundles with TarballBundleLoader.
When the evaluator loads a bundle (e.g., bundle.tar.gz), it uses ServiceLoader to find a PolicyReader implementation. This module provides that implementation, which:
- Reads the
plan.jsonfrom the bundle - Deserializes the IR using custom Jackson deserializers registered via
IrModule - Returns the parsed policy plan to the evaluator engine
jackson-databind- Core JSON processingjackson-dataformat-yaml- YAML support for configuration filesjackson-datatype-jsr310- Java 8 date/time type support
No direct usage is required. Simply include this module on the classpath and it will be discovered automatically:
// TarballBundleLoader uses ServiceLoader to find JacksonPolicyReader
Engine engine = new Engine.Builder()
.withBundleLoader(new TarballBundleLoader("authz", Path.of("examples/policy.tar.gz")))
.withEntrypoint("example/allow")
.build();| Class | Description |
|---|---|
JacksonPolicyReader |
PolicyReader SPI implementation using Jackson |
IrModule |
Jackson module registering custom IR type deserializers |