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) Customizescontext
Map
.
-
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.type
property) - "host":
ServletRequest.getRemoteHost()
- "ip":
ServletRequest.getRemoteAddr()
- "port":
ServletRequest.getRemotePort()
- "data":
ContextDataProvider.getContextData(Supplier, RequestAuthorizationContext)
(if aContextDataProvider
gets passed to anOPAAuthorizationManager
constructor)
- "type": "http"
(configurable via
- Returns:
- if not null, should at least contains this key:
-