Package com.styra.opa.springboot.input
Interface OPAInputContextCustomizer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
By defining a bean which implements this interface, clients could customize OPA
input.context.-
Method Summary
Modifier and TypeMethodDescriptioncustomize(Authentication authentication, RequestAuthorizationContext requestAuthorizationContext, Map<String, Object> context) CustomizescontextMap.
-
Method Details
-
customize
Map<String,Object> customize(Authentication authentication, RequestAuthorizationContext requestAuthorizationContext, Map<String, Object> context) - Parameters:
context- contains:- "type": "http"
(configurable via
opa.request.context.typeproperty) - "host":
ServletRequest.getRemoteHost() - "ip":
ServletRequest.getRemoteAddr() - "port":
ServletRequest.getRemotePort() - "data":
ContextDataProvider.getContextData(Supplier, RequestAuthorizationContext)(if aContextDataProvidergets passed to anOPAAuthorizationManagerconstructor)
- "type": "http"
(configurable via
- Returns:
- if not null, should at least contains this key:
-