moved to the new Authorization system
This commit is contained in:
parent
2e2fd2dc00
commit
08e598fc34
71
pom.xml
71
pom.xml
|
@ -14,7 +14,7 @@
|
|||
|
||||
<groupId>org.gcube.data.analysis</groupId>
|
||||
<artifactId>r-connector</artifactId>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
<version>3.0.0</version>
|
||||
<name>RConnector</name>
|
||||
<description>makes R available in the infrastructure</description>
|
||||
|
||||
|
@ -29,8 +29,8 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-smartgears-bom</artifactId>
|
||||
<version>LATEST</version>
|
||||
<artifactId>gcube-smartgears-bom</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -81,12 +81,10 @@
|
|||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>javax.ws.rs-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.containers</groupId>
|
||||
<artifactId>jersey-container-servlet</artifactId>
|
||||
<version>2.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.containers.glassfish</groupId>
|
||||
|
@ -114,7 +112,6 @@
|
|||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.0.13</version>
|
||||
</dependency>
|
||||
|
||||
<!-- weld -->
|
||||
|
@ -144,73 +141,11 @@
|
|||
<dependency>
|
||||
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
|
||||
<artifactId>jersey-test-framework-provider-simple</artifactId>
|
||||
<version>2.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<configuration>
|
||||
<warName>r-connector</warName>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-profile</id>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<phase>process-resources</phase>
|
||||
<configuration>
|
||||
<outputDirectory>${webappDirectory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${distroDirectory}</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>${distroDirectory}/descriptor.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>servicearchive</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -5,7 +5,6 @@ import java.io.FileWriter;
|
|||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -23,7 +22,7 @@ public class ConfigFileWriter {
|
|||
if (!userDir.exists())
|
||||
userDir.mkdir();
|
||||
File configFile= new File(userDir, fileName);
|
||||
Utils.executeCommandLine(scriptToExecute,login, SecurityTokenProvider.instance.get(), ScopeProvider.instance.get());
|
||||
Utils.executeCommandLine(scriptToExecute,login, info.getToken(), ScopeProvider.instance.get());
|
||||
return writeFile(info, configFile);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@ import javax.ws.rs.core.Context;
|
|||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Path("disconnect")
|
||||
|
|
|
@ -20,8 +20,8 @@ import javax.ws.rs.core.NewCookie;
|
|||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -39,6 +39,7 @@ public class Resource {
|
|||
@Context ServletContext context;
|
||||
|
||||
|
||||
@Deprecated
|
||||
@Path("/{trId}")
|
||||
@GET
|
||||
public Response connect(@PathParam("trId") Long tabularResourceId) {
|
||||
|
@ -74,7 +75,7 @@ public class Resource {
|
|||
if (login == null ) return Response.serverError().build();
|
||||
Info info = new Info();
|
||||
info.setUsername(login);
|
||||
info.setToken(SecurityTokenProvider.instance.get());
|
||||
info.setToken(AccessTokenProvider.instance.get());
|
||||
if (!writer.write(info, login, usersHome, filename, scriptToExecute)) return Response.serverError().build();
|
||||
|
||||
return createResponse(AuthorizationProvider.instance.get().getClient().getId());
|
||||
|
|
Loading…
Reference in New Issue