Class ConstantContextDataProvider
java.lang.Object
io.github.open_policy_agent.opa.springboot.ConstantContextDataProvider
- All Implemented Interfaces:
ContextDataProvider
This helper class implements
ContextDataProvider and always returns
the same constant value passed in the
constructor. This is useful for tests, and also for situations where the
extra data to inject does not change during
runtime.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContextData(Supplier<? extends Authentication> authentication, RequestAuthorizationContext object)
-
Constructor Details
-
ConstantContextDataProvider
-
-
Method Details
-
getContextData
public Object getContextData(Supplier<? extends Authentication> authentication, RequestAuthorizationContext object) - Specified by:
getContextDatain interfaceContextDataProvider
-