Package com.cedarpolicy.model
Class AuthorizationRequest
java.lang.Object
com.cedarpolicy.model.AuthorizationRequest
An authorization request consists of a principal, action, and resource as well as a context mapping
strings to Cedar values. When evaluating the request against a slice, the authorization engine
determines if the policies allow for the given principal to perform the given action against the
given resource.
An optional schema can be provided, but will not be used for validation unless you call validate(). The schema is provided to allow parsing Entities from JSON without escape sequences (in general, you don't need to worry about this if you construct your entities via the EntityUID class).
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringEUID of the action in the request.Key/Value map representing the context of the request.EUID of the principal in the request.EUID of the resource in the request.JSON object representing the Schema. -
Constructor Summary
ConstructorsConstructorDescriptionAuthorizationRequest(String principalEUID, String actionEUID, String resourceEUID, Map<String, Value> context) Create a request in the empty context.AuthorizationRequest(Optional<String> principalEUID, String actionEUID, Optional<String> resourceEUID, Optional<Map<String, Value>> context, Optional<Schema> schema) Create an authorization request from the EUIDs and Context. -
Method Summary
-
Field Details
-
principalEUID
EUID of the principal in the request. -
actionEUID
EUID of the action in the request. -
resourceEUID
EUID of the resource in the request. -
context
Key/Value map representing the context of the request. -
schema
JSON object representing the Schema.
-
-
Constructor Details
-
AuthorizationRequest
public AuthorizationRequest(Optional<String> principalEUID, String actionEUID, Optional<String> resourceEUID, Optional<Map<String, Value>> context, Optional<Schema> schema) Create an authorization request from the EUIDs and Context.- Parameters:
principalEUID- Principal's EUID.actionEUID- Action's EUID.resourceEUID- Resource's EUID.context- Key/Value context.schema- Schema (optional).
-
AuthorizationRequest
public AuthorizationRequest(String principalEUID, String actionEUID, String resourceEUID, Map<String, Value> context) Create a request in the empty context.- Parameters:
principalEUID- Principal's EUID.actionEUID- Action's EUID.resourceEUID- Resource's EUID.context- Key/Value context.
-
-
Method Details