View Javadoc

1   package com.atlassian.asap.core.server.jersey;
2   
3   import com.atlassian.asap.api.Jwt;
4   import com.atlassian.asap.api.exception.AuthorizationFailedException;
5   import com.sun.jersey.api.core.HttpRequestContext;
6   
7   /**
8    * Authorization strategy for Jersey requests.
9    */
10  public interface JerseyRequestAuthorizer {
11      /**
12       * Tries to authorize an authentic JWT token to perform a request.
13       *
14       * @param authenticJwt   an authentic JWT token
15       * @param requestContext the request that is to be authorised
16       * @throws AuthorizationFailedException if the token is not authorized for this request
17       */
18      void authorize(Jwt authenticJwt, HttpRequestContext requestContext) throws AuthorizationFailedException;
19  }