parent
12d5b2a1ad
commit
bacba3984c
|
@ -20,6 +20,9 @@ start the docker container
|
|||
|
||||
test urls (replace {{TOKEN}} with your token):
|
||||
|
||||
|
||||
http://localhost:8080/helloworld/guest
|
||||
|
||||
http://localhost:8080/helloworld/details?gcube-token={{TOKEN}}
|
||||
http://localhost:8080/helloworld/hello/details?gcube-token={{TOKEN}}
|
||||
|
||||
|
|
|
@ -4,4 +4,5 @@ version: 1.0.0
|
|||
description: HelloWorld Service
|
||||
excludes:
|
||||
- path: /excluded
|
||||
- path: /guest
|
||||
- path: /api-docs/*
|
|
@ -9,6 +9,7 @@ import javax.ws.rs.core.Application;
|
|||
import org.gcube.service.helloworld.services.AuthorizedMethods;
|
||||
import org.gcube.service.helloworld.services.ExcludeAuthorization;
|
||||
import org.gcube.service.helloworld.services.HelloService;
|
||||
import org.gcube.service.helloworld.services.TestAuthorizationService;
|
||||
|
||||
|
||||
@ApplicationPath("")
|
||||
|
@ -18,8 +19,9 @@ public class HelloWorld extends Application {
|
|||
final Set<Class<?>> classes = new HashSet<Class<?>>();
|
||||
// register resources classes implementing Servlets
|
||||
classes.add(HelloService.class);
|
||||
classes.add(AuthorizedMethods.class);
|
||||
classes.add(ExcludeAuthorization.class);
|
||||
classes.add(TestAuthorizationService.class);
|
||||
|
||||
return classes;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.gcube.common.security.secrets.Secret;
|
|||
import org.gcube.smartgears.utils.InnerMethodName;
|
||||
|
||||
@Path("auth")
|
||||
public class AuthorizedMethods {
|
||||
public class TestAuthorizationService {
|
||||
|
||||
private static final String ALLOWED_ROLE = "myRole";
|
||||
private static final String ALLOWED_ROLE_ORG = "OrganizationMember";
|
|
@ -6,10 +6,10 @@ import javax.ws.rs.Path;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Path("excluded")
|
||||
public class ExcludeAuthorization {
|
||||
@Path("guest")
|
||||
public class ExcludeAuthorizationService {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(ExcludeAuthorization.class);
|
||||
private final Logger logger = LoggerFactory.getLogger(ExcludeAuthorizationService.class);
|
||||
|
||||
|
||||
/**
|
Loading…
Reference in New Issue