Class OPAResponseContext

java.lang.Object
com.styra.opa.springboot.OPAResponseContext

public class OPAResponseContext extends Object
This class models the data to be returned from an OPA policy under the context key.

This corresponds to the Context object in the AuthZen spec.
  • Constructor Details

    • OPAResponseContext

      public OPAResponseContext()
  • Method Details

    • getReasonForDecision

      public String getReasonForDecision(String searchKey)
      This method selects an appropriate reason to use for creating AuthorizationDecisions. Currently, it will select the search key if it is present in the reasonUser, and if not it will select the key which sorts lexicographically first from the reasonUser. It will not consider data in the reasonAdmin.