Updated to Auth 2.0
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/github-connector@131954 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
82f6c8019e
commit
f46e8f982f
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/github-connector-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/github-connector-1.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
@ -25,5 +25,5 @@
|
|||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="target/github-connector-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/github-connector-1.1.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets.widgets.githubconnector.1-1-0"
|
||||
date="2016-10-01">
|
||||
<Change>Removed accesslogger dependency</Change>
|
||||
<Change>Updated to Auth 2.0</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets.widgets.githubconnector.1-0-0"
|
||||
date="2016-07-01">
|
||||
<Change>First release</Change>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -12,7 +12,7 @@
|
|||
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>github-connector</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>github-connector</description>
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.ArrayList;
|
|||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.gcube.application.framework.accesslogger.library.impl.AccessLogger;
|
||||
import org.gcube.application.framework.core.session.ASLSession;
|
||||
import org.gcube.portlets.widgets.githubconnector.client.rpc.GitHubConnectorService;
|
||||
import org.gcube.portlets.widgets.githubconnector.server.git.GitConnectorService;
|
||||
|
@ -28,8 +27,7 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
|||
@SuppressWarnings("serial")
|
||||
public class GitHubConnectorServiceImpl extends RemoteServiceServlet implements
|
||||
GitHubConnectorService {
|
||||
public static AccessLogger accountinglog = AccessLogger.getAccessLogger();
|
||||
|
||||
|
||||
private static Logger logger = LoggerFactory
|
||||
.getLogger(GitHubConnectorServiceImpl.class);
|
||||
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
*/
|
||||
package org.gcube.portlets.widgets.githubconnector.server;
|
||||
|
||||
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
@ -62,18 +57,11 @@ public class SessionUtil {
|
|||
return aslSession;
|
||||
}
|
||||
|
||||
public static String getToken(ASLSession aslSession) {
|
||||
public static String getToken(ASLSession aslSession)
|
||||
throws ServiceException {
|
||||
String token = null;
|
||||
if (Constants.DEBUG_MODE) {
|
||||
List<String> userRoles = new ArrayList<>();
|
||||
userRoles.add(Constants.DEFAULT_ROLE);
|
||||
/*
|
||||
* if (aslSession.getUsername().compareTo("lucio.lelii") == 0)
|
||||
* userRoles.add("VRE-Manager");
|
||||
*/
|
||||
token = authorizationService().build().generate(
|
||||
aslSession.getUsername(), userRoles);
|
||||
|
||||
token = Constants.DEFAULT_TOKEN;
|
||||
} else {
|
||||
token = aslSession.getSecurityToken();
|
||||
}
|
||||
|
|
|
@ -16,8 +16,10 @@ public class Constants {
|
|||
public static final String GITHUB_CONNECTOR_LANG = "GitHubConnectorLang";
|
||||
|
||||
public static final String DEFAULT_USER = "giancarlo.panichi";
|
||||
public final static String DEFAULT_SCOPE = "/gcube/devNext/NextNext";
|
||||
public final static String DEFAULT_TOKEN = "6af6eaff-35bd-4405-b747-f63246d0212a-98187548";
|
||||
public static final String DEFAULT_ROLE = "OrganizationMember";
|
||||
public static final String DEFAULT_SCOPE = "/gcube/devsec/devVRE";
|
||||
|
||||
public static final String DEFAULT_FOLDER_ID = "";
|
||||
public static final String DEFAULT_REPOSITORY_OWNER = "jonan";
|
||||
public static final String DEFAULT_REPOSITORY_NAME = "jonan.github.io";
|
||||
|
|
Loading…
Reference in New Issue