git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/data-analysis/RConnector/2.1@134825 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0a08820546
commit
4bbc11545f
|
@ -7,6 +7,6 @@
|
||||||
<servlet name="org.gcube.data.analysis.rconnector.RConnector" entryPointName="connector"/>
|
<servlet name="org.gcube.data.analysis.rconnector.RConnector" entryPointName="connector"/>
|
||||||
</servlets> -->
|
</servlets> -->
|
||||||
<local-persistence location='target' />
|
<local-persistence location='target' />
|
||||||
<exclude>/disconnect/*</exclude>
|
<exclude>/gcube/service/disconnect/*</exclude>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</context-param>
|
</context-param>
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>addUserScript</param-name>
|
<param-name>addUserScript</param-name>
|
||||||
<param-value>/root/Ruseradd.sh</param-value>
|
<param-value>/usr/local/bin/rusersadd</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>storedKeyPath</param-name>
|
<param-name>storedKeyPath</param-name>
|
||||||
|
|
|
@ -75,17 +75,17 @@ public class ConfigFileWriter {
|
||||||
sb.append(info.getDatabase().getDatabaseAddress()+";");
|
sb.append(info.getDatabase().getDatabaseAddress()+";");
|
||||||
sb.append(info.getDatabase().getDatabaseName()+";");
|
sb.append(info.getDatabase().getDatabaseName()+";");
|
||||||
sb.append(info.getDatabase().getDatabaseUsername()+";");
|
sb.append(info.getDatabase().getDatabaseUsername()+";");
|
||||||
sb.append(info.getDatabase().getDatabasePassword()+"\n");
|
sb.append(info.getDatabase().getDatabasePassword()+";");
|
||||||
|
sb.append(info.getUsername()+";");
|
||||||
|
sb.append(info.getToken()+"\n");
|
||||||
|
|
||||||
try{
|
try(FileWriter fw = new FileWriter(pathToFile,false)){
|
||||||
FileWriter fw = new FileWriter(pathToFile,false);
|
|
||||||
fw.write(sb.toString());
|
fw.write(sb.toString());
|
||||||
fw.close();
|
|
||||||
log.debug("file written");
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
log.error("error writing config file",e);
|
log.error("error writing config file",e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
log.debug("file written with line {}",sb.toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
||||||
public class Info {
|
public class Info {
|
||||||
|
|
||||||
private String username ="";
|
private String username ="";
|
||||||
|
private String token ="";
|
||||||
private String tableName ="" ;
|
private String tableName ="" ;
|
||||||
private String userTableName ="" ;
|
private String userTableName ="" ;
|
||||||
private String fields ="";
|
private String fields ="";
|
||||||
|
|
|
@ -12,6 +12,7 @@ import javax.inject.Singleton;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.common.database.DatabaseEndpointIdentifier;
|
import org.gcube.common.database.DatabaseEndpointIdentifier;
|
||||||
import org.gcube.common.database.DatabaseProvider;
|
import org.gcube.common.database.DatabaseProvider;
|
||||||
import org.gcube.common.database.endpoint.DatabaseEndpoint;
|
import org.gcube.common.database.endpoint.DatabaseEndpoint;
|
||||||
|
@ -61,7 +62,7 @@ public class InfoRetriever {
|
||||||
info.setQueryColumns(queryOrder.toString());
|
info.setQueryColumns(queryOrder.toString());
|
||||||
info.setUsername(userName);
|
info.setUsername(userName);
|
||||||
info.setUserTableName(tr.getName());
|
info.setUserTableName(tr.getName());
|
||||||
|
info.setToken(SecurityTokenProvider.instance.get());
|
||||||
info.setDatabase(retrievedatabaseInfo());
|
info.setDatabase(retrievedatabaseInfo());
|
||||||
|
|
||||||
log.info("retrieved info are "+info);
|
log.info("retrieved info are "+info);
|
||||||
|
|
|
@ -23,6 +23,7 @@ import javax.xml.bind.DatatypeConverter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
||||||
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
|
|
||||||
@Path("connect/")
|
@Path("connect/")
|
||||||
|
@ -68,6 +69,8 @@ public class Resource {
|
||||||
String scriptToExecute = context.getInitParameter("addUserScript");
|
String scriptToExecute = context.getInitParameter("addUserScript");
|
||||||
if (AuthorizationProvider.instance.get().getClient().getId() == null ) return Response.serverError().build();
|
if (AuthorizationProvider.instance.get().getClient().getId() == null ) return Response.serverError().build();
|
||||||
Info info = new Info();
|
Info info = new Info();
|
||||||
|
info.setUsername(AuthorizationProvider.instance.get().getClient().getId());
|
||||||
|
info.setToken(SecurityTokenProvider.instance.get());
|
||||||
if (!writer.write(info, AuthorizationProvider.instance.get().getClient().getId(), usersHome, filename, scriptToExecute)) return Response.serverError().build();
|
if (!writer.write(info, AuthorizationProvider.instance.get().getClient().getId(), usersHome, filename, scriptToExecute)) return Response.serverError().build();
|
||||||
return createResponse(AuthorizationProvider.instance.get().getClient().getId());
|
return createResponse(AuthorizationProvider.instance.get().getClient().getId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<body>
|
<body>
|
||||||
<h2 style="text-align:center;">Rsutdio session inactive<h2>
|
<h2 style="text-align:center;">Rsutdio session inactive<h2>
|
||||||
<h3 style="text-align:center;">log in using TabularData portlet from the i-marine portal<h3>
|
<h3 style="text-align:center;">log in using from the portal<h3>
|
||||||
</body>
|
</body>
|
Loading…
Reference in New Issue