Skip to content

Commit

Permalink
Merge branch '1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mlbiam committed Feb 24, 2018
2 parents 8e5e0b1 + 8e92183 commit dd13584
Show file tree
Hide file tree
Showing 15 changed files with 426 additions and 15 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 1.0.2
**questions:**
- Combining AD as a branch of OpenLdap [\#33](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/33)

**enhancements:**
- Add support for ldap host lookup by SRV [\#39](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/39)
- Release 1.0.2 [\#34](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/34)
- Release [\#30](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/30)

**bugs:**
- Combining AD as a branch of OpenLdap [\#33](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/33)
- add bindPrimaryFirst to joiner docs [\#25](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/25)
- fix docs for UUIDtoText [\#17](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/17)
- RootObject not in documentation [\#14](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/14)


# 1.0.1
**bugs:**
- add bindPrimaryFirst to joiner docs [\#25](https://github.com/TremoloSecurity/MyVirtualDirectory/issues/25)
Expand Down
50 changes: 50 additions & 0 deletions myvd-server.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="us.ncrnet.iams.mugshots-0.0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: backport-util-concurrent:backport-util-concurrent:3.1" level="project" />
<orderEntry type="library" name="Maven: commons-dbcp:commons-dbcp:1.4" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging-api:1.1" level="project" />
<orderEntry type="library" name="Maven: jcifs:jcifs:1.3.17" level="project" />
<orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: hsqldb:hsqldb:1.8.0.10" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.derby:derbyclient:10.10.2.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.derby:derbytools:10.10.2.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.derby:derby:10.10.2.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: com.tremolosecurity.myvd:jldap:1.0.0" level="project" />
<orderEntry type="library" name="Maven: com.tremolosecurity.myvd:jdbcLdap:1.0.0" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.58" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-ext-jdk15on:1.58" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.ant:ant:1.10.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.ant:ant-launcher:1.10.1" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.4" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-1.2-api:2.10.0" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
<orderEntry type="library" name="Maven: commons-daemon:commons-daemon:1.1.0" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" name="Maven: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" name="Maven: commons-pool:commons-pool:1.6" level="project" />
<orderEntry type="library" name="Maven: com.tremolosecurity.myvd:apacheds-service:2.0.0-M20" level="project" />
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
</component>
</module>
25 changes: 15 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>net.sourceforge.myvd</groupId>
<artifactId>myvd-server</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<packaging>jar</packaging>

<name>server</name>
Expand Down Expand Up @@ -117,12 +117,12 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.56</version>
<version>1.59</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-ext-jdk15on</artifactId>
<version>1.55</version>
<version>1.59</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
Expand All @@ -136,7 +136,7 @@
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.10.3</version>
<version>2.10.4</version>
</dependency>

<dependency>
Expand All @@ -160,24 +160,24 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.8.1</version>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.1</version>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.8.1</version>
<version>2.10.0</version>
</dependency>


<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<version>2.6</version>
</dependency>

<dependency>
Expand All @@ -189,7 +189,7 @@
<dependency>
<groupId>commons-daemon</groupId>
<artifactId>commons-daemon</artifactId>
<version>1.0.15</version>
<version>1.1.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -233,6 +233,11 @@
<artifactId>joda-time</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>dnsjava</groupId>
<artifactId>dnsjava</artifactId>
<version>2.1.8</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -310,7 +315,7 @@
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<argLine>-Xmx1024m</argLine>
<systemPropertyVariables>
<databaseSchema>MY_TEST_SCHEMA_${surefire.forkNumber}</databaseSchema>
</systemPropertyVariables>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
package net.sourceforge.myvd.inserts.ldap;

import org.apache.logging.log4j.Logger;

import org.xbill.DNS.Lookup;
import org.xbill.DNS.Record;
import org.xbill.DNS.SRVRecord;
import org.xbill.DNS.TextParseException;
import org.xbill.DNS.Type;
import net.sourceforge.myvd.types.Bool;
import net.sourceforge.myvd.types.Password;

Expand Down Expand Up @@ -47,6 +51,7 @@ public ConnectionWrapper(LDAPInterceptor interceptor) {
this.locked.setValue(false);
this.bindDN = null;


}

public synchronized boolean wasLocked() {
Expand Down Expand Up @@ -195,8 +200,23 @@ private LDAPConnection createConnection() throws LDAPException {
if (ldapcon == null) {
return null;
} else {

ldapcon.connect(this.interceptor.host,this.interceptor.port);
String host = this.interceptor.host;

if (this.interceptor.useSrvDNS) {
Record[] records;
try {
records = new Lookup(host, Type.SRV).run();
} catch (TextParseException e) {
throw new LDAPException(LDAPException.resultCodeToString(LDAPException.OPERATIONS_ERROR),LDAPException.OPERATIONS_ERROR,"Could not lookup srv",e);
}
if (records == null) {
throw new LDAPException("No SRV records",LDAPException.OPERATIONS_ERROR,"");
}
SRVRecord srv = (SRVRecord) records[0];
host = srv.getTarget().toString();
}

ldapcon.connect(host,this.interceptor.port);
return ldapcon;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public class LDAPInterceptor implements Insert {
private long heartbeatIntervalMinis;

private LDAPHeartBeat heartBeat;
public boolean useSrvDNS;

public void configure(String name, Properties props,NameSpace nameSpace) throws LDAPException {
this.name = name;
Expand Down Expand Up @@ -164,6 +165,8 @@ public void configure(String name, Properties props,NameSpace nameSpace) throws
this.maxStaleTime = Long.parseLong(props.getProperty("maxStaleTimeMillis","60000"));
logger.info("Maximum stale connection time in millis : " + this.maxStaleTime);

this.useSrvDNS = props.getProperty("useSrvDNS", "false").equalsIgnoreCase("true");

this.pool = new LDAPConnectionPool(this, Integer.parseInt(props.getProperty("minimumConnections","5")), Integer.parseInt(props.getProperty("maximumConnections","30")), Integer.parseInt(props.getProperty("maximumRetries","5")),this.type,this.spmlImpl,this.isSoap);


Expand All @@ -183,6 +186,8 @@ public void configure(String name, Properties props,NameSpace nameSpace) throws
this.heartBeat = new LDAPHeartBeat(this);
new Thread(this.heartBeat).start();
}


}

private ConnectionWrapper getConnection(DN bindDN,Password pass,boolean force,DN base,HashMap<Object,Object> session) throws LDAPException {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/sourceforge/myvd/router/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ public void search(SearchInterceptorChain chain,DistinguishedName base,Int scope
logger.debug("Determine scope");
Int localScope = new Int(scope.getValue());
if (scope.getValue() != 0) {
if (scope.getValue() == 1) {
if (holder.getBase().getDN().countRDNs() == searchBase.getDN().countRDNs() && ! holder.getBase().getDN().equals(searchBase.getDN())) {
continue;
} else if (scope.getValue() == 1) {
if (holder.getBase().getDN().countRDNs() - searchBase.getDN().countRDNs() == 1) {
localScope.setValue(0);
searchBase = new DistinguishedName(holder.getBase().getDN().toString());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sourceforge/myvd/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class Server {
static Logger logger;


public final static String VERSION = "1.0.1";
public final static String VERSION = "1.0.2";

String configFile;
Properties props;
Expand Down
Loading

0 comments on commit dd13584

Please sign in to comment.