Class RestAuthorizationFilter
java.lang.Object
com.svenruppert.jsentinel.rest.RestAuthorizationFilter
Authorizes a REST request before the protected handler is executed.
-
Constructor Summary
ConstructorsConstructorDescriptionRestAuthorizationFilter(RestSubjectResolver subjectResolver) Creates a REST authorization filter. -
Method Summary
Modifier and TypeMethodDescriptionvoidauthorizeAndHandle(RestRequest request, RestResponse response, RestHandler handler, AnnotatedElement securedElement) Authorizes and executes the handler when access is granted.voidauthorizeAndHandle(RestRequest request, RestResponse response, RestHandler handler, AnnotatedElement securedElement, String operation, Map<String, Object> attributes) Authorizes and executes the handler when access is granted.
-
Constructor Details
-
RestAuthorizationFilter
Creates a REST authorization filter.- Parameters:
subjectResolver- subject resolver
-
-
Method Details
-
authorizeAndHandle
public void authorizeAndHandle(RestRequest request, RestResponse response, RestHandler handler, AnnotatedElement securedElement) Authorizes and executes the handler when access is granted.- Parameters:
request- requestresponse- responsehandler- protected handlersecuredElement- method or class carrying a security annotation
-
authorizeAndHandle
public void authorizeAndHandle(RestRequest request, RestResponse response, RestHandler handler, AnnotatedElement securedElement, String operation, Map<String, Object> attributes) Authorizes and executes the handler when access is granted.- Parameters:
request- requestresponse- responsehandler- protected handlersecuredElement- method or class carrying a security annotationoperation- operation nameattributes- additional attributes
-