Package com.github.ambry.frontend
Interface SecurityService
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
public interface SecurityService extends java.io.Closeable
Responsible for performing any security validations on the Rest request and response. Validations could involve authentication, authorization, security checks and so on which the implementation can decide. This could also involve setting headers while responding, based on the request. Exceptions are returned viaCallback
s on any validation failure.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.concurrent.Future<java.lang.Void>
postProcessRequest(RestRequest restRequest)
Similar topostProcessRequest(RestRequest, Callback)
but returns aFuture
instead of requiring a callback.void
postProcessRequest(RestRequest restRequest, Callback<java.lang.Void> callback)
Performs security validations (if any) on theRestRequest
when it has been fully parsed.default java.util.concurrent.Future<java.lang.Void>
preProcessRequest(RestRequest restRequest)
Similar topreProcessRequest(RestRequest, Callback)
but returns aFuture
instead of requiring a callback.void
preProcessRequest(RestRequest restRequest, Callback<java.lang.Void> callback)
Performs security validations (if any) before any processing of therestRequest
begins and invokes thecallback
once done.default java.util.concurrent.Future<java.lang.Void>
processRequest(RestRequest restRequest)
Similar toprocessRequest(RestRequest, Callback)
but returns aFuture
instead of requiring a callback.void
processRequest(RestRequest restRequest, Callback<java.lang.Void> callback)
Performs security validations (if any) on theRestRequest
asynchronously and invokes theCallback
when the validation completes.default java.util.concurrent.Future<java.lang.Void>
processResponse(RestRequest restRequest, RestResponseChannel responseChannel, BlobInfo blobInfo)
Similar toprocessResponse(RestRequest, RestResponseChannel, BlobInfo, Callback)
but returns aFuture
instead of requiring a callback.void
processResponse(RestRequest restRequest, RestResponseChannel responseChannel, BlobInfo blobInfo, Callback<java.lang.Void> callback)
Performs security validations (if any) on the response forRestRequest
asynchronously, sets headers if need be and invokes theCallback
when the validation completes.
-
-
-
Method Detail
-
preProcessRequest
void preProcessRequest(RestRequest restRequest, Callback<java.lang.Void> callback)
Performs security validations (if any) before any processing of therestRequest
begins and invokes thecallback
once done.- Parameters:
restRequest
- theRestRequest
to process.callback
- the callback to invoke once processing is finished.
-
processRequest
void processRequest(RestRequest restRequest, Callback<java.lang.Void> callback)
Performs security validations (if any) on theRestRequest
asynchronously and invokes theCallback
when the validation completes.- Parameters:
restRequest
-RestRequest
upon which validations has to be performedcallback
- TheCallback
which will be invoked on the completion of the request. Cannot be null.
-
postProcessRequest
void postProcessRequest(RestRequest restRequest, Callback<java.lang.Void> callback)
Performs security validations (if any) on theRestRequest
when it has been fully parsed. That is, when theRestRequest
has been annotated with any additional arguments (like account and container). Invokes theCallback
when the validation is complete.- Parameters:
restRequest
-RestRequest
upon which validations has to be performedcallback
- TheCallback
which will be invoked on the completion of the request. Cannot be null.
-
processResponse
void processResponse(RestRequest restRequest, RestResponseChannel responseChannel, BlobInfo blobInfo, Callback<java.lang.Void> callback)
Performs security validations (if any) on the response forRestRequest
asynchronously, sets headers if need be and invokes theCallback
when the validation completes. Similar toprocessRequest(RestRequest, Callback)
, validations could involve security checks and setting some headers with the response.- Parameters:
restRequest
-RestRequest
whose response have to be validatedresponseChannel
- theRestResponseChannel
over which the response is sentblobInfo
- theBlobInfo
pertaining to the rest request madecallback
- TheCallback
which will be invoked on the completion of the request. Cannot be null.
-
preProcessRequest
default java.util.concurrent.Future<java.lang.Void> preProcessRequest(RestRequest restRequest)
Similar topreProcessRequest(RestRequest, Callback)
but returns aFuture
instead of requiring a callback.- Parameters:
restRequest
-RestRequest
upon which validations has to be performed- Returns:
- a
Future
that is completed when the pre-processing is done.
-
processRequest
default java.util.concurrent.Future<java.lang.Void> processRequest(RestRequest restRequest)
Similar toprocessRequest(RestRequest, Callback)
but returns aFuture
instead of requiring a callback.- Parameters:
restRequest
-RestRequest
upon which validations has to be performed- Returns:
- a
Future
that is completed when the processing is done.
-
postProcessRequest
default java.util.concurrent.Future<java.lang.Void> postProcessRequest(RestRequest restRequest)
Similar topostProcessRequest(RestRequest, Callback)
but returns aFuture
instead of requiring a callback.- Parameters:
restRequest
-RestRequest
upon which validations has to be performed- Returns:
- a
Future
that is completed when the post-processing is done.
-
processResponse
default java.util.concurrent.Future<java.lang.Void> processResponse(RestRequest restRequest, RestResponseChannel responseChannel, BlobInfo blobInfo)
Similar toprocessResponse(RestRequest, RestResponseChannel, BlobInfo, Callback)
but returns aFuture
instead of requiring a callback.- Parameters:
restRequest
-RestRequest
whose response have to be validatedresponseChannel
- theRestResponseChannel
over which the response is sentblobInfo
- theBlobInfo
pertaining to the rest request made- Returns:
- a
Future
that is completed when the processing is done.
-
-