git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@98584 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3124022120
commit
121e33dcde
|
@ -23,9 +23,9 @@
|
||||||
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</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>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="owner.project.facets" value="java"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.5
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<faceted-project>
|
<faceted-project>
|
||||||
<installed facet="java" version="1.5"/>
|
|
||||||
<installed facet="jst.utility" version="1.0"/>
|
<installed facet="jst.utility" version="1.0"/>
|
||||||
|
<installed facet="java" version="1.7"/>
|
||||||
</faceted-project>
|
</faceted-project>
|
||||||
|
|
27
pom.xml
27
pom.xml
|
@ -9,8 +9,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||||
<artifactId>aslcore</artifactId>
|
<artifactId>aslcore</artifactId>
|
||||||
<version>4.4.0-SNAPSHOT</version>
|
<version>4.5.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
|
||||||
<name>Application Support Layer Core</name>
|
<name>Application Support Layer Core</name>
|
||||||
<description>Library supporting dissemination of gCube content with OAI-ORE</description>
|
<description>Library supporting dissemination of gCube content with OAI-ORE</description>
|
||||||
|
@ -40,11 +39,7 @@
|
||||||
-->
|
-->
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.dvos</groupId>
|
|
||||||
<artifactId>usermanagement-stub</artifactId>
|
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.ehcache</groupId>
|
<groupId>net.sf.ehcache</groupId>
|
||||||
|
@ -71,14 +66,7 @@
|
||||||
<version>1.6.4</version>
|
<version>1.6.4</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>org.gcube.resources</groupId>
|
<groupId>org.gcube.resources</groupId>
|
||||||
<artifactId>registry-publisher</artifactId>
|
<artifactId>registry-publisher</artifactId>
|
||||||
|
@ -97,14 +85,7 @@ should be removed after release 3.2.0
|
||||||
<artifactId>kxml2</artifactId>
|
<artifactId>kxml2</artifactId>
|
||||||
<version>2.3.0</version>
|
<version>2.3.0</version>
|
||||||
</dependency>
|
</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>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,122 +37,21 @@ public class LDAPAuthenticationModule {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean checkAuthentication(String username, String password) throws Exception {
|
public boolean checkAuthentication(String username, String password) {
|
||||||
|
logger.info("beginning authentication for " + username);
|
||||||
logger.debug("The new security model should be integrated in ASL");
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
logger.info("beginning authentication for " + username);
|
|
||||||
|
|
||||||
LoginContext loginContext;
|
LoginContext loginContext;
|
||||||
|
|
||||||
// Create the LoginContext
|
// Create the LoginContext
|
||||||
try {
|
try {
|
||||||
loginContext = new LoginContext(contextName, new JaasCallbackHandler(username, password));
|
loginContext = new LoginContext(contextName, new JaasCallbackHandler(username, password));
|
||||||
|
loginContext.login();
|
||||||
|
return true;
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
logger.error("Exception:", e);
|
logger.error("Exception:", e);
|
||||||
// Check user's credential
|
return false;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (LoginException e) {
|
} catch (LoginException e) {
|
||||||
logger.error("Exception:", e);
|
logger.error("Exception:", e);
|
||||||
// Check user's credential
|
return false;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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;
|
|
||||||
// }
|
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -176,8 +176,10 @@ public class GenericResource implements GenericResourceInfoI {
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
org.gcube.common.resources.gcore.GenericResource collection = iter.next().getValue();
|
org.gcube.common.resources.gcore.GenericResource collection = iter.next().getValue();
|
||||||
Element body = collection.profile().body();
|
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();
|
iter.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
logger.debug("# of Tree Collections found: "+ pairs.size());
|
logger.debug("# of Tree Collections found: "+ pairs.size());
|
||||||
return pairs;
|
return pairs;
|
||||||
|
@ -210,8 +212,10 @@ public class GenericResource implements GenericResourceInfoI {
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
org.gcube.common.resources.gcore.GenericResource collection = iter.next().getValue();
|
org.gcube.common.resources.gcore.GenericResource collection = iter.next().getValue();
|
||||||
Element body = collection.profile().body();
|
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();
|
iter.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
logger.debug("# of Opensearch Collections found: "+ pairs.size());
|
logger.debug("# of Opensearch Collections found: "+ pairs.size());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue