Skip to content

Commit

Permalink
[AD-976] Implement single-instance SSH Tunnel. (#436)
Browse files Browse the repository at this point in the history
* [AD-976] Implement single-instance SSH Tunnel.

* [AD-976] Correct gradle.properties setting.

* [AD-976] Updated dependency for SSH tunnel to github.com.mwiede:jsch:0.2.4

* [AD-976] Fixes for tests failing on Linux platform.

* [AD-976] Fixes for tests failing on Linux platform.

* Commit Code Coverage Badge

* [AD-976] Updated dependencies

* [AD-976] Updated dependencies and syntax for spotbugs and checkstyles

* Commit Code Coverage Badge

* [AD-976] Add documentation for troubleshooting connection issue related to SSH tunnel

* Commit Code Coverage Badge

* [AD-976] Improvements from code review comments from Alexey.

* Commit Code Coverage Badge

* [AD-976] Migrate FindBug exclusions to spotbugs-exclude.xml file instead of annotations.

* Commit Code Coverage Badge

* [AD-976] Updated more dependencies.

* Commit Code Coverage Badge

* Commit Code Coverage Badge

* [AD-976] Remove chance of new line injection in logs.

* [AD-976] Correct error message that had new line. Fix related tests.

* Commit Code Coverage Badge

* [AD-976] Update dependency for slf4j.

* Commit Code Coverage Badge

Co-authored-by: birschick-bq <birschick-bq@users.noreply.github.com>
  • Loading branch information
Bruce Irschick and birschick-bq authored Nov 18, 2022
1 parent e4ee519 commit f59af16
Show file tree
Hide file tree
Showing 30 changed files with 3,094 additions and 468 deletions.
2 changes: 1 addition & 1 deletion .github/badges/branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/badges/jacoco.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ Package Artifact: https://repo.maven.apache.org/maven2/com/google/protobuf/proto
Package Artifact: https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1-sources.jar
Package Artifact: https://github.com/google/protobuf.git
-----------------------
Package ID: com.jcraft:jsch:0.1.55
Package Homepage: http://www.jcraft.com/jsch/
Package ID: com.github.mwiede:jsch:0.2.4
Package Homepage: https://github.com/mwiede/jsch
Package SPDX-License-Identifier: BSD-3-Clause
Package Artifact: https://repo.maven.apache.org/maven2/com/jcraft/jsch/0.1.55/jsch-0.1.55.jar
Package Artifact: https://repo.maven.apache.org/maven2/com/jcraft/jsch/0.1.55/jsch-0.1.55-sources.jar
Package Artifact: http://git.jcraft.com/jsch.git
Package Artifact: https://repo.maven.org/maven2/com/github/mwiede/jsch/0.2.4/jsch-0.2.4.jar
Package Artifact: https://repo.maven.org/maven2/com/github/mwiede/jsch/0.2.4/jsch-0.2.4-sources.jar
Package Artifact: https://github.com/mwiede/jsch.git
-----------------------
Package ID: org.codehaus.janino:commons-compiler:3.1.6
Package Homepage: http://janino-compiler.github.io/commons-compiler/
Expand Down Expand Up @@ -16570,7 +16570,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------

com.jcraft/jsch/0.1.55 LICENSE
github.com/mwiede/jsch/0.2.4 LICENSE

JSch 0.0.* was released under the GNU LGPL license. Later, we have switched
over to a BSD-style license.
Expand Down
40 changes: 24 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'java'
id 'com.github.spotbugs' version '5.0.10'
id 'com.github.spotbugs' version '5.0.13'
id 'checkstyle'
id 'jacoco'
id 'com.github.hierynomus.license' version '0.16.1'
Expand Down Expand Up @@ -145,24 +145,32 @@ spotbugsMain {
// Configure HTML report
reports {
xml {
enabled = true
required.set(true)
destination = file("$buildDir/reports/spotbugs/main.xml")
}
html {
required.set(true)
destination = file("$buildDir/reports/spotbugs/main.html")
}
}
}
spotbugsTest {
// Configure HTML report
reports {
xml {
enabled = true
required.set(true)
destination = file("$buildDir/reports/spotbugs/test.xml")
}
html {
required.set(true)
destination = file("$buildDir/reports/spotbugs/test.html")
}
}
}

task checkSpotBugsMainReport {
doLast {
def xmlReport = spotbugsMain.reports.getByName("XML")
def xmlReport = spotbugsMain.reports.getByName("xml")
def slurped = new groovy.xml.XmlSlurper().parse(xmlReport.destination)
def bugsFound = slurped.BugInstance.size()
slurped.BugInstance.each {
Expand All @@ -179,7 +187,7 @@ task checkSpotBugsMainReport {

task checkSpotBugsTestReport {
doLast {
def xmlReport = spotbugsTest.reports.getByName("XML")
def xmlReport = spotbugsTest.reports.getByName("xml")
def slurped = new XmlSlurper().parse(xmlReport.destination)
def bugsFound = slurped.BugInstance.size()
slurped.BugInstance.each {
Expand Down Expand Up @@ -315,21 +323,21 @@ repositories {

dependencies {
implementation group: 'commons-cli', name: 'commons-cli', version: '1.5.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.13.4'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-guava', version: '2.13.4'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.14.0'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-guava', version: '2.14.0'
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre'
implementation group: 'org.slf4j', name: 'slf4j-log4j12', version: '2.0.3'
implementation group: 'org.slf4j', name: 'slf4j-log4j12', version: '2.0.4'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.19.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.19.0'
implementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.7.2'
implementation group: 'com.jcraft', name: 'jsch', version: '0.1.55'
implementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.8.0'
implementation group: 'com.github.mwiede', name: 'jsch', version: '0.2.4'
implementation group: 'org.apache.calcite', name: 'calcite-core', version: '1.32.0'
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
implementation 'io.github.hakky54:sslcontext-kickstart:7.4.7'
implementation 'io.github.hakky54:sslcontext-kickstart:7.4.8'

compileOnly group: 'org.immutables', name: 'value', version: '2.9.2'
compileOnly group: 'com.puppycrawl.tools', name: 'checkstyle', version: '10.3.4'
compileOnly group: 'com.puppycrawl.tools', name: 'checkstyle', version: '10.4'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'

Expand All @@ -339,18 +347,18 @@ dependencies {
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.24'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.9.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.8.0'
testRuntimeOnly group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '3.5.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.9.0'
testRuntimeOnly group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '3.5.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-api:5.9.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.1'

spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'

testFixturesCompileOnly group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '3.4.11'
testFixturesCompileOnly group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '3.5.2'
testFixturesCompileOnly 'org.junit.jupiter:junit-jupiter-api:5.9.1'
testFixturesImplementation group: 'com.google.guava', name: 'guava', version: '29.0-jre'
testFixturesImplementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.7.2'
testFixturesImplementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.8.0'
testFixturesImplementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.2'
testFixturesImplementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.2'
}
Expand Down
8 changes: 7 additions & 1 deletion config/spotbugs/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,20 @@
<Bug pattern="ODR_OPEN_DATABASE_RESOURCE"/>
</Match>
<Match>
<Source name="Driver.java"/>
<Or>
<Source name="Driver.java"/>
<Source name="DocumentDbSshTunnelServer.java"/>
</Or>
<Bug pattern="COMMAND_INJECTION"/>
</Match>
<Match>
<Or>
<Source name="DocumentDbConnectionProperties.java"/>
<Source name="DocumentDbConnectionPropertiesTest.java"/>
<Source name="DocumentDbMain.java"/>
<Source name="DocumentDbSshTunnelLock.java"/>
<Source name="DocumentDbSshTunnelServer.java"/>
<Source name="DocumentDbSshTunnelService.java"/>
</Or>
<Bug pattern="PATH_TRAVERSAL_IN"/>
</Match>
Expand Down
Loading

0 comments on commit f59af16

Please sign in to comment.