Package org.sdase.commons.server.opa
Interface OpaBundle.OpaBuilder<C extends io.dropwizard.Configuration>
-
- All Known Subinterfaces:
OpaBundle.OpaExtensionsBuilder<C>
- All Known Implementing Classes:
OpaBundle.Builder
public static interface OpaBundle.OpaBuilder<C extends io.dropwizard.Configuration>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OpaBundle<C>
build()
<T> OpaBundle.OpaBuilder<C>
withInputExtension(java.lang.String namespace, OpaInputExtension<T> extension)
Register a customOpaInputExtension
that enriches the defaultOpaInput
with custom properties that are sent to the Open Policy Agent.OpaBundle.OpaBuilder<C>
withOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry)
-
-
-
Method Detail
-
withInputExtension
<T> OpaBundle.OpaBuilder<C> withInputExtension(java.lang.String namespace, OpaInputExtension<T> extension)
Register a customOpaInputExtension
that enriches the defaultOpaInput
with custom properties that are sent to the Open Policy Agent. Prefer authorization based on theconstraints
that are returned after policy execution.Please note that it is prohibited to override properties that are already set in the original
OpaInput
.- Type Parameters:
T
- the type of data that is added to the input- Parameters:
namespace
- the namespace is used as property name that the input should be accessible as in the OPA policyextension
- the extension to register- Returns:
- the builder
- Throws:
OpaBundle.HiddenOriginalPropertyException
- thrown if the namespace of an input extension interferes with a property name of the originalOpaInput
.OpaBundle.DuplicatePropertyException
- thrown if a namespace interferes with an already registered extension.
-
withOpenTelemetry
OpaBundle.OpaBuilder<C> withOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry)
-
-