Package org.sdase.commons.server.opa
Class OpaBundle.Builder<C extends io.dropwizard.Configuration>
- java.lang.Object
-
- org.sdase.commons.server.opa.OpaBundle.Builder<C>
-
- All Implemented Interfaces:
OpaBundle.OpaBuilder<C>
,OpaBundle.OpaExtensionsBuilder<C>
,OpaBundle.ProviderBuilder
public static class OpaBundle.Builder<C extends io.dropwizard.Configuration> extends java.lang.Object implements OpaBundle.ProviderBuilder, OpaBundle.OpaExtensionsBuilder<C>, OpaBundle.OpaBuilder<C>
-
-
Method Summary
All Methods Instance Methods Concrete 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.<T extends io.dropwizard.Configuration>
OpaBundle.OpaExtensionsBuilder<T>withOpaConfigProvider(OpaConfigProvider<T> opaConfigProvider)
OpaBundle.OpaBuilder<C>
withOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry)
OpaBundle.OpaExtensionsBuilder<C>
withoutHeadersExtension()
Disable theOpaInputHeadersExtension
to not forward any headers to the Open Policy Agent.
-
-
-
Method Detail
-
withOpaConfigProvider
public <T extends io.dropwizard.Configuration> OpaBundle.OpaExtensionsBuilder<T> withOpaConfigProvider(OpaConfigProvider<T> opaConfigProvider)
- Specified by:
withOpaConfigProvider
in interfaceOpaBundle.ProviderBuilder
-
withoutHeadersExtension
public OpaBundle.OpaExtensionsBuilder<C> withoutHeadersExtension()
Description copied from interface:OpaBundle.OpaExtensionsBuilder
Disable theOpaInputHeadersExtension
to not forward any headers to the Open Policy Agent.- Specified by:
withoutHeadersExtension
in interfaceOpaBundle.OpaExtensionsBuilder<C extends io.dropwizard.Configuration>
- Returns:
- the buider
-
withInputExtension
public <T> OpaBundle.OpaBuilder<C> withInputExtension(java.lang.String namespace, OpaInputExtension<T> extension)
Description copied from interface:OpaBundle.OpaBuilder
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
.- Specified by:
withInputExtension
in interfaceOpaBundle.OpaBuilder<C extends io.dropwizard.Configuration>
- 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
-
withOpenTelemetry
public OpaBundle.OpaBuilder<C> withOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry)
- Specified by:
withOpenTelemetry
in interfaceOpaBundle.OpaBuilder<C extends io.dropwizard.Configuration>
-
build
public OpaBundle<C> build()
- Specified by:
build
in interfaceOpaBundle.OpaBuilder<C extends io.dropwizard.Configuration>
-
-