Interface CrestAuthorizationModule
-
public interface CrestAuthorizationModule
A
CrestAuthorizationModule
authorizes client REST requests asynchronously.A module implementation should assume it may be used to authorize different requests from different clients. A module should also assume it may be used concurrently by multiple callers. It is the module implementation's responsibility to properly save and restore state as necessary. A module that does not need to do so may remain completely stateless.
- Since:
- 1.5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Promise<AuthorizationResult,ResourceException>
authorizeAction(Context context, ActionRequest request)
Authorizes a received REST action request.Promise<AuthorizationResult,ResourceException>
authorizeCreate(Context context, CreateRequest request)
Authorizes a received REST create request.Promise<AuthorizationResult,ResourceException>
authorizeDelete(Context context, DeleteRequest request)
Authorizes a received REST delete request.Promise<AuthorizationResult,ResourceException>
authorizePatch(Context context, PatchRequest request)
Authorizes a received REST patch request.Promise<AuthorizationResult,ResourceException>
authorizeQuery(Context context, QueryRequest request)
Authorizes a received REST query request.Promise<AuthorizationResult,ResourceException>
authorizeRead(Context context, ReadRequest request)
Authorizes a received REST read request.Promise<AuthorizationResult,ResourceException>
authorizeUpdate(Context context, UpdateRequest request)
Authorizes a received REST update request.String
getName()
Returns the name of the authorization module.
-
-
-
Method Detail
-
getName
String getName()
Returns the name of the authorization module.- Returns:
- The module name.
-
authorizeCreate
Promise<AuthorizationResult,ResourceException> authorizeCreate(Context context, CreateRequest request)
Authorizes a received REST create request.
This method conveys the outcome of its authorization either by returning an
AuthorizationResult
value or anResourceException
- Parameters:
context
- TheContext
representing the context of the request.request
- TheCreateRequest
to authorize.- Returns:
- A
Promise
representing the result of the method call. The result of thePromise
, when the method completes successfully, will be anAuthorizationResult
containing the result of the authorization, or will be anResourceException
detailing the cause of the failure.
-
authorizeRead
Promise<AuthorizationResult,ResourceException> authorizeRead(Context context, ReadRequest request)
Authorizes a received REST read request.
This method conveys the outcome of its authorization either by returning an
AuthorizationResult
value or anResourceException
- Parameters:
context
- TheContext
representing the context of the request.request
- TheReadRequest
to authorize.- Returns:
- A
Promise
representing the result of the method call. The result of thePromise
, when the method completes successfully, will be anAuthorizationResult
containing the result of the authorization, or will be anResourceException
detailing the cause of the failure.
-
authorizeUpdate
Promise<AuthorizationResult,ResourceException> authorizeUpdate(Context context, UpdateRequest request)
Authorizes a received REST update request.
This method conveys the outcome of its authorization either by returning an
AuthorizationResult
value or anResourceException
- Parameters:
context
- TheContext
representing the context of the request.request
- TheUpdateRequest
to authorize.- Returns:
- A
Promise
representing the result of the method call. The result of thePromise
, when the method completes successfully, will be anAuthorizationResult
containing the result of the authorization, or will be anResourceException
detailing the cause of the failure.
-
authorizeDelete
Promise<AuthorizationResult,ResourceException> authorizeDelete(Context context, DeleteRequest request)
Authorizes a received REST delete request.
This method conveys the outcome of its authorization either by returning an
AuthorizationResult
value or anResourceException
- Parameters:
context
- TheContext
representing the context of the request.request
- TheDeleteRequest
to authorize.- Returns:
- A
Promise
representing the result of the method call. The result of thePromise
, when the method completes successfully, will be anAuthorizationResult
containing the result of the authorization, or will be anResourceException
detailing the cause of the failure.
-
authorizePatch
Promise<AuthorizationResult,ResourceException> authorizePatch(Context context, PatchRequest request)
Authorizes a received REST patch request.
This method conveys the outcome of its authorization either by returning an
AuthorizationResult
value or anResourceException
- Parameters:
context
- TheContext
representing the context of the request.request
- ThePatchRequest
to authorize.- Returns:
- A
Promise
representing the result of the method call. The result of thePromise
, when the method completes successfully, will be anAuthorizationResult
containing the result of the authorization, or will be anResourceException
detailing the cause of the failure.
-
authorizeAction
Promise<AuthorizationResult,ResourceException> authorizeAction(Context context, ActionRequest request)
Authorizes a received REST action request.
This method conveys the outcome of its authorization either by returning an
AuthorizationResult
value or anResourceException
- Parameters:
context
- TheContext
representing the context of the request.request
- TheActionRequest
to authorize.- Returns:
- A
Promise
representing the result of the method call. The result of thePromise
, when the method completes successfully, will be anAuthorizationResult
containing the result of the authorization, or will be anResourceException
detailing the cause of the failure.
-
authorizeQuery
Promise<AuthorizationResult,ResourceException> authorizeQuery(Context context, QueryRequest request)
Authorizes a received REST query request.
This method conveys the outcome of its authorization either by returning an
AuthorizationResult
value or anResourceException
- Parameters:
context
- TheContext
representing the context of the request.request
- TheQueryRequest
to authorize.- Returns:
- A
Promise
representing the result of the method call. The result of thePromise
, when the method completes successfully, will be anAuthorizationResult
containing the result of the authorization, or will be anResourceException
detailing the cause of the failure.
-
-