Class OPAAuthorizationManager

java.lang.Object
com.styra.opa.springboot.OPAAuthorizationManager
All Implemented Interfaces:
AuthorizationManager<RequestAuthorizationContext>

@Component public class OPAAuthorizationManager extends Object implements AuthorizationManager<RequestAuthorizationContext>
This class implements AuthorizationManager which wraps the OPA Java SDK. Authorization will be done in check(Supplier, RequestAuthorizationContext) and verify(Supplier, RequestAuthorizationContext) by:
  1. constructing an input (map) based on Authentication and RequestAuthorizationContext
  2. sending an HTTP request with the input as the request body to the OPA server
  3. receiving the output as an OPAResponse and using it for authorization
OPA input (request body) and response are compliant with the AuthZEN spec.