nikolas.laskaris 2014-07-14 10:28:52 +00:00
parent 3124022120
commit 121e33dcde
6 changed files with 22 additions and 138 deletions

View File

@ -23,9 +23,9 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>

View File

@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.5"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.7"/>
</faceted-project>

27
pom.xml
View File

@ -9,8 +9,7 @@
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
<version>4.4.0-SNAPSHOT</version>
<version>4.5.0-SNAPSHOT</version>
<name>Application Support Layer Core</name>
<description>Library supporting dissemination of gCube content with OAI-ORE</description>
@ -40,11 +39,7 @@
-->
<dependencies>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-stub</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
@ -71,14 +66,7 @@
<version>1.6.4</version>
<scope>test</scope>
</dependency>
<!--
should be removed after release 3.2.0
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>[2.0.0, 3.0.0)</version>
</dependency>
-->
<dependency>
<groupId>org.gcube.resources</groupId>
<artifactId>registry-publisher</artifactId>
@ -97,14 +85,7 @@ should be removed after release 3.2.0
<artifactId>kxml2</artifactId>
<version>2.3.0</version>
</dependency>
<!--
should be removed after release 3.2.0
<dependency>
<groupId>net.sourceforge.addressing</groupId>
<artifactId>addressing</artifactId>
<version>1.1.1</version>
</dependency>
-->
</dependencies>

View File

@ -37,122 +37,21 @@ public class LDAPAuthenticationModule {
public boolean checkAuthentication(String username, String password) throws Exception {
logger.debug("The new security model should be integrated in ASL");
return true;
/*
logger.info("beginning authentication for " + username);
public boolean checkAuthentication(String username, String password) {
logger.info("beginning authentication for " + username);
LoginContext loginContext;
// Create the LoginContext
try {
loginContext = new LoginContext(contextName, new JaasCallbackHandler(username, password));
loginContext.login();
return true;
} catch (SecurityException e) {
logger.error("Exception:", e);
// Check user's credential
ExtendedGSSCredential cred = UserCredential.getPlainCredential(username, password);
logger.info("Getting credential from VOMS");
if (cred == null) {
logger.info("The credential does NOT exist");
throw new Exception("key4", e);
} else {
logger.info("The credential is OK!!!!!!!!!!!!");
return true;
}
return false;
} catch (LoginException e) {
logger.error("Exception:", e);
// Check user's credential
ExtendedGSSCredential cred = UserCredential.getPlainCredential(username, password);
logger.info("Getting credential from VOMS");
if (cred == null) {
logger.info("The credential does NOT exist");
throw new Exception("key4", e);
} else {
logger.info("The credential is OK!!!!!!!!!!!!");
return true;
}
return false;
}
// Attempt login
try {
loginContext.login();
} catch (FailedLoginException e) {
// Check user's credential
ExtendedGSSCredential cred = UserCredential.getPlainCredential(username, password);
// throw new Exception("key4", e);
if (cred == null) {
logger.error("Exception:", e);
logger.info("The credential is NULL!!!!!!!!!!!!");
return false;
} else {
logger.info("The credential is OK!!!!!!!!!!!!");
return true;
}
} catch (AccountExpiredException e) {
// Check user's credential
ExtendedGSSCredential cred = UserCredential.getPlainCredential(username, password);
// throw new Exception("key4", e);
if (cred == null) {
logger.error("Exception:", e);
logger.info("The credential is NULL!!!!!!!!!!!!");
return false;
} else {
logger.info("The credential is OK!!!!!!!!!!!!");
return true;
}
} catch (CredentialExpiredException e) {
// Check user's credential
ExtendedGSSCredential cred = UserCredential.getPlainCredential(username, password);
// throw new Exception("key4", e);
if (cred == null) {
logger.error("Exception:", e);
logger.info("The credential is NULL!!!!!!!!!!!!");
return false;
} else {
logger.info("The credential is OK!!!!!!!!!!!!");
return true;
}
} catch (Exception e) {
// Check user's credential
ExtendedGSSCredential cred = UserCredential.getPlainCredential(username, password);
// throw new Exception("key4", e);
if (cred == null) {
logger.error("Exception:", e);
logger.info("The credential is NULL!!!!!!!!!!!!");
return false;
} else {
logger.info("The credential is OK!!!!!!!!!!!!");
return true;
}
}
logger.info("ASL returning value true");
return true;
// Check user's credential
// ExtendedGSSCredential cred = UserCredential.getPlainCredential(username, password);
//
// logger.info("Getting credential from VOMS");
// if (cred == null) {
// logger.info("The credential does NOT exist");
// return false;
// } else {
// logger.info("The credential is OK!!!!!!!!!!!!");
// return true;
// }
*/
}

View File

@ -176,8 +176,10 @@ public class GenericResource implements GenericResourceInfoI {
while (iter.hasNext()) {
org.gcube.common.resources.gcore.GenericResource collection = iter.next().getValue();
Element body = collection.profile().body();
if(body.getElementsByTagName("type").getLength()>0) //means opensearch collection
if(body.getElementsByTagName("type").getLength()>0){ //means opensearch collection
logger.debug("Filtering opensearch collection with ID: "+collection.id()+" Type: "+collection.type());
iter.remove();
}
}
logger.debug("# of Tree Collections found: "+ pairs.size());
return pairs;
@ -210,8 +212,10 @@ public class GenericResource implements GenericResourceInfoI {
while (iter.hasNext()) {
org.gcube.common.resources.gcore.GenericResource collection = iter.next().getValue();
Element body = collection.profile().body();
if(body.getElementsByTagName("type").getLength()==0)
if(body.getElementsByTagName("type").getLength()==0){
logger.debug("Removing non-opensearch collection: "+collection.id()+" Type: "+collection.type());
iter.remove();
}
}
logger.debug("# of Opensearch Collections found: "+ pairs.size());
} catch (Exception e) {