Package com.styra.opa.springboot
Class ConstantContextDataProvider
java.lang.Object
com.styra.opa.springboot.ConstantContextDataProvider
- All Implemented Interfaces:
ContextDataProvider
This helper class allows creating a ContextDataProvider which always returns
the same constant value. This is useful for tests, and also for situations
where the extra data to inject does not change during runtime.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetContextData
(Supplier<Authentication> authentication, RequestAuthorizationContext object)
-
Constructor Details
-
ConstantContextDataProvider
-
-
Method Details
-
getContextData
public Object getContextData(Supplier<Authentication> authentication, RequestAuthorizationContext object) - Specified by:
getContextData
in interfaceContextDataProvider
-