Package com.cedarpolicy
Class BasicAuthorizationEngine
java.lang.Object
com.cedarpolicy.BasicAuthorizationEngine
- All Implemented Interfaces:
AuthorizationEngine
An authorization engine that is compiled in process. Communicated with via JNI.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionisAuthorized(AuthorizationRequest q, Slice slice) Asks whether the given AuthorizationRequestqis approved by the policies and entity hierarchy given in theslice.Asks whether the policies in the givenValidationRequestqare correct when validated against the schema it describes.
-
Constructor Details
-
BasicAuthorizationEngine
public BasicAuthorizationEngine()Construct a basic authorization engine.
-
-
Method Details
-
isAuthorized
Description copied from interface:AuthorizationEngineAsks whether the given AuthorizationRequestqis approved by the policies and entity hierarchy given in theslice.- Specified by:
isAuthorizedin interfaceAuthorizationEngine- Parameters:
q- The request to evaluateslice- The slice to evaluate against- Returns:
- The result of the request evaluation
- Throws:
AuthException- On failure to make the authorization request. Note that errors inside the authorization engine are included in theerrorsfield on the AuthorizationResponse.
-
validate
Description copied from interface:AuthorizationEngineAsks whether the policies in the givenValidationRequestqare correct when validated against the schema it describes.- Specified by:
validatein interfaceAuthorizationEngine- Parameters:
q- The request containing the policies to validate and the schema to validate them against.- Returns:
- A
ValidationResponsedescribing any validation errors found in the policies. - Throws:
BadRequestException- if any errors were found in the syntax of the policies.AuthException- if any internal errors occurred while validating the policies.
-