Package com.styra.opa.springboot
Class OPAResponseContext
java.lang.Object
com.styra.opa.springboot.OPAResponseContext
This class models the data to be returned from an OPA Spring Boot SDK policy
under the context key.
This corresponds to the Context object in the AuthZen spec, see:
https://openid.github.io/authzen/#section-5.4
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetData()
getId()
getReasonForDecision
(String searchKey) This method selects an appropriate reason to use for creating Spring authorization decisions.void
The extra 'data' field allows for the OPA policy to pass back arbitrary structured data in addition to the expected reason information.void
void
setReasonAdmin
(Map<String, String> newReasonAdmin) void
setReasonUser
(Map<String, String> newReasonUser)
-
Constructor Details
-
OPAResponseContext
public OPAResponseContext()
-
-
Method Details
-
getId
-
setId
-
getReasonAdmin
-
setReasonAdmin
-
getReasonUser
-
setReasonUser
-
setData
The extra 'data' field allows for the OPA policy to pass back arbitrary structured data in addition to the expected reason information. -
getData
-
getReasonForDecision
This method selects an appropriate reason to use for creating Spring authorization decisions. Currently, it will select the search key if it is present in the reason_user object, and if not it will select the key which sorts first from reason_user. It will not consider data in reason_admin.
-