minor fixes
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@133557 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
55eac59040
commit
30885e0361
|
@ -3,9 +3,6 @@
|
|||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<dependent-module archiveName="ckan-util-library-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-util-library/ckan-util-library">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="context-root" value="grsf-publisher-ws"/>
|
||||
<property name="java-output-path" value="/grsf-publisher-ws/target/classes"/>
|
||||
</wb-module>
|
||||
|
|
|
@ -18,7 +18,7 @@ public class ApplicationException implements ExceptionMapper<Exception> {
|
|||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ApplicationException.class);
|
||||
|
||||
public Response toResponse(Exception e) {
|
||||
logger.warn("ApplicationException invoked");
|
||||
logger.warn("ApplicationException invoked for error " + e);
|
||||
return Response
|
||||
.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())
|
||||
.type(MediaType.APPLICATION_JSON)
|
||||
|
|
|
@ -6,9 +6,11 @@ import java.io.IOException;
|
|||
|
||||
import javax.ws.rs.container.ContainerRequestContext;
|
||||
import javax.ws.rs.container.ContainerRequestFilter;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.MultivaluedMap;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
||||
|
@ -29,12 +31,18 @@ public class RequestsAuthAccountingFilter implements ContainerRequestFilter{
|
|||
|
||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(RequestsAuthAccountingFilter.class);
|
||||
private static final String AUTH_TOKEN = "gcube-token";
|
||||
|
||||
@Context UriInfo info;
|
||||
|
||||
@Override
|
||||
public void filter(ContainerRequestContext requestContext)
|
||||
throws IOException {
|
||||
|
||||
logger.info("Intercepted request, checking if it contains authorization token");
|
||||
String pathRequest = info.getAbsolutePath().toString();
|
||||
|
||||
if(pathRequest.contains("hello") || pathRequest.endsWith("rest/"))
|
||||
return;
|
||||
|
||||
// check if the request contains gcube-token
|
||||
String tokenInHeader = null, tokenAsQueryParameter = null;
|
||||
|
|
Reference in New Issue