You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/09/04 17:46:49 UTC

[01/50] tinkerpop git commit: Merge branch 'tp32' into tp33 [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-2021 db866059e -> 8c280c113 (forced update)


Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5eaf312c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5eaf312c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5eaf312c

Branch: refs/heads/TINKERPOP-2021
Commit: 5eaf312c000d3145707513f20109956f5f97265a
Parents: 1bd35dc fd64360
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 25 11:30:52 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 25 11:30:52 2018 -0400

----------------------------------------------------------------------
 .../gremlin-javascript/lib/structure/io/type-serializers.js   | 2 +-
 .../javascript/gremlin-javascript/test/unit/graphson-test.js  | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5eaf312c/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js
----------------------------------------------------------------------


[39/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/65820569
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/65820569
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/65820569

Branch: refs/heads/TINKERPOP-2021
Commit: 65820569f9eb47f8435699d2308bbedc94306b7b
Parents: a8931d5 6a6959a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Aug 22 16:17:23 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Aug 22 16:17:23 2018 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[48/50] tinkerpop git commit: TINKERPOP-2021 Added test to simulate maximum recursion depth failure

Posted by sp...@apache.org.
TINKERPOP-2021 Added test to simulate maximum recursion depth failure


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/425bcd03
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/425bcd03
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/425bcd03

Branch: refs/heads/TINKERPOP-2021
Commit: 425bcd032adc9967a6b575da8042df3806671825
Parents: e937a3a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Aug 28 11:58:13 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 4 13:24:18 2018 -0400

----------------------------------------------------------------------
 .../src/main/jython/tests/driver/test_client.py | 44 ++++++++++++++++++++
 1 file changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/425bcd03/gremlin-python/src/main/jython/tests/driver/test_client.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_client.py b/gremlin-python/src/main/jython/tests/driver/test_client.py
index 595aba0..82b0221 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_client.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_client.py
@@ -20,6 +20,7 @@ import pytest
 
 from gremlin_python.driver.client import Client
 from gremlin_python.driver.request import RequestMessage
+from gremlin_python.process.graph_traversal import __
 from gremlin_python.structure.graph import Graph
 
 __author__ = 'David M. Brown (davebshow@gmail.com)'
@@ -107,3 +108,46 @@ def test_multi_conn_pool(client):
     # with connection pool `future` may or may not be done here
     result_set = future.result()
     assert len(result_set.all().result()) == 6
+
+
+def test_big_result_set(client):
+    g = Graph().traversal()
+    t = g.inject(1).repeat(__.addV('person').property('name', __.loops())).times(20000).count()
+    message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}})
+    result_set = client.submit(message)
+    results = []
+    for result in result_set:
+        results += result
+    assert len(results) == 1
+
+    t = g.V().limit(10)
+    message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}})
+    result_set = client.submit(message)
+    results = []
+    for result in result_set:
+        results += result
+    assert len(results) == 10
+
+    t = g.V().limit(100)
+    message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}})
+    result_set = client.submit(message)
+    results = []
+    for result in result_set:
+        results += result
+    assert len(results) == 100
+
+    t = g.V().limit(1000)
+    message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}})
+    result_set = client.submit(message)
+    results = []
+    for result in result_set:
+        results += result
+    assert len(results) == 1000
+
+    t = g.V().limit(10000)
+    message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}})
+    result_set = client.submit(message)
+    results = []
+    for result in result_set:
+        results += result
+    assert len(results) == 10000


[11/50] tinkerpop git commit: dedup build-helper-maven-plugin - CTR

Posted by sp...@apache.org.
dedup build-helper-maven-plugin - CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/dfe79c24
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/dfe79c24
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/dfe79c24

Branch: refs/heads/TINKERPOP-2021
Commit: dfe79c24f4decb667ad20c729928a50f8cb1ec0b
Parents: c49c0cc
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Jul 31 13:12:31 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Jul 31 13:12:31 2018 -0400

----------------------------------------------------------------------
 pom.xml | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dfe79c24/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b669872..f2629ad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -305,6 +305,7 @@ limitations under the License.
                             <failIfNoMatch>false</failIfNoMatch>
                         </configuration>
                     </execution>
+                    <!-- Needed to figure out the version components when reading revapi API check config below -->
                     <execution>
                         <id>parse-version</id>
                         <goals>
@@ -407,21 +408,6 @@ limitations under the License.
                     </dependency>
                 </dependencies>
             </plugin>
-            <!-- Needed to figure out the version components when reading revapi API check config below -->
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-		<version>3.0.0</version>
-                <executions>
-                    <execution>
-                        <id>parse-version</id>
-                        <goals>
-                            <goal>parse-version</goal>
-                        </goals>
-                        <phase>validate</phase>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <groupId>org.revapi</groupId>
                 <artifactId>revapi-maven-plugin</artifactId>


[20/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33

Conflicts:
	gremlin-server/src/main/bin/gremlin-server.bat


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a050b6ed
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a050b6ed
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a050b6ed

Branch: refs/heads/TINKERPOP-2021
Commit: a050b6ed6380b1b97462739a75c6104f4e6e1b32
Parents: 5e48acc 00cb9a8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Aug 10 14:03:06 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Aug 10 14:03:06 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                             | 1 +
 gremlin-server/src/main/bin/gremlin-server.bat | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a050b6ed/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a050b6ed/gremlin-server/src/main/bin/gremlin-server.bat
----------------------------------------------------------------------
diff --cc gremlin-server/src/main/bin/gremlin-server.bat
index 8ceab26,cf8e916..6c73f48
--- a/gremlin-server/src/main/bin/gremlin-server.bat
+++ b/gremlin-server/src/main/bin/gremlin-server.bat
@@@ -42,13 -41,8 +42,13 @@@ if "%1" == "install" goto instal
  :server
  
  :: Launch the application
- java -Dlog4j.configuration=conf/log4j-server.properties %JAVA_OPTIONS% %JAVA_ARGS% -cp %LIBDIR%/*;%EXTDIR%; org.apache.tinkerpop.gremlin.server.GremlinServer %*
+ java -Dlog4j.configuration=conf/log4j-server.properties %JAVA_OPTIONS% %JAVA_ARGS% -cp "%LIBDIR%/*;%EXTDIR%;" org.apache.tinkerpop.gremlin.server.GremlinServer %*
  
 +:dashi
 +
 +echo NOTE: -i is deprecated. Please update your scripts. Using 'install' command...
 +goto install
 +
  :install
  
  set RESTVAR=
@@@ -61,4 -55,4 +61,4 @@@ goto loop
  
  :after_loop
  
- java -Dlog4j.configuration=conf/log4j-server.properties %JAVA_OPTIONS% %JAVA_ARGS% -cp %LIBDIR%/*;%EXTDIR%; org.apache.tinkerpop.gremlin.server.util.GremlinServerInstall %RESTVAR%
 -java -Dlog4j.configuration=conf/log4j-server.properties %JAVA_OPTIONS% %JAVA_ARGS% -cp "%LIBDIR%/*;%EXTDIR%;" org.apache.tinkerpop.gremlin.server.util.GremlinServerInstall %RESTVAR%
++java -Dlog4j.configuration=conf/log4j-server.properties %JAVA_OPTIONS% %JAVA_ARGS% -cp "%LIBDIR%/*;%EXTDIR%;" org.apache.tinkerpop.gremlin.server.util.GremlinServerInstall %RESTVAR%


[21/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0bf76acd
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0bf76acd
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0bf76acd

Branch: refs/heads/TINKERPOP-2021
Commit: 0bf76acd551fd900e7869e9e5aada8aaeaa34b56
Parents: a050b6e 1b99323
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Sat Aug 11 13:40:16 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Sat Aug 11 13:40:16 2018 +0200

----------------------------------------------------------------------
 gremlin-dotnet/glv/Gremlin.Net.csproj.template    | 7 +++++--
 gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0bf76acd/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------


[10/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c49c0ccb
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c49c0ccb
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c49c0ccb

Branch: refs/heads/TINKERPOP-2021
Commit: c49c0ccb3bce76caabb4b0a9c7efe9df43801b39
Parents: ddc6694 e3018fb
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jul 31 08:35:24 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jul 31 08:35:24 2018 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/development-environment.asciidoc | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c49c0ccb/docs/src/dev/developer/development-environment.asciidoc
----------------------------------------------------------------------


[30/50] tinkerpop git commit: TINKERPOP-2023 updated docs

Posted by sp...@apache.org.
TINKERPOP-2023 updated docs


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5d893cfa
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5d893cfa
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5d893cfa

Branch: refs/heads/TINKERPOP-2021
Commit: 5d893cfada0e257be1b6561faaad74c66e9cf636
Parents: ca83fbd
Author: Robert Dale <ro...@gmail.com>
Authored: Sun Aug 12 22:23:33 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Aug 17 15:06:33 2018 -0400

----------------------------------------------------------------------
 .../src/reference/gremlin-applications.asciidoc | 27 +++++++++++++++-----
 1 file changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5d893cfa/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index f4f50c1..1f64f46 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -732,7 +732,10 @@ The following table describes the various configuration options for the Gremlin
 |connectionPool.keepAliveInterval |Length of time in milliseconds to wait on an idle connection before sending a keep-alive request. Set to zero to disable this feature. |1800000
 |connectionPool.keyCertChainFile |The X.509 certificate chain file in PEM format. |_none_
 |connectionPool.keyFile |The `PKCS#8` private key file in PEM format. |_none_
-|connectionPool.keyPassword |The password of the `keyFile` if it is password-protected |_none_
+|connectionPool.keyPassword |The password of the `keyFile` if it is password-protected. |_none_
+|connectionPool.keyStore |The private key in JKS or PKCS#12 format. |_none_
+|connectionPool.keyStorePassword |The password of the `keyStore` if it is password-protected. |_none_
+|connectionPool.keyStoreType |JKS (Java 8 default) or PKCS#12 (Java 9+ default)|_none_
 |connectionPool.maxContentLength |The maximum length in bytes that a message can be sent to the server. This number can be no greater than the setting of the same name in the server configuration. |65536
 |connectionPool.maxInProcessPerConnection |The maximum number of in-flight requests that can occur on a connection. |4
 |connectionPool.maxSimultaneousUsagePerConnection |The maximum number of times that a connection can be borrowed from the pool simultaneously. |16
@@ -745,7 +748,12 @@ The following table describes the various configuration options for the Gremlin
 |connectionPool.reconnectInitialDelay |The amount of time in milliseconds to wait before trying to reconnect to a dead host for the first time. |1000
 |connectionPool.reconnectInterval |The amount of time in milliseconds to wait before trying to reconnect to a dead host. This interval occurs after the time specified by the `reconnectInitialDelay`. |1000
 |connectionPool.resultIterationBatchSize |The override value for the size of the result batches to be returned from the server. |64
-|connectionPool.trustCertChainFile |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the `TrustManager` will be established with a self-signed certificate which is NOT suitable for production purposes. |_none_
+|connectionPool.sslCipherSuites |The list of JSSE ciphers to support for SSL connections. If specified, only the ciphers that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
+|connectionPool.sslEnabledProtocols |The list of SSL protocols to support for SSL connections. If specified, only the protocols that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
+|connectionPool.sslSkipCertValidation |Configures the `TrustManager` to trust all certs without any validation. Should not be used in production.|false
+|connectionPool.trustCertChainFile |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be uesd. |_none_
+|connectionPool.trustStore |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
+|connectionPool.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_
 |hosts |The list of hosts that the driver will connect to. |localhost
 |jaasEntry |Sets the `AuthProperties.Property.JAAS_ENTRY` properties for authentication to Gremlin Server. |_none_
 |nioPoolSize |Size of the pool for handling request/response operations. |available processors
@@ -1148,11 +1156,18 @@ The following table describes the various configuration options that Gremlin Ser
 |serializers[X].className |The full class name of the `MessageSerializer` implementation. |_none_
 |serializers[X].config |A `Map` containing `MessageSerializer` specific configurations. |_none_
 |ssl.enabled |Determines if SSL is turned on or not. |false
-|ssl.keyCertChainFile |The X.509 certificate chain file in PEM format. If this value is not present and `ssl.enabled` is `true` a self-signed certificate will be used (not suitable for production). |_none_
-|ssl.keyFile |The `PKCS#8` private key file in PEM format. If this value is not present and `ssl.enabled` is `true` a self-signed certificate will be used (not suitable for production). |_none_
-|ssl.keyPassword |The password of the `keyFile` if it is password-protected |_none_
+|ssl.keyCertChainFile |The X.509 certificate chain file in PEM format.|_none_
+|ssl.keyFile |The `PKCS#8` private key file in PEM format.|_none_
+|ssl.keyPassword |The password of the `keyFile` if it is password-protected. |_none_
+|ssl.keyStore |The private key in JKS or PKCS#12 format.  |_none_
+|ssl.keyStorePassword |The password of the `keyStore` if it is password-protected. |_none_
+|ssl.keyStoreType |JKS (Java 8 default) or PKCS#12 (Java 9+ default) |_none_
 |ssl.needClientAuth | Optional. One of NONE, OPTIONAL, REQUIRE.  Enables client certificate authentication at the enforcement level specified. Can be used in combination with Authenticator. |_none_
+|ssl.sslCipherSuites |The list of JSSE ciphers to support for SSL connections. If specified, only the ciphers that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
+|ssl.sslEnabledProtocols |The list of SSL protocols to support for SSL connections. If specified, only the protocols that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
 |ssl.trustCertChainFile | Required when needClientAuth is OPTIONAL or REQUIRE. Trusted certificates for verifying the remote endpoint's certificate. The file should contain an X.509 certificate chain in PEM format. |_none_
+|ssl.trustStore |Required when needClientAuth is OPTIONAL or REQUIRE. Trusted certificates for verifying the remote endpoint's certificate. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
+|ssl.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_
 |strictTransactionManagement |Set to `true` to require `aliases` to be submitted on every requests, where the `aliases` become the scope of transaction management. |false
 |threadPoolBoss |The number of threads available to Gremlin Server for accepting connections. Should always be set to `1`. |1
 |threadPoolWorker |The number of threads available to Gremlin Server for processing non-blocking reads and writes. |1
@@ -1944,7 +1959,7 @@ The Gremlin Server can also be started as a link:https://hub.docker.com/r/tinker
 [source,text]
 ----
 $ docker run tinkerpop/gremlin-server:x.y.z
-[INFO] GremlinServer - 
+[INFO] GremlinServer -
          \,,,/
          (o o)
 -----oOOo-(3)-oOOo-----


[28/50] tinkerpop git commit: TINKERPOP-2023 new SSL client, server parameters

Posted by sp...@apache.org.
TINKERPOP-2023 new SSL client, server parameters


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e3b4ae5d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e3b4ae5d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e3b4ae5d

Branch: refs/heads/TINKERPOP-2021
Commit: e3b4ae5d848d641d6dbdbfa940acab470c64fabb
Parents: 5f770b1
Author: Robert Dale <ro...@gmail.com>
Authored: Sat Aug 11 21:12:50 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Aug 17 15:06:33 2018 -0400

----------------------------------------------------------------------
 gremlin-console/conf/remote-secure.yaml         |   5 +-
 .../tinkerpop/gremlin/driver/Cluster.java       | 172 ++++++++++++++++++-
 .../tinkerpop/gremlin/driver/Settings.java      |  57 ++++++
 .../conf/gremlin-server-rest-secure.yaml        |   6 +-
 gremlin-server/conf/gremlin-server-secure.yaml  |   6 +-
 .../gremlin/server/AbstractChannelizer.java     |  78 +++++++--
 .../tinkerpop/gremlin/server/Settings.java      |  64 ++++++-
 .../AbstractGremlinServerIntegrationTest.java   |   7 +
 .../server/GremlinServerAuthIntegrateTest.java  |   4 +-
 .../GremlinServerAuthOldIntegrateTest.java      |   4 +-
 .../server/GremlinServerIntegrateTest.java      |  41 ++---
 ...ctGremlinServerChannelizerIntegrateTest.java |  10 +-
 gremlin-server/src/test/resources/server.jks    | Bin 0 -> 2258 bytes
 gremlin-server/src/test/resources/server.p12    | Bin 0 -> 2613 bytes
 14 files changed, 396 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-console/conf/remote-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/conf/remote-secure.yaml b/gremlin-console/conf/remote-secure.yaml
index 4f8d22b..c7a2c44 100644
--- a/gremlin-console/conf/remote-secure.yaml
+++ b/gremlin-console/conf/remote-secure.yaml
@@ -29,5 +29,6 @@ port: 8182
 username: stephen
 password: password
 connectionPool: {
-  enableSsl: true}
-serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
\ No newline at end of file
+  enableSsl: true,
+  sslSkipCertValidation: true }
+serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
index 567bfb4..6e4ef25 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
@@ -33,15 +33,25 @@ import org.apache.commons.lang3.concurrent.BasicThreadFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
 import java.lang.ref.WeakReference;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.URI;
 import java.net.UnknownHostException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -172,6 +182,14 @@ public final class Cluster {
                 .keyCertChainFile(settings.connectionPool.keyCertChainFile)
                 .keyFile(settings.connectionPool.keyFile)
                 .keyPassword(settings.connectionPool.keyPassword)
+                .keyStore(settings.connectionPool.keyStore)
+                .keyStorePassword(settings.connectionPool.keyStorePassword)
+                .keyStoreType(settings.connectionPool.keyStoreType)
+                .trustStore(settings.connectionPool.trustStore)
+                .trustStorePassword(settings.connectionPool.trustStorePassword)
+                .sslCipherSuites(settings.connectionPool.sslCipherSuites)
+                .sslEnabledProtocols(settings.connectionPool.sslEnabledProtocols)
+                .sslSkipCertValidation(settings.connectionPool.sslSkipCertValidation)
                 .nioPoolSize(settings.nioPoolSize)
                 .workerPoolSize(settings.workerPoolSize)
                 .reconnectInterval(settings.connectionPool.reconnectInterval)
@@ -446,29 +464,81 @@ public final class Cluster {
         return manager.authProps;
     }
 
-    SslContext createSSLContext() throws Exception  {
+    SslContext createSSLContext() throws Exception {
         // if the context is provided then just use that and ignore the other settings
-        if (manager.sslContextOptional.isPresent()) return manager.sslContextOptional.get();
+        if (manager.sslContextOptional.isPresent())
+            return manager.sslContextOptional.get();
 
         final SslProvider provider = SslProvider.JDK;
         final Settings.ConnectionPoolSettings connectionPoolSettings = connectionPoolSettings();
         final SslContextBuilder builder = SslContextBuilder.forClient();
 
-        if (connectionPoolSettings.trustCertChainFile != null)
+        if (connectionPoolSettings.trustCertChainFile != null) {
+            logger.warn("Using deprecated SSL trustCertChainFile support");
             builder.trustManager(new File(connectionPoolSettings.trustCertChainFile));
-        else {
-            logger.warn("SSL configured without a trustCertChainFile and thus trusts all certificates without verification (not suitable for production)");
-            builder.trustManager(InsecureTrustManagerFactory.INSTANCE);
         }
 
         if (null != connectionPoolSettings.keyCertChainFile && null != connectionPoolSettings.keyFile) {
+            logger.warn("Using deprecated SSL keyFile support");
             final File keyCertChainFile = new File(connectionPoolSettings.keyCertChainFile);
             final File keyFile = new File(connectionPoolSettings.keyFile);
 
-            // note that keyPassword may be null here if the keyFile is not password-protected.
+            // note that keyPassword may be null here if the keyFile is not
+            // password-protected.
             builder.keyManager(keyCertChainFile, keyFile, connectionPoolSettings.keyPassword);
         }
 
+        // Build JSSE SSLContext
+        try {
+
+            // Load private key/public cert for client auth
+            if (null != connectionPoolSettings.keyStore) {
+                final String keyStoreType = null == connectionPoolSettings.keyStoreType ? KeyStore.getDefaultType()
+                        : connectionPoolSettings.keyStoreType;
+                final KeyStore keystore = KeyStore.getInstance(keyStoreType);
+                final char[] password = null == connectionPoolSettings.keyStorePassword ? null
+                        : connectionPoolSettings.keyStorePassword.toCharArray();
+                try (final InputStream in = new FileInputStream(connectionPoolSettings.keyStore)) {
+                    keystore.load(in, password);
+                }
+                final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+                kmf.init(keystore, password);
+                builder.keyManager(kmf);
+            }
+
+            // Load custom truststore
+            if (null != connectionPoolSettings.trustStore) {
+                final String keystoreType = null == connectionPoolSettings.keyStoreType ? KeyStore.getDefaultType()
+                        : connectionPoolSettings.keyStoreType;
+                final KeyStore truststore = KeyStore.getInstance(keystoreType);
+                final char[] password = null == connectionPoolSettings.trustStorePassword ? null
+                        : connectionPoolSettings.trustStorePassword.toCharArray();
+                try (final InputStream in = new FileInputStream(connectionPoolSettings.trustStore)) {
+                    truststore.load(in, password);
+                }
+                final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+                tmf.init(truststore);
+                builder.trustManager(tmf);
+            }
+
+        } catch (UnrecoverableKeyException | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e) {
+            logger.error("There was an error enabling SSL.", e);
+            return null;
+        }
+
+        if (null != connectionPoolSettings.sslCipherSuites && !connectionPoolSettings.sslCipherSuites.isEmpty()) {
+            builder.ciphers(connectionPoolSettings.sslCipherSuites);
+        }
+
+        if (null != connectionPoolSettings.sslEnabledProtocols && !connectionPoolSettings.sslEnabledProtocols.isEmpty()) {
+            builder.protocols(connectionPoolSettings.sslEnabledProtocols.toArray(new String[] {}));
+        }
+
+        if (connectionPoolSettings.sslSkipCertValidation) {
+            logger.warn("SSL configured with sslSkipCertValidation thus trusts all certificates without verification (not suitable for production)");
+            builder.trustManager(InsecureTrustManagerFactory.INSTANCE);
+        }
+
         builder.sslProvider(provider);
 
         return builder.build();
@@ -499,6 +569,14 @@ public final class Cluster {
         private String keyCertChainFile = null;
         private String keyFile = null;
         private String keyPassword = null;
+        private String keyStore;
+        private String keyStorePassword;
+        private String trustStore;
+        private String trustStorePassword;
+        private String keyStoreType;
+        private List<String> sslEnabledProtocols = new ArrayList<>();
+        private List<String> sslCipherSuites = new ArrayList<>();
+        private boolean sslSkipCertValidation = false;
         private SslContext sslContext = null;
         private LoadBalancingStrategy loadBalancingStrategy = new LoadBalancingStrategy.RoundRobin();
         private AuthProperties authProps = new AuthProperties();
@@ -579,7 +657,9 @@ public final class Cluster {
          * File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and
          * SSL is enabled, the {@link TrustManager} will be established with a self-signed certificate which is NOT
          * suitable for production purposes.
+         * @deprecated
          */
+        @Deprecated
         public Builder trustCertificateChainFile(final String certificateChainFile) {
             this.trustCertChainFile = certificateChainFile;
             return this;
@@ -597,7 +677,9 @@ public final class Cluster {
 
         /**
          * The X.509 certificate chain file in PEM format.
+         * @deprecated
          */
+        @Deprecated
         public Builder keyCertChainFile(final String keyCertChainFile) {
             this.keyCertChainFile = keyCertChainFile;
             return this;
@@ -605,7 +687,9 @@ public final class Cluster {
 
         /**
          * The PKCS#8 private key file in PEM format.
+         * @deprecated
          */
+        @Deprecated
         public Builder keyFile(final String keyFile) {
             this.keyFile = keyFile;
             return this;
@@ -613,11 +697,77 @@ public final class Cluster {
 
         /**
          * The password of the {@link #keyFile}, or {@code null} if it's not password-protected.
+         * @deprecated
          */
+        @Deprecated
         public Builder keyPassword(final String keyPassword) {
             this.keyPassword = keyPassword;
             return this;
         }
+        
+        /**
+         * 
+         */
+        public Builder keyStore(final String keyStore) {
+            this.keyStore = keyStore;
+            return this;
+        }
+        
+        /**
+         * 
+         */
+        public Builder keyStorePassword(final String keyStorePassword) {
+            this.keyStorePassword = keyStorePassword;
+            return this;
+        }
+        
+        /**
+         * 
+         */
+        public Builder trustStore(final String trustStore) {
+            this.trustStore = trustStore;
+            return this;
+        }
+        
+        /**
+         * 
+         */
+        public Builder trustStorePassword(final String trustStorePassword) {
+            this.trustStorePassword = trustStorePassword;
+            return this;
+        }
+        
+        /**
+         * 
+         */
+        public Builder keyStoreType(final String keyStoreType) {
+            this.keyStoreType = keyStoreType;
+            return this;
+        }
+        
+        /**
+         * 
+         */
+        public Builder sslEnabledProtocols(final List<String> sslEnabledProtocols) {
+            this.sslEnabledProtocols = sslEnabledProtocols;
+            return this;
+        }
+        
+        /**
+         * 
+         */
+        public Builder sslCipherSuites(final List<String> sslCipherSuites) {
+            this.sslCipherSuites = sslCipherSuites;
+            return this;
+        }
+        
+        /**
+         * 
+         */
+        public Builder sslSkipCertValidation(final boolean sslSkipCertValidation) {
+            this.sslSkipCertValidation = sslSkipCertValidation;
+            return this;
+        }
 
         /**
          * The minimum number of in-flight requests that can occur on a {@link Connection} before it is considered
@@ -901,6 +1051,14 @@ public final class Cluster {
             connectionPoolSettings.keyCertChainFile = builder.keyCertChainFile;
             connectionPoolSettings.keyFile = builder.keyFile;
             connectionPoolSettings.keyPassword = builder.keyPassword;
+            connectionPoolSettings.keyStore = builder.keyStore;
+            connectionPoolSettings.keyStorePassword = builder.keyStorePassword;
+            connectionPoolSettings.trustStore = builder.trustStore;
+            connectionPoolSettings.trustStorePassword = builder.trustStorePassword;
+            connectionPoolSettings.keyStoreType = builder.keyStoreType;
+            connectionPoolSettings.sslCipherSuites = builder.sslCipherSuites;
+            connectionPoolSettings.sslEnabledProtocols = builder.sslEnabledProtocols;
+            connectionPoolSettings.sslSkipCertValidation = builder.sslSkipCertValidation;
             connectionPoolSettings.keepAliveInterval = builder.keepAliveInterval;
             connectionPoolSettings.channelizer = builder.channelizer;
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
index 8a2517d..009a0bf 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
@@ -232,25 +232,82 @@ final class Settings {
 
         /**
          * The trusted certificate in PEM format.
+         * @deprecated Use JSSE-based settings
          */
+        @Deprecated
         public String trustCertChainFile = null;
 
         /**
          * The X.509 certificate chain file in PEM format.
+         * @deprecated Use JSSE-based settings
          */
+        @Deprecated
         public String keyCertChainFile = null;
 
         /**
          * The PKCS#8 private key file in PEM format.
+         * @deprecated Use JSSE-based settings
          */
+        @Deprecated
         public String keyFile = null;
 
         /**
          * The password of the {@link #keyFile}, or {@code null} if it's not password-protected.
+         * @deprecated Use JSSE-based settings
          */
+        @Deprecated
         public String keyPassword = null;
 
         /**
+         * JSSE keystore file path. Similar to setting JSSE property
+         * {@code javax.net.ssl.keyStore}.
+         */
+        public String keyStore;
+
+        /**
+         * JSSE keystore password. Similar to setting JSSE property
+         * {@code javax.net.ssl.keyStorePassword}.
+         */
+        public String keyStorePassword;
+
+        /**
+         * JSSE truststore file path. Similar to setting JSSE property
+         * {@code javax.net.ssl.trustStore}.
+         */
+        public String trustStore;
+
+        /**
+         * JSSE truststore password. Similar to setting JSSE property
+         * {@code javax.net.ssl.trustStorePassword}.
+         */
+        public String trustStorePassword;
+
+        /**
+         * JSSE keystore format. Similar to setting JSSE property
+         * {@code javax.net.ssl.keyStoreType}.
+         */
+        public String keyStoreType;
+
+        /**
+         * @see <a href=
+         *      "https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSE_Protocols">JSSE
+         *      Protocols</a>
+         */
+        public List<String> sslEnabledProtocols = new ArrayList<>();
+
+        /**
+         * @see <a href=
+         *      "https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SupportedCipherSuites">Cipher
+         *      Suites</a>
+         */
+        public List<String> sslCipherSuites = new ArrayList<>();
+
+        /**
+         * 
+         */
+        public boolean sslSkipCertValidation = false;
+
+        /**
          * The minimum size of a connection pool for a {@link Host}. By default this is set to 2.
          */
         public int minSize = ConnectionPool.MIN_POOL_SIZE;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/conf/gremlin-server-rest-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-rest-secure.yaml b/gremlin-server/conf/gremlin-server-rest-secure.yaml
index ab21b33..fcfbba1 100644
--- a/gremlin-server/conf/gremlin-server-rest-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-rest-secure.yaml
@@ -69,4 +69,8 @@ authentication: {
   config: {
     credentialsDb: conf/tinkergraph-credentials.properties}}
 ssl: {
-  enabled: true}
+  enabled: true,
+  # You must configure a keyStore!
+  #keyStore: server.jks,
+  #keyStorePassword: changeit
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/conf/gremlin-server-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-secure.yaml b/gremlin-server/conf/gremlin-server-secure.yaml
index 42a7785..af46c59 100644
--- a/gremlin-server/conf/gremlin-server-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-secure.yaml
@@ -73,4 +73,8 @@ authentication: {
   config: {
     credentialsDb: conf/tinkergraph-credentials.properties}}
 ssl: {
-  enabled: true}
+  enabled: true,
+  # You must configure a keyStore!
+  #keyStore: server.jks,
+  #keyStorePassword: changeit
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index edea752..2a29fec 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -22,7 +22,6 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.handler.ssl.SslContext;
 import io.netty.handler.ssl.SslContextBuilder;
 import io.netty.handler.ssl.SslProvider;
-import io.netty.handler.ssl.util.SelfSignedCertificate;
 import io.netty.handler.timeout.IdleStateHandler;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 import org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoMessageSerializerV1d0;
@@ -43,8 +42,18 @@ import org.javatuples.Pair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLException;
+import javax.net.ssl.TrustManagerFactory;
+
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
 import java.security.cert.CertificateException;
 import java.util.Arrays;
 import java.util.Collections;
@@ -258,7 +267,7 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
         }
     }
 
-    private SslContext createSSLContext(final Settings settings)  {
+    private SslContext createSSLContext(final Settings settings) {
         final Settings.SslSettings sslSettings = settings.ssl;
 
         if (sslSettings.getSslContext().isPresent()) {
@@ -270,25 +279,62 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
 
         final SslContextBuilder builder;
 
-        // if the config doesn't contain a cert or key then use a self signed cert - not suitable for production
-        if (null == sslSettings.keyCertChainFile || null == sslSettings.keyFile) {
-            try {
-                logger.warn("Enabling SSL with self-signed certificate (NOT SUITABLE FOR PRODUCTION)");
-                final SelfSignedCertificate ssc = new SelfSignedCertificate();
-                builder = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey());
-            } catch (CertificateException ce) {
-                logger.error("There was an error creating the self-signed certificate for SSL - SSL is not enabled", ce);
-                return null;
-            }
-        } else {
+        // DEPRECATED: If the config has the required, deprecated settings, then use it
+        if (null != sslSettings.keyCertChainFile && null != sslSettings.keyFile) {
+            logger.warn("Using deprecated SSL keyFile support");
             final File keyCertChainFile = new File(sslSettings.keyCertChainFile);
             final File keyFile = new File(sslSettings.keyFile);
             final File trustCertChainFile = null == sslSettings.trustCertChainFile ? null : new File(sslSettings.trustCertChainFile);
 
-            // note that keyPassword may be null here if the keyFile is not password-protected. passing null to
+            // note that keyPassword may be null here if the keyFile is not
+            // password-protected. passing null to
             // trustManager is also ok (default will be used)
-            builder = SslContextBuilder.forServer(keyCertChainFile, keyFile, sslSettings.keyPassword)
-                    .trustManager(trustCertChainFile);
+            builder = SslContextBuilder.forServer(keyCertChainFile, keyFile, sslSettings.keyPassword).trustManager(trustCertChainFile);
+        } else {
+
+            // Build JSSE SSLContext
+            try {
+                final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+
+                // Load private key and signed cert
+                if (null != sslSettings.keyStore) {
+                    final String keyStoreType = null == sslSettings.keyStoreType ? KeyStore.getDefaultType() : sslSettings.keyStoreType;
+                    final KeyStore keystore = KeyStore.getInstance(keyStoreType);
+                    final char[] password = null == sslSettings.keyStorePassword ? null : sslSettings.keyStorePassword.toCharArray();
+                    try (final InputStream in = new FileInputStream(sslSettings.keyStore)) {
+                        keystore.load(in, password);
+                    }
+                    kmf.init(keystore, password);
+                }
+
+                builder = SslContextBuilder.forServer(kmf);
+
+                // Load custom truststore for client auth certs
+                if (null != sslSettings.trustStore) {
+                    final String keystoreType = null == sslSettings.keyStoreType ? KeyStore.getDefaultType() : sslSettings.keyStoreType;
+                    final KeyStore truststore = KeyStore.getInstance(keystoreType);
+                    final char[] password = null == sslSettings.trustStorePassword ? null : sslSettings.trustStorePassword.toCharArray();
+                    try (final InputStream in = new FileInputStream(sslSettings.trustStore)) {
+                        truststore.load(in, password);
+                    }
+                    final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+                    tmf.init(truststore);
+                    builder.trustManager(tmf);
+                }
+
+            } catch (UnrecoverableKeyException | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e) {
+                logger.error("There was an error enabling SSL.", e);
+                return null;
+            }
+
+        }
+
+        if (null != sslSettings.sslCipherSuites && !sslSettings.sslCipherSuites.isEmpty()) {
+            builder.ciphers(sslSettings.sslCipherSuites);
+        }
+
+        if (null != sslSettings.sslEnabledProtocols && !sslSettings.sslEnabledProtocols.isEmpty()) {
+            builder.protocols(sslSettings.sslEnabledProtocols.toArray(new String[] {}));
         }
 
         builder.clientAuth(sslSettings.needClientAuth).sslProvider(provider);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
index 74a5a1a..c918f8b 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
@@ -450,34 +450,86 @@ public class Settings {
      */
     public static class SslSettings {
         /**
-         * Enables SSL.  Other settings will be ignored unless this is set to true. By default a self-signed
-         * certificate is used (not suitable for production) for SSL.  To override this setting, be sure to set
-         * the {@link #keyCertChainFile} and the {@link #keyFile}.
+         * Enables SSL. Other SSL settings will be ignored unless this is set to true.
          */
         public boolean enabled = false;
 
         /**
          * The X.509 certificate chain file in PEM format.
+         * 
+         * @deprecated Use JSSE-based settings
          */
+        @Deprecated
         public String keyCertChainFile = null;
 
         /**
          * The PKCS#8 private key file in PEM format.
+         * 
+         * @deprecated Use JSSE-based settings
          */
+        @Deprecated
         public String keyFile = null;
 
         /**
-         * The password of the {@link #keyFile}, or {@code null} if it's not password-protected.
+         * The password of the {@link #keyFile}, or {@code null} if it's not
+         * password-protected.
+         * 
+         * @deprecated Use JSSE-based settings
          */
+        @Deprecated
         public String keyPassword = null;
 
         /**
-         * Trusted certificates for verifying the remote endpoint's certificate. The file should
-         * contain an X.509 certificate chain in PEM format. {@code null} uses the system default.
+         * Trusted certificates for verifying the remote endpoint's certificate. The
+         * file should contain an X.509 certificate chain in PEM format. {@code null}
+         * uses the system default.
+         * 
+         * @deprecated Use JSSE-based settings
          */
+        @Deprecated
         public String trustCertChainFile = null;
 
         /**
+         * JSSE keystore file path. Similar to setting JSSE property
+         * {@code javax.net.ssl.keyStore}.
+         */
+        public String keyStore;
+
+        /**
+         * JSSE keystore password. Similar to setting JSSE property
+         * {@code javax.net.ssl.keyStorePassword}.
+         */
+        public String keyStorePassword;
+
+        /**
+         * JSSE truststore file path. Similar to setting JSSE property
+         * {@code javax.net.ssl.trustStore}.
+         */
+        public String trustStore;
+
+        /**
+         * JSSE truststore password. Similar to setting JSSE property
+         * {@code javax.net.ssl.trustStorePassword}.
+         */
+        public String trustStorePassword;
+
+        /**
+         * JSSE keystore format. Similar to setting JSSE property
+         * {@code javax.net.ssl.keyStoreType}.
+         */
+        public String keyStoreType;
+
+        /**
+         * @see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSE_Protocols">JSSE Protocols</a>
+         */
+        public List<String> sslEnabledProtocols = new ArrayList<>();
+
+        /**
+         * @see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SupportedCipherSuites">Cipher Suites</a>
+         */
+        public List<String> sslCipherSuites = new ArrayList<>();
+
+        /**
          * Require client certificate authentication
          */
         public ClientAuth needClientAuth = ClientAuth.NONE;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
index f11a045..0543a59 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
@@ -38,6 +38,13 @@ import static org.junit.Assume.assumeThat;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public abstract class AbstractGremlinServerIntegrationTest {
+    
+    public static final String KEY_PASS = "changeit";
+    public static final String JKS_SERVER_KEY = "src/test/resources/server.jks";
+    public static final String JKS_CLIENT_KEY = "src/test/resources/client.jks";
+    public static final String P12_SERVER_KEY = "src/test/resources/server.p12";
+    public static final String P12_CLIENT_KEY = "src/test/resources/client.p12";
+
     protected GremlinServer server;
     private Settings overriddenSettings;
     private final static String epollOption = "gremlin.server.epoll";

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
index e06bbb7..b4d979a 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
@@ -66,6 +66,8 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
             case "shouldFailIfSslEnabledOnServerButNotClient":
                 final Settings.SslSettings sslConfig = new Settings.SslSettings();
                 sslConfig.enabled = true;
+                sslConfig.keyStore = JKS_SERVER_KEY;
+                sslConfig.keyStorePassword = KEY_PASS;
                 settings.ssl = sslConfig;
                 break;
         }
@@ -107,7 +109,7 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
     @Test
     public void shouldAuthenticateOverSslWithPlainText() throws Exception {
         final Cluster cluster = TestClientFactory.build()
-                .enableSsl(true)
+                .enableSsl(true).sslSkipCertValidation(true)
                 .credentials("stephen", "password").create();
         final Client client = cluster.connect();
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
index b26dd1e..10755f1 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthOldIntegrateTest.java
@@ -69,6 +69,8 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
             case "shouldFailIfSslEnabledOnServerButNotClient":
                 final Settings.SslSettings sslConfig = new Settings.SslSettings();
                 sslConfig.enabled = true;
+                sslConfig.keyStore = JKS_SERVER_KEY;
+                sslConfig.keyStorePassword = KEY_PASS;
                 settings.ssl = sslConfig;
                 break;
         }
@@ -110,7 +112,7 @@ public class GremlinServerAuthOldIntegrateTest extends AbstractGremlinServerInte
     @Test
     public void shouldAuthenticateOverSslWithPlainText() throws Exception {
         final Cluster cluster = TestClientFactory.build()
-                .enableSsl(true)
+                .enableSsl(true).keyStore(JKS_SERVER_KEY).keyStorePassword(KEY_PASS).sslSkipCertValidation(true)
                 .credentials("stephen", "password").create();
         final Client client = cluster.connect();
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index eb5def9..238d2b2 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -110,11 +110,10 @@ import static org.junit.Assert.assertEquals;
  */
 public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegrationTest {
 
-    private static final String SERVER_KEY = "src/test/resources/server.key.pk8";
-    private static final String SERVER_CRT = "src/test/resources/server.crt";
-    private static final String KEY_PASS = "changeit";
-    private static final String CLIENT_KEY = "src/test/resources/client.key.pk8";
-    private static final String CLIENT_CRT = "src/test/resources/client.crt";
+    private static final String PEM_SERVER_KEY = "src/test/resources/server.key.pk8";
+    private static final String PEM_SERVER_CRT = "src/test/resources/server.crt";
+    private static final String PEM_CLIENT_KEY = "src/test/resources/client.key.pk8";
+    private static final String PEM_CLIENT_CRT = "src/test/resources/client.crt";
     private Level previousLogLevel;
 
     private Log4jRecordingAppender recordingAppender = null;
@@ -194,6 +193,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
             case "shouldEnableSslButFailIfClientConnectsWithoutIt":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
+                settings.ssl.keyStore = JKS_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
                 break;
             case "shouldEnableSslWithSslContextProgrammaticallySpecified":
                 settings.ssl = new Settings.SslSettings();
@@ -204,31 +205,31 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
-                settings.ssl.keyCertChainFile = SERVER_CRT;
-                settings.ssl.keyFile = SERVER_KEY;
+                settings.ssl.keyCertChainFile = PEM_SERVER_CRT;
+                settings.ssl.keyFile = PEM_SERVER_KEY;
                 settings.ssl.keyPassword =KEY_PASS;
                 // Trust the client
-                settings.ssl.trustCertChainFile = CLIENT_CRT;
+                settings.ssl.trustCertChainFile = PEM_CLIENT_CRT;
             	break;
             case "shouldEnableSslAndClientCertificateAuthAndFailWithoutCert":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
-                settings.ssl.keyCertChainFile = SERVER_CRT;
-                settings.ssl.keyFile = SERVER_KEY;
+                settings.ssl.keyCertChainFile = PEM_SERVER_CRT;
+                settings.ssl.keyFile = PEM_SERVER_KEY;
                 settings.ssl.keyPassword =KEY_PASS;
                 // Trust the client
-                settings.ssl.trustCertChainFile = CLIENT_CRT;
+                settings.ssl.trustCertChainFile = PEM_CLIENT_CRT;
             	break;
             case "shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCert":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
-                settings.ssl.keyCertChainFile = SERVER_CRT;
-                settings.ssl.keyFile = SERVER_KEY;
+                settings.ssl.keyCertChainFile = PEM_SERVER_CRT;
+                settings.ssl.keyFile = PEM_SERVER_KEY;
                 settings.ssl.keyPassword =KEY_PASS;
                 // Trust ONLY the server cert
-                settings.ssl.trustCertChainFile = SERVER_CRT;
+                settings.ssl.trustCertChainFile = PEM_SERVER_CRT;
             	break;
             case "shouldUseSimpleSandbox":
                 settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForSimpleSandbox();
@@ -485,7 +486,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
 
     @Test
     public void shouldEnableSsl() {
-        final Cluster cluster = TestClientFactory.build().enableSsl(true).create();
+        final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_SERVER_KEY).keyStorePassword(KEY_PASS).sslSkipCertValidation(true).create();
         final Client client = cluster.connect();
 
         try {
@@ -533,8 +534,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     @Test
     public void shouldEnableSslAndClientCertificateAuth() {
 		final Cluster cluster = TestClientFactory.build().enableSsl(true)
-				.keyCertChainFile(CLIENT_CRT).keyFile(CLIENT_KEY)
-				.keyPassword(KEY_PASS).trustCertificateChainFile(SERVER_CRT).create();
+				.keyCertChainFile(PEM_CLIENT_CRT).keyFile(PEM_CLIENT_KEY)
+				.keyPassword(KEY_PASS).trustCertificateChainFile(PEM_SERVER_CRT).create();
 		final Client client = cluster.connect();
 
         try {
@@ -546,7 +547,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
 
     @Test
     public void shouldEnableSslAndClientCertificateAuthAndFailWithoutCert() {
-        final Cluster cluster = TestClientFactory.build().enableSsl(true).create();
+        final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_SERVER_KEY).keyStorePassword(KEY_PASS).sslSkipCertValidation(true).create();
         final Client client = cluster.connect();
 
         try {
@@ -563,8 +564,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     @Test
     public void shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCert() {
 		final Cluster cluster = TestClientFactory.build().enableSsl(true)
-				.keyCertChainFile(CLIENT_CRT).keyFile(CLIENT_KEY)
-				.keyPassword(KEY_PASS).trustCertificateChainFile(SERVER_CRT).create();
+				.keyCertChainFile(PEM_CLIENT_CRT).keyFile(PEM_CLIENT_KEY)
+				.keyPassword(KEY_PASS).trustCertificateChainFile(PEM_SERVER_CRT).create();
 		final Client client = cluster.connect();
 
         try {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
index 738ca89..300a7f4 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
@@ -100,6 +100,8 @@ abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGre
             case "shouldWorkWithSSL":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
+                settings.ssl.keyStore = JKS_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
                 break;
             case "shouldWorkWithAuth":
                 if (authSettings != null) {
@@ -109,6 +111,8 @@ abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGre
             case "shouldWorkWithSSLAndAuth":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
+                settings.ssl.keyStore = JKS_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
                 if (authSettings != null) {
                     settings.authentication = getAuthSettings();
                 }
@@ -304,7 +308,7 @@ abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGre
                                                 .with(Property.USERNAME, username)
                                                 .with(Property.PASSWORD, password);
 
-                nioCluster = nioBuilder.enableSsl(secure).authProperties(authProps).create();
+                nioCluster = nioBuilder.enableSsl(secure).sslSkipCertValidation(true).authProperties(authProps).create();
                 nioClient = nioCluster.connect();
             } else {
                 nioCluster = nioBuilder.enableSsl(secure).create();
@@ -318,10 +322,10 @@ abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGre
                                                 .with(Property.USERNAME, username)
                                                 .with(Property.PASSWORD, password);
 
-                wsCluster = wsBuilder.enableSsl(secure).authProperties(authProps).create();
+                wsCluster = wsBuilder.enableSsl(secure).sslSkipCertValidation(true).authProperties(authProps).create();
                 wsClient = wsCluster.connect();
             } else {
-                wsCluster = wsBuilder.enableSsl(secure).create();
+                wsCluster = wsBuilder.enableSsl(secure).sslSkipCertValidation(true).create();
                 wsClient = wsCluster.connect();
             }
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/test/resources/server.jks
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/server.jks b/gremlin-server/src/test/resources/server.jks
new file mode 100644
index 0000000..85dbe67
Binary files /dev/null and b/gremlin-server/src/test/resources/server.jks differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e3b4ae5d/gremlin-server/src/test/resources/server.p12
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/server.p12 b/gremlin-server/src/test/resources/server.p12
new file mode 100644
index 0000000..4d1aad7
Binary files /dev/null and b/gremlin-server/src/test/resources/server.p12 differ


[50/50] tinkerpop git commit: TINKERPOP-2021 ignored failing test related to this issue until it can be resolved CTR

Posted by sp...@apache.org.
TINKERPOP-2021 ignored failing test related to this issue until it can be resolved CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8c280c11
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8c280c11
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8c280c11

Branch: refs/heads/TINKERPOP-2021
Commit: 8c280c11313e3e935ee115d00c32a6bdfdeb20cc
Parents: fd25300
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 4 13:41:54 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 4 13:41:54 2018 -0400

----------------------------------------------------------------------
 gremlin-python/src/main/jython/tests/driver/test_client.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c280c11/gremlin-python/src/main/jython/tests/driver/test_client.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_client.py b/gremlin-python/src/main/jython/tests/driver/test_client.py
index 0459428..e03ffee 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_client.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_client.py
@@ -22,7 +22,7 @@ from gremlin_python.driver.client import Client
 from gremlin_python.driver.request import RequestMessage
 from gremlin_python.process.graph_traversal import __
 from gremlin_python.structure.graph import Graph
-from gremlin_python.driver import serializer
+from unittest import skip
 
 __author__ = 'David M. Brown (davebshow@gmail.com)'
 
@@ -114,6 +114,7 @@ def test_multi_conn_pool(client):
     assert len(result_set.all().result()) == 6
 
 
+@skip("TINKERPOP-2021")
 def test_big_result_set(client):
     g = Graph().traversal()
     t = g.inject(1).repeat(__.addV('person').property('name', __.loops())).times(20000).count()


[25/50] tinkerpop git commit: Fixed up pageRank() tests to be more GLV compliant CTR

Posted by sp...@apache.org.
Fixed up pageRank() tests to be more GLV compliant CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/69d46f73
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/69d46f73
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/69d46f73

Branch: refs/heads/TINKERPOP-2021
Commit: 69d46f7335fac24e2210987eefa16036ceea8d46
Parents: bdda913
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Aug 14 12:51:07 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Aug 14 12:51:07 2018 -0400

----------------------------------------------------------------------
 .../test/cucumber/feature-steps.js              |  6 +-
 gremlin-test/features/map/PageRank.feature      | 47 +++++++++++-----
 .../traversal/step/map/PageRankTest.java        | 59 ++++++++++----------
 3 files changed, 63 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69d46f73/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
index 0cddc02..8a14112 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
@@ -67,9 +67,9 @@ const ignoredScenarios = {
   'g_V_outXcreatedX_pageRank_byXbothEX_byXprojectRankX_timesX0X_valueMapXname_projectRankX': new IgnoreError(ignoreReason.computerNotSupported),
   'g_V_pageRank_order_byXpageRank_decrX_byXnameX_name': new IgnoreError(ignoreReason.computerNotSupported),
   'g_V_pageRank_order_byXpageRank_decrX_name_limitX2X': new IgnoreError(ignoreReason.computerNotSupported),
-  'g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX': new IgnoreError(ignoreReason.computerNotSupported),
-  'g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX': new IgnoreError(ignoreReason.computerNotSupported),
-  'g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX': new IgnoreError(ignoreReason.computerNotSupported),
+  'g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_project_byXnameX_byXvaluesXfriendRankX_mathX': new IgnoreError(ignoreReason.computerNotSupported),
+  'g_V_hasLabelXpersonX_pageRank_byXpageRankX_project_byXnameX_byXvaluesXpageRankX_mathX': new IgnoreError(ignoreReason.computerNotSupported),
+  'g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX_by_byXmathX': new IgnoreError(ignoreReason.computerNotSupported),
   'g_V_hasLabelXsoftwareX_hasXname_rippleX_pageRankX1X_byXinEXcreatedXX_timesX1X_byXpriorsX_inXcreatedX_unionXboth__identityX_valueMapXname_priorsX': new IgnoreError(ignoreReason.computerNotSupported),
   'g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_byXpageRankX_byXinEX_timesX1X_inXcreatedX_groupXmX_byXpageRankX_capXmX': new IgnoreError(ignoreReason.computerNotSupported),
   'g_V_peerPressure_hasXclusterX': new IgnoreError(ignoreReason.computerNotSupported),

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69d46f73/gremlin-test/features/map/PageRank.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/PageRank.feature b/gremlin-test/features/map/PageRank.feature
index 24a19ec..bd3fc6b 100644
--- a/gremlin-test/features/map/PageRank.feature
+++ b/gremlin-test/features/map/PageRank.feature
@@ -76,30 +76,47 @@ Feature: Step - pageRank()
       | lop    |
       | ripple |
 
-  Scenario: g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX
+  Scenario: g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_project_byXnameX_byXvaluesXfriendRankX_mathX
     Given the modern graph
-    Given an unsupported test
-    Then nothing should happen because
+    And the traversal of
       """
-      The result is not completely deterministic with respect to the decimals that pageRank() produces and the
-      GLV framework does not have a notion for asserting anything beyond an equals() sort of state.
+      g.withComputer().V().pageRank().by(__.outE("knows")).by("friendRank").project("name", "friendRank").by("name").by(__.values("friendRank").math("ceil(_ * 100)"))
       """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"name": "marko", "friendRank": 15.0}] |
+      | m[{"name": "vadas", "friendRank": 21.0}] |
+      | m[{"name": "lop", "friendRank": 15.0}] |
+      | m[{"name": "josh", "friendRank": 21.0}] |
+      | m[{"name": "ripple", "friendRank": 15.0}] |
+      | m[{"name": "peter", "friendRank": 15.0}] |
 
-  Scenario: g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX
-    Given an unsupported test
-    Then nothing should happen because
+  Scenario: g_V_hasLabelXpersonX_pageRank_byXpageRankX_project_byXnameX_byXvaluesXpageRankX_mathX
+    Given the modern graph
+    And the traversal of
       """
-      The result is not completely deterministic with respect to the decimals that pageRank() produces and the
-      GLV framework does not have a notion for asserting anything beyond an equals() sort of state.
+      g.withComputer().V().hasLabel("person").pageRank().by("pageRank").project("name", "pageRank").by("name").by(__.values("pageRank").math("ceil(_ * 100)"))
       """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"name": "marko", "pageRank": 46.0}] |
+      | m[{"name": "vadas", "pageRank": 59.0}] |
+      | m[{"name": "josh", "pageRank": 59.0}] |
+      | m[{"name": "peter", "pageRank": 46.0}] |
 
-  Scenario: g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX
-    Given an unsupported test
-    Then nothing should happen because
+  Scenario: g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX_by_byXmathX
+    Given the modern graph
+    And the traversal of
       """
-      The result is not completely deterministic with respect to the decimals that pageRank() produces and the
-      GLV framework does not have a notion for asserting anything beyond an equals() sort of state.
+      g.withComputer().V().pageRank().by("pageRank").as("a").out("knows").values("pageRank").as("b").select("a", "b").by().by(__.math("ceil(_ * 100)"))
       """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a": "v[marko]", "b": 15.0}] |
+      | m[{"a": "v[marko]", "b": 15.0}] |
 
   Scenario: g_V_hasLabelXsoftwareX_hasXname_rippleX_pageRankX1X_byXinEXcreatedXX_timesX1X_byXpriorsX_inXcreatedX_unionXboth__identityX_valueMapXname_priorsX
     Given the modern graph

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69d46f73/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
index 620d0e3..3eb06c4 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
@@ -56,11 +56,11 @@ public abstract class PageRankTest extends AbstractGremlinProcessTest {
 
     public abstract Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_descX_name_limitX2X();
 
-    public abstract Traversal<Vertex, Map<String, List<Object>>> get_g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX();
+    public abstract Traversal<Vertex, Map<String, Object>> get_g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_project_byXnameX_byXvaluesXfriendRankX_mathX();
 
-    public abstract Traversal<Vertex, Map<String, List<Object>>> get_g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX();
+    public abstract Traversal<Vertex, Map<String, Object>> get_g_V_hasLabelXpersonX_pageRank_byXpageRankX_project_byXnameX_byXvaluesXpageRankX_mathX();
 
-    public abstract Traversal<Vertex, Map<String, Object>> get_g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX();
+    public abstract Traversal<Vertex, Map<String, Object>> get_g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX_by_byXmathX();
 
     public abstract Traversal<Vertex, Map<String, List<Object>>> get_g_V_hasLabelXsoftwareX_hasXname_rippleX_pageRankX1X_byXinEXcreatedXX_timesX1X_byXpriorsX_inXcreatedX_unionXboth__identityX_valueMapXname_priorsX();
 
@@ -109,21 +109,19 @@ public abstract class PageRankTest extends AbstractGremlinProcessTest {
 
     @Test
     @LoadGraphWith(MODERN)
-    public void g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX() {
-        final Traversal<Vertex, Map<String, List<Object>>> traversal = get_g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX();
+    public void g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_project_byXnameX_byXvaluesXfriendRankX_mathX() {
+        final Traversal<Vertex, Map<String, Object>> traversal = get_g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_project_byXnameX_byXvaluesXfriendRankX_mathX();
         printTraversalForm(traversal);
         int counter = 0;
         while (traversal.hasNext()) {
-            final Map<String, List<Object>> map = traversal.next();
+            final Map<String, Object> map = traversal.next();
             assertEquals(2, map.size());
-            assertEquals(1, map.get("name").size());
-            assertEquals(1, map.get("friendRank").size());
-            String name = (String) map.get("name").get(0);
-            Double friendRank = (Double) map.get("friendRank").get(0);
+            final String name = (String) map.get("name");
+            final Double friendRank = (Double) map.get("friendRank");
             if (name.equals("lop") || name.equals("ripple") || name.equals("peter") || name.equals("marko"))
-                assertEquals(0.15, friendRank, 0.01);
+                assertEquals(15.0, friendRank, 0.01);
             else
-                assertEquals(0.21375, friendRank, 0.01);
+                assertEquals(21.0, friendRank, 0.01);
 
             counter++;
         }
@@ -143,21 +141,20 @@ public abstract class PageRankTest extends AbstractGremlinProcessTest {
 
     @Test
     @LoadGraphWith(MODERN)
-    public void g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX() {
-        final Traversal<Vertex, Map<String, List<Object>>> traversal = get_g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX();
+    public void g_V_hasLabelXpersonX_pageRank_byXpageRankX_project_byXnameX_byXvaluesXpageRankX_mathX() {
+        final Traversal<Vertex, Map<String, Object>> traversal = get_g_V_hasLabelXpersonX_pageRank_byXpageRankX_project_byXnameX_byXvaluesXpageRankX_mathX();
         printTraversalForm(traversal);
         int counter = 0;
-        double lastPageRank = Double.MIN_VALUE;
         while (traversal.hasNext()) {
-            final Map<String, List<Object>> map = traversal.next();
+            final Map<String, Object> map = traversal.next();
             assertEquals(2, map.size());
-            assertEquals(1, map.get("name").size());
-            assertEquals(1, map.get("pageRank").size());
-            String name = (String) map.get("name").get(0);
-            double pageRank = (Double) map.get("pageRank").get(0);
-            assertTrue(pageRank >= lastPageRank);
-            lastPageRank = pageRank;
-            assertFalse(name.equals("lop") || name.equals("ripple"));
+            final String name = (String) map.get("name");
+            final Double pageRank = (Double) map.get("pageRank");
+            if (name.equals("marko") || name.equals("peter"))
+                assertEquals(46.0, pageRank, 0.01);
+            else
+                assertEquals(59.0, pageRank, 0.01);
+
             counter++;
         }
         assertEquals(4, counter);
@@ -165,8 +162,8 @@ public abstract class PageRankTest extends AbstractGremlinProcessTest {
 
     @Test
     @LoadGraphWith(MODERN)
-    public void g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX() {
-        final Traversal<Vertex, Map<String, Object>> traversal = get_g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX();
+    public void g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX_by_byXmathX() {
+        final Traversal<Vertex, Map<String, Object>> traversal = get_g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX_by_byXmathX();
         printTraversalForm(traversal);
         int counter = 0;
         while (traversal.hasNext()) {
@@ -246,8 +243,8 @@ public abstract class PageRankTest extends AbstractGremlinProcessTest {
         }
 
         @Override
-        public Traversal<Vertex, Map<String, List<Object>>> get_g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX() {
-            return g.V().pageRank().by(__.outE("knows")).by("friendRank").valueMap("name", "friendRank");
+        public Traversal<Vertex, Map<String, Object>> get_g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_project_byXnameX_byXvaluesXfriendRankX_mathX() {
+            return g.V().pageRank().by(__.outE("knows")).by("friendRank").project("name", "friendRank").by("name").by(__.values("friendRank").math("ceil(_ * 100)"));
         }
 
         @Override
@@ -261,13 +258,13 @@ public abstract class PageRankTest extends AbstractGremlinProcessTest {
         }
 
         @Override
-        public Traversal<Vertex, Map<String, List<Object>>> get_g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX() {
-            return g.V().hasLabel("person").pageRank().by("pageRank").order().by("pageRank").valueMap("name", "pageRank");
+        public Traversal<Vertex, Map<String, Object>> get_g_V_hasLabelXpersonX_pageRank_byXpageRankX_project_byXnameX_byXvaluesXpageRankX_mathX() {
+            return g.V().hasLabel("person").pageRank().by("pageRank").project("name", "pageRank").by("name").by(__.values("pageRank").math("ceil(_ * 100)"));
         }
 
         @Override
-        public Traversal<Vertex, Map<String, Object>> get_g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX() {
-            return g.V().pageRank().by("pageRank").as("a").out("knows").values("pageRank").as("b").select("a", "b");
+        public Traversal<Vertex, Map<String, Object>> get_g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX_by_byXmathX() {
+            return g.V().pageRank().by("pageRank").as("a").out("knows").values("pageRank").as("b").select("a", "b").by().by(__.math("ceil(_ * 100)"));
         }
 
         @Override


[32/50] tinkerpop git commit: Removed deprecated settings from docs, updated javadoc

Posted by sp...@apache.org.
Removed deprecated settings from docs, updated javadoc


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/bbc0265c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bbc0265c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bbc0265c

Branch: refs/heads/TINKERPOP-2021
Commit: bbc0265c06f803d06ec2b6a600d4632d3f7d7d9b
Parents: 6434d04
Author: Robert Dale <ro...@gmail.com>
Authored: Fri Aug 17 15:47:27 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Aug 17 15:47:27 2018 -0400

----------------------------------------------------------------------
 .../src/reference/gremlin-applications.asciidoc |  8 ----
 .../tinkerpop/gremlin/driver/Cluster.java       | 42 +++++++++++---------
 .../tinkerpop/gremlin/driver/Settings.java      | 10 ++---
 .../tinkerpop/gremlin/server/Settings.java      | 34 ++++++++--------
 4 files changed, 46 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbc0265c/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index d13e2ef..8372a8a 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -730,9 +730,6 @@ The following table describes the various configuration options for the Gremlin
 |connectionPool.channelizer |The fully qualified classname of the client `Channelizer` that defines how to connect to the server. |`Channelizer.WebSocketChannelizer`
 |connectionPool.enableSsl |Determines if SSL should be enabled or not. If enabled on the server then it must be enabled on the client. |false
 |connectionPool.keepAliveInterval |Length of time in milliseconds to wait on an idle connection before sending a keep-alive request. Set to zero to disable this feature. |1800000
-|connectionPool.keyCertChainFile |The X.509 certificate chain file in PEM format. |_none_
-|connectionPool.keyFile |The `PKCS#8` private key file in PEM format. |_none_
-|connectionPool.keyPassword |The password of the `keyFile` if it is password-protected. |_none_
 |connectionPool.keyStore |The private key in JKS or PKCS#12 format. |_none_
 |connectionPool.keyStorePassword |The password of the `keyStore` if it is password-protected. |_none_
 |connectionPool.keyStoreType |`JKS` (Java 8 default) or `PKCS12` (Java 9+ default)|_none_
@@ -751,7 +748,6 @@ The following table describes the various configuration options for the Gremlin
 |connectionPool.sslCipherSuites |The list of JSSE ciphers to support for SSL connections. If specified, only the ciphers that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
 |connectionPool.sslEnabledProtocols |The list of SSL protocols to support for SSL connections. If specified, only the protocols that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
 |connectionPool.sslSkipCertValidation |Configures the `TrustManager` to trust all certs without any validation. Should not be used in production.|false
-|connectionPool.trustCertChainFile |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
 |connectionPool.trustStore |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
 |connectionPool.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_
 |hosts |The list of hosts that the driver will connect to. |localhost
@@ -1156,16 +1152,12 @@ The following table describes the various configuration options that Gremlin Ser
 |serializers[X].className |The full class name of the `MessageSerializer` implementation. |_none_
 |serializers[X].config |A `Map` containing `MessageSerializer` specific configurations. |_none_
 |ssl.enabled |Determines if SSL is turned on or not. |false
-|ssl.keyCertChainFile |The X.509 certificate chain file in PEM format.|_none_
-|ssl.keyFile |The `PKCS#8` private key file in PEM format.|_none_
-|ssl.keyPassword |The password of the `keyFile` if it is password-protected. |_none_
 |ssl.keyStore |The private key in JKS or PKCS#12 format.  |_none_
 |ssl.keyStorePassword |The password of the `keyStore` if it is password-protected. |_none_
 |ssl.keyStoreType |`JKS` (Java 8 default) or `PKCS12` (Java 9+ default) |_none_
 |ssl.needClientAuth | Optional. One of NONE, OPTIONAL, REQUIRE.  Enables client certificate authentication at the enforcement level specified. Can be used in combination with Authenticator. |_none_
 |ssl.sslCipherSuites |The list of JSSE ciphers to support for SSL connections. If specified, only the ciphers that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
 |ssl.sslEnabledProtocols |The list of SSL protocols to support for SSL connections. If specified, only the protocols that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
-|ssl.trustCertChainFile | Required when needClientAuth is OPTIONAL or REQUIRE. Trusted certificates for verifying the remote endpoint's certificate. The file should contain an X.509 certificate chain in PEM format. |_none_
 |ssl.trustStore |Required when needClientAuth is OPTIONAL or REQUIRE. Trusted certificates for verifying the remote endpoint's certificate. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
 |ssl.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_
 |strictTransactionManagement |Set to `true` to require `aliases` to be submitted on every requests, where the `aliases` become the scope of transaction management. |false

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbc0265c/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
index 6e4ef25..7ae8d2d 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
@@ -569,11 +569,11 @@ public final class Cluster {
         private String keyCertChainFile = null;
         private String keyFile = null;
         private String keyPassword = null;
-        private String keyStore;
-        private String keyStorePassword;
-        private String trustStore;
-        private String trustStorePassword;
-        private String keyStoreType;
+        private String keyStore = null;
+        private String keyStorePassword = null;
+        private String trustStore = null;
+        private String trustStorePassword = null;
+        private String keyStoreType = null;
         private List<String> sslEnabledProtocols = new ArrayList<>();
         private List<String> sslCipherSuites = new ArrayList<>();
         private boolean sslSkipCertValidation = false;
@@ -655,9 +655,8 @@ public final class Cluster {
 
         /**
          * File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and
-         * SSL is enabled, the {@link TrustManager} will be established with a self-signed certificate which is NOT
-         * suitable for production purposes.
-         * @deprecated
+         * SSL is enabled, the default {@link TrustManager} will be used.
+         * @deprecated As of release 3.2.10, replaced by {@link trustStore}
          */
         @Deprecated
         public Builder trustCertificateChainFile(final String certificateChainFile) {
@@ -677,7 +676,7 @@ public final class Cluster {
 
         /**
          * The X.509 certificate chain file in PEM format.
-         * @deprecated
+         * @deprecated As of release 3.2.10, replaced by {@link keyStore}
          */
         @Deprecated
         public Builder keyCertChainFile(final String keyCertChainFile) {
@@ -687,7 +686,7 @@ public final class Cluster {
 
         /**
          * The PKCS#8 private key file in PEM format.
-         * @deprecated
+         * @deprecated As of release 3.2.10, replaced by {@link keyStore}
          */
         @Deprecated
         public Builder keyFile(final String keyFile) {
@@ -697,7 +696,7 @@ public final class Cluster {
 
         /**
          * The password of the {@link #keyFile}, or {@code null} if it's not password-protected.
-         * @deprecated
+         * @deprecated As of release 3.2.10, replaced by {@link keyStorePassword}
          */
         @Deprecated
         public Builder keyPassword(final String keyPassword) {
@@ -706,7 +705,7 @@ public final class Cluster {
         }
         
         /**
-         * 
+         * The file location of the private key in JKS or PKCS#12 format.
          */
         public Builder keyStore(final String keyStore) {
             this.keyStore = keyStore;
@@ -714,7 +713,7 @@ public final class Cluster {
         }
         
         /**
-         * 
+         * The password of the {@link #keyStore}, or {@code null} if it's not password-protected.
          */
         public Builder keyStorePassword(final String keyStorePassword) {
             this.keyStorePassword = keyStorePassword;
@@ -722,7 +721,8 @@ public final class Cluster {
         }
         
         /**
-         * 
+         * The file location for a SSL Certificate Chain to use when SSL is enabled. If
+         * this value is not provided and SSL is enabled, the default {@link TrustManager} will be used.
          */
         public Builder trustStore(final String trustStore) {
             this.trustStore = trustStore;
@@ -730,7 +730,7 @@ public final class Cluster {
         }
         
         /**
-         * 
+         * The password of the {@link #trustStore}, or {@code null} if it's not password-protected.
          */
         public Builder trustStorePassword(final String trustStorePassword) {
             this.trustStorePassword = trustStorePassword;
@@ -738,7 +738,7 @@ public final class Cluster {
         }
         
         /**
-         * 
+         * The format of the {@link keyStore}, either {@code JKS} or {@code PKCS12} 
          */
         public Builder keyStoreType(final String keyStoreType) {
             this.keyStoreType = keyStoreType;
@@ -746,7 +746,9 @@ public final class Cluster {
         }
         
         /**
-         * 
+         * A list of SSL protocols to enable. @see <a href=
+         *      "https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSE_Protocols">JSSE
+         *      Protocols</a>
          */
         public Builder sslEnabledProtocols(final List<String> sslEnabledProtocols) {
             this.sslEnabledProtocols = sslEnabledProtocols;
@@ -754,7 +756,9 @@ public final class Cluster {
         }
         
         /**
-         * 
+         * A list of cipher suites to enable. @see <a href=
+         *      "https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SupportedCipherSuites">Cipher
+         *      Suites</a>
          */
         public Builder sslCipherSuites(final List<String> sslCipherSuites) {
             this.sslCipherSuites = sslCipherSuites;
@@ -762,7 +766,7 @@ public final class Cluster {
         }
         
         /**
-         * 
+         * If true, trust all certificates and do not perform any validation.
          */
         public Builder sslSkipCertValidation(final boolean sslSkipCertValidation) {
             this.sslSkipCertValidation = sslSkipCertValidation;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbc0265c/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
index 4d54792..fedd337 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
@@ -258,28 +258,28 @@ final class Settings {
 
         /**
          * The trusted certificate in PEM format.
-         * @deprecated Use JSSE-based settings
+         * @deprecated As of release 3.2.10, replaced by {@link trustStore}
          */
         @Deprecated
         public String trustCertChainFile = null;
 
         /**
          * The X.509 certificate chain file in PEM format.
-         * @deprecated Use JSSE-based settings
+         * @deprecated As of release 3.2.10, replaced by {@link keyStore}
          */
         @Deprecated
         public String keyCertChainFile = null;
 
         /**
          * The PKCS#8 private key file in PEM format.
-         * @deprecated Use JSSE-based settings
+         * @deprecated As of release 3.2.10, replaced by {@link keyStore}
          */
         @Deprecated
         public String keyFile = null;
 
         /**
          * The password of the {@link #keyFile}, or {@code null} if it's not password-protected.
-         * @deprecated Use JSSE-based settings
+         * @deprecated As of release 3.2.10, replaced by {@link keyStorePassword}
          */
         @Deprecated
         public String keyPassword = null;
@@ -329,7 +329,7 @@ final class Settings {
         public List<String> sslCipherSuites = new ArrayList<>();
 
         /**
-         * 
+         * If true, trust all certificates and do not perform any validation.
          */
         public boolean sslSkipCertValidation = false;
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bbc0265c/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
index c918f8b..4acfea0 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
@@ -51,6 +51,8 @@ import java.util.Optional;
 import java.util.ServiceLoader;
 import java.util.UUID;
 
+import javax.net.ssl.TrustManager;
+
 /**
  * Server settings as configured by a YAML file.
  *
@@ -457,7 +459,7 @@ public class Settings {
         /**
          * The X.509 certificate chain file in PEM format.
          * 
-         * @deprecated Use JSSE-based settings
+         * @deprecated As of release 3.2.10, replaced by {@link keyStore}
          */
         @Deprecated
         public String keyCertChainFile = null;
@@ -465,7 +467,7 @@ public class Settings {
         /**
          * The PKCS#8 private key file in PEM format.
          * 
-         * @deprecated Use JSSE-based settings
+         * @deprecated As of release 3.2.10, replaced by {@link keyStore}
          */
         @Deprecated
         public String keyFile = null;
@@ -474,7 +476,7 @@ public class Settings {
          * The password of the {@link #keyFile}, or {@code null} if it's not
          * password-protected.
          * 
-         * @deprecated Use JSSE-based settings
+         * @deprecated As of release 3.2.10, replaced by {@link keyStorePassword}
          */
         @Deprecated
         public String keyPassword = null;
@@ -484,48 +486,48 @@ public class Settings {
          * file should contain an X.509 certificate chain in PEM format. {@code null}
          * uses the system default.
          * 
-         * @deprecated Use JSSE-based settings
+         * @deprecated As of release 3.2.10, replaced by {@link trustStore}
          */
         @Deprecated
         public String trustCertChainFile = null;
 
         /**
-         * JSSE keystore file path. Similar to setting JSSE property
-         * {@code javax.net.ssl.keyStore}.
+         * The file location of the private key in JKS or PKCS#12 format.
          */
         public String keyStore;
 
         /**
-         * JSSE keystore password. Similar to setting JSSE property
-         * {@code javax.net.ssl.keyStorePassword}.
+         * The password of the {@link #keyStore}, or {@code null} if it's not password-protected.
          */
         public String keyStorePassword;
 
         /**
-         * JSSE truststore file path. Similar to setting JSSE property
-         * {@code javax.net.ssl.trustStore}.
+         * Trusted certificates for verifying the remote client's certificate. If
+         * this value is not provided and SSL is enabled, the default {@link TrustManager} will be used.
          */
         public String trustStore;
 
         /**
-         * JSSE truststore password. Similar to setting JSSE property
-         * {@code javax.net.ssl.trustStorePassword}.
+         * The password of the {@link #trustStore}, or {@code null} if it's not password-protected.
          */
         public String trustStorePassword;
 
         /**
-         * JSSE keystore format. Similar to setting JSSE property
-         * {@code javax.net.ssl.keyStoreType}.
+         * The format of the {@link keyStore}, either {@code JKS} or {@code PKCS12}
          */
         public String keyStoreType;
 
         /**
-         * @see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSE_Protocols">JSSE Protocols</a>
+         * A list of SSL protocols to enable. @see <a href=
+         *      "https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSE_Protocols">JSSE
+         *      Protocols</a>
          */
         public List<String> sslEnabledProtocols = new ArrayList<>();
 
         /**
-         * @see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SupportedCipherSuites">Cipher Suites</a>
+         * A list of cipher suites to enable. @see <a href=
+         *      "https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SupportedCipherSuites">Cipher
+         *      Suites</a>
          */
         public List<String> sslCipherSuites = new ArrayList<>();
 


[46/50] tinkerpop git commit: merge TINKERPOP-2023

Posted by sp...@apache.org.
merge TINKERPOP-2023


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e937a3a5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e937a3a5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e937a3a5

Branch: refs/heads/TINKERPOP-2021
Commit: e937a3a50a45d23dac114529c5062391f940fbcd
Parents: 3afc576 b77c0c7
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Sep 4 07:26:23 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Sep 4 07:26:23 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../src/reference/gremlin-applications.asciidoc |  82 +++++--
 .../upgrade/release-3.2.x-incubating.asciidoc   |  26 +++
 gremlin-console/conf/remote-secure.yaml         |   5 +-
 .../tinkerpop/gremlin/driver/Cluster.java       | 180 ++++++++++++++-
 .../tinkerpop/gremlin/driver/Settings.java      |  83 +++++++
 .../tinkerpop/gremlin/driver/SettingsTest.java  |  17 ++
 .../conf/gremlin-server-rest-secure.yaml        |   7 +-
 gremlin-server/conf/gremlin-server-secure.yaml  |   7 +-
 .../gremlin/server/AbstractChannelizer.java     |  90 ++++++--
 .../tinkerpop/gremlin/server/Settings.java      |  66 +++++-
 .../AbstractGremlinServerIntegrationTest.java   |  13 ++
 .../server/GremlinServerAuthIntegrateTest.java  |   4 +-
 .../GremlinServerAuthOldIntegrateTest.java      |   4 +-
 .../server/GremlinServerIntegrateTest.java      | 223 ++++++++++++++++---
 ...ctGremlinServerChannelizerIntegrateTest.java |  12 +-
 .../src/test/resources/client-key.jks           | Bin 0 -> 2241 bytes
 .../src/test/resources/client-key.p12           | Bin 0 -> 2583 bytes
 .../src/test/resources/client-trust.jks         | Bin 0 -> 969 bytes
 .../src/test/resources/client-trust.p12         | Bin 0 -> 1202 bytes
 .../src/test/resources/server-key.jks           | Bin 0 -> 2258 bytes
 .../src/test/resources/server-key.p12           | Bin 0 -> 2613 bytes
 .../src/test/resources/server-trust.jks         | Bin 0 -> 952 bytes
 .../src/test/resources/server-trust.p12         | Bin 0 -> 1186 bytes
 24 files changed, 723 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e937a3a5/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e937a3a5/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/upgrade/release-3.2.x-incubating.asciidoc
index c7ae1e2,ec973de..5cc52c8
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@@ -29,13 -29,32 +29,39 @@@ Please see the link:https://github.com/
  
  === Upgrading for Users
  
 +==== SASL in Gremlin.Net
 +
 +The Gremlin Javascript Driver now supports SASL Plain Text authentication against a Gremlin Server.
 +
 +See: link:https://issues.apache.org/jira/browse/TINKERPOP-1977[TINKERPOP-1977],
 +link:http://tinkerpop.apache.org/docs/3.2.10/reference#gremlin-javascript[Reference Documentation - Gremlin Javascript]
 +
+ ==== SSL Security
+ 
+ TinkerPop improves its security posture by removing insecure defaults and adding forward-looking standards support.
+ 
+ Gremlin Server no longer supports automatically creating self-signed certificates.
+ Self-signed certificates can still be created manually outside of Gremlin Server.
+ If ssl is enabled, a key store must be configured.
+ 
+ Cluster client no longer trusts all certs by default as this is an insecure configuration.
+ Instead, if no trust store is configured, Cluster will use the default CA certs.
+ To revert to the previous behavior and accept all certs, it must be explicitly configured.
+ 
+ This release introduces JKS and PKCS12 support. JKS is the legacy Java Key Store. PKCS12 has better cross-platform support and is gaining in adoption.
+ Be aware that JKS is the default on Java 8.  Java 9 and higher use PKCS12 as the default. Both Java keytool and OpenSSL tools can create, read, update PKCS12 files.
+ 
+ Other new features include specifying SSL protocols and cipher suites.
+ The packaged `*-secure.yaml` files now restrict the protocol to `TLSv1.2` by default.
+ 
+ PEM-based configurations are deprecated and may be removed in a future release.
+ 
+ See also http://tinkerpop.apache.org/docs/current/reference/#_configuration[Connecting via Java Configuration],
+ http://tinkerpop.apache.org/docs/current/reference/#_configuring_2[Gremlin Server Configuration].
+ 
+ link:https://issues.apache.org/jira/browse/TINKERPOP-2022[TINKERPOP-2022]
+ link:https://issues.apache.org/jira/browse/TINKERPOP-2023[TINKERPOP-2023]
+ 
  ==== Bulk Import and Export
  
  TinkerPop has provided some general methods for importing and exporting data, but more and more graph providers are

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e937a3a5/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------


[26/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/31f509de
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/31f509de
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/31f509de

Branch: refs/heads/TINKERPOP-2021
Commit: 31f509debdf64aba975dc08e3fd4896282f5e8c6
Parents: 69d46f7 5f770b1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Aug 16 15:10:24 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Aug 16 15:10:24 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../archetype-resources/README.asciidoc         |  6 ++--
 .../archetype-resources/src/main/java/App.java  |  1 +
 .../src/main/java/Service.java                  | 34 +++++++++-----------
 .../src/test/java/ServiceTest.java              |  2 +-
 5 files changed, 21 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/31f509de/CHANGELOG.asciidoc
----------------------------------------------------------------------


[02/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33

Conflicts:
	gremlin-test/features/map/Select.feature


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/445a8bf0
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/445a8bf0
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/445a8bf0

Branch: refs/heads/TINKERPOP-2021
Commit: 445a8bf0b75f8f6ee246c5bd9277f0e902db246c
Parents: 5eaf312 3be3550
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jul 25 12:25:51 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Jul 25 12:25:51 2018 -0400

----------------------------------------------------------------------
 .../Gherkin/GherkinTestRunner.cs                       |  3 +--
 .../Gherkin/IgnoreException.cs                         |  3 ---
 .../gremlin-javascript/test/cucumber/feature-steps.js  |  3 +--
 gremlin-python/src/main/jython/radish/feature_steps.py |  2 +-
 gremlin-test/features/map/Select.feature               | 13 +++++--------
 5 files changed, 8 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/445a8bf0/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/445a8bf0/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/445a8bf0/gremlin-test/features/map/Select.feature
----------------------------------------------------------------------


[07/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/79851067
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/79851067
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/79851067

Branch: refs/heads/TINKERPOP-2021
Commit: 798510679b5af84ffc1ecdfa5ef86d52229cbc99
Parents: 9b693c0 3b8c828
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 27 16:29:37 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jul 27 16:29:37 2018 -0400

----------------------------------------------------------------------
 docs/src/recipes/element-existence.asciidoc | 91 ++++++++++++++++++++++++
 docs/src/recipes/index.asciidoc             |  2 +
 2 files changed, 93 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/79851067/docs/src/recipes/index.asciidoc
----------------------------------------------------------------------


[09/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ddc66941
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ddc66941
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ddc66941

Branch: refs/heads/TINKERPOP-2021
Commit: ddc66941ed6340edd9009f0aa277aa8326255c68
Parents: 88b6e14 00a085a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 30 11:41:21 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 30 11:41:21 2018 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddc66941/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java
----------------------------------------------------------------------


[14/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3e308f52
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3e308f52
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3e308f52

Branch: refs/heads/TINKERPOP-2021
Commit: 3e308f5226e6254122f782cb55571e0103f9a9ff
Parents: b779a2a b98ff5e
Author: Robert Dale <ro...@gmail.com>
Authored: Sat Aug 4 16:44:41 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Sat Aug 4 16:44:41 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc     | 1 +
 gremlin-shaded/pom.xml | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e308f52/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e308f52/gremlin-shaded/pom.xml
----------------------------------------------------------------------


[16/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33

Conflicts:
	gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fa7a7f61
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fa7a7f61
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fa7a7f61

Branch: refs/heads/TINKERPOP-2021
Commit: fa7a7f61308acc675e4a4c4a6dc863cf9818c3f9
Parents: 2cf551f 37476a2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Aug 7 12:08:39 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Aug 7 12:08:39 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../driver/message/ResponseStatusCode.java      |   7 +
 .../driver/message/ResponseStatusCodeTest.java  |  36 +++++
 .../gremlin/server/ResponseHandlerContext.java  |  85 +++++++++++
 .../server/op/AbstractEvalOpProcessor.java      |  38 ++++-
 .../gremlin/server/op/AbstractOpProcessor.java  |  34 ++++-
 .../AbstractGremlinServerIntegrationTest.java   |  20 ++-
 .../server/GremlinServerIntegrateTest.java      |  51 +++++++
 .../server/ResponseHandlerContextTest.java      | 143 +++++++++++++++++++
 .../server/op/AbstractEvalOpProcessorTest.java  |  62 ++++++++
 .../server/op/AbstractOpProcessorTest.java      |  73 ++++++++++
 11 files changed, 535 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fa7a7f61/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fa7a7f61/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
----------------------------------------------------------------------
diff --cc gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
index 74e9478,ca1ee53..dbf7a44
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
@@@ -242,14 -287,9 +266,14 @@@ public abstract class AbstractEvalOpPro
                      final Iterator itty = IteratorUtils.asIterator(o);
  
                      logger.debug("Preparing to iterate results from - {} - in thread [{}]", msg, Thread.currentThread().getName());
 +                    if (settings.authentication.enableAuditLog) {
 +                        String address = context.getChannelHandlerContext().channel().remoteAddress().toString();
 +                        if (address.startsWith("/") && address.length() > 1) address = address.substring(1);
 +                        auditLogger.info("User with address {} requested: {}", address, script);
 +                    }
  
                      try {
-                         handleIterator(context, itty);
+                         handleIterator(rhc, itty);
                      } catch (Exception ex) {
                          if (managedTransactionsForRequest) attemptRollback(msg, context.getGraphManager(), settings.strictTransactionManagement);
  
@@@ -271,9 -311,16 +295,9 @@@
                      // occurs when the TimedInterruptCustomizerProvider is in play
                      final String errorMessage = String.format("A timeout occurred within the script during evaluation of [%s] - consider increasing the limit given to TimedInterruptCustomizerProvider", msg);
                      logger.warn(errorMessage);
-                     ctx.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_TIMEOUT)
+                     rhc.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_TIMEOUT)
                              .statusMessage("Timeout during script evaluation triggered by TimedInterruptCustomizerProvider")
                              .statusAttributeException(t).create());
 -                } else if (t instanceof org.apache.tinkerpop.gremlin.groovy.jsr223.TimedInterruptTimeoutException) {
 -                    // occurs when the TimedInterruptCustomizerProvider is in play
 -                    final String errorMessage = String.format("A timeout occurred within the script during evaluation of [%s] - consider increasing the limit given to TimedInterruptCustomizerProvider", msg);
 -                    logger.warn(errorMessage);
 -                    rhc.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_TIMEOUT)
 -                            .statusMessage("Timeout during script evaluation triggered by TimedInterruptCustomizerProvider")
 -                            .statusAttributeException(t).create());
                  } else if (t instanceof TimeoutException) {
                      final String errorMessage = String.format("Script evaluation exceeded the configured threshold for request [%s]", msg);
                      logger.warn(errorMessage, t);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fa7a7f61/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index a1689e9,eb5def9..67ad021
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@@ -71,7 -74,9 +72,8 @@@ import org.junit.Test
  import java.lang.reflect.Field;
  import java.nio.channels.ClosedChannelException;
  import java.util.ArrayList;
 -import java.util.Collections;
  import java.util.HashMap;
+ import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;


[40/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/59fc032f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/59fc032f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/59fc032f

Branch: refs/heads/TINKERPOP-2021
Commit: 59fc032f5f44e32617e3b1b9b49ecce9aa89becf
Parents: 6582056 675c077
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Aug 22 16:24:00 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Aug 22 16:24:00 2018 -0400

----------------------------------------------------------------------
 .../test/Gremlin.Net.IntegrationTest/Driver/MessagesTests.cs   | 2 +-
 .../tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java   | 6 ++++--
 .../gremlin/server/op/traversal/TraversalOpProcessor.java      | 6 ++++--
 .../tinkerpop/gremlin/server/GremlinServerIntegrateTest.java   | 2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/59fc032f/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/59fc032f/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/59fc032f/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------


[13/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b779a2a3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b779a2a3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b779a2a3

Branch: refs/heads/TINKERPOP-2021
Commit: b779a2a3e26c2b5c9c961b083b0bc1a89ead6440
Parents: 8af7837 ce94738
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sat Aug 4 06:28:10 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sat Aug 4 06:28:10 2018 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/driver/Client.java  | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[49/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fd25300c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fd25300c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fd25300c

Branch: refs/heads/TINKERPOP-2021
Commit: fd25300cd844b2e202083a4142768f64bf44afd2
Parents: e1c46b2 425bcd0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 4 13:33:45 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 4 13:33:45 2018 -0400

----------------------------------------------------------------------
 .../src/main/jython/tests/driver/test_client.py | 44 ++++++++++++++++++++
 1 file changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fd25300c/gremlin-python/src/main/jython/tests/driver/test_client.py
----------------------------------------------------------------------
diff --cc gremlin-python/src/main/jython/tests/driver/test_client.py
index 145bf9c,82b0221..0459428
--- a/gremlin-python/src/main/jython/tests/driver/test_client.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_client.py
@@@ -20,8 -20,8 +20,9 @@@ import pytes
  
  from gremlin_python.driver.client import Client
  from gremlin_python.driver.request import RequestMessage
+ from gremlin_python.process.graph_traversal import __
  from gremlin_python.structure.graph import Graph
 +from gremlin_python.driver import serializer
  
  __author__ = 'David M. Brown (davebshow@gmail.com)'
  


[22/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5676e861
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5676e861
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5676e861

Branch: refs/heads/TINKERPOP-2021
Commit: 5676e8612b66c43d55aa1d4baa93e5949b1cd5c9
Parents: 0bf76ac 180da8d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 13 10:36:19 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 10:36:19 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                                 | 1 +
 .../tinkerpop/gremlin/process/traversal/step/ByModulating.java     | 2 ++
 .../tinkerpop/gremlin/process/traversal/step/map/GroupStep.java    | 2 ++
 3 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5676e861/CHANGELOG.asciidoc
----------------------------------------------------------------------


[23/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/25ae7551
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/25ae7551
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/25ae7551

Branch: refs/heads/TINKERPOP-2021
Commit: 25ae755118cc5d968652d4fd36bccb4d78ce9a7d
Parents: 5676e86 ea18963
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Mon Aug 13 19:23:39 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Mon Aug 13 19:23:39 2018 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 gremlin-dotnet/glv/Gremlin.Net.csproj.template  |   3 +-
 .../src/Gremlin.Net/Gremlin.Net.csproj          |   3 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs       |  38 +++++++
 .../IO/GraphSON/BigIntegerSerializer.cs         |  37 +++++++
 .../IO/GraphSON/ByteBufferDeserializer.cs       |  36 +++++++
 .../IO/GraphSON/ByteBufferSerializer.cs         |  36 +++++++
 .../Structure/IO/GraphSON/ByteConverter.cs      |  33 ++++++
 .../Structure/IO/GraphSON/CharConverter.cs      |  34 ++++++
 .../Structure/IO/GraphSON/DateDeserializer.cs   |  38 +++++++
 .../Structure/IO/GraphSON/DateSerializer.cs     |   9 +-
 .../IO/GraphSON/DurationDeserializer.cs         |  37 +++++++
 .../Structure/IO/GraphSON/DurationSerializer.cs |  38 +++++++
 .../Structure/IO/GraphSON/GraphSONReader.cs     |  14 ++-
 .../Structure/IO/GraphSON/GraphSONWriter.cs     |  13 ++-
 .../Structure/IO/GraphSON/Int16Converter.cs     |  34 ++++++
 .../Gremlin.Net.UnitTest.csproj                 |   1 +
 .../IO/GraphSON/GraphSONReaderTests.cs          | 108 +++++++++++++++++++
 .../IO/GraphSON/GraphSONWriterTests.cs          |  65 +++++++++++
 19 files changed, 563 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
index 94fcd8d,d11b14c..5ced99a
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
@@@ -52,8 -49,15 +52,16 @@@ namespace Gremlin.Net.Structure.IO.Grap
                  {"g:Property", new PropertyDeserializer()},
                  {"g:VertexProperty", new VertexPropertyDeserializer()},
                  {"g:Path", new PathDeserializer()},
 +                {"g:T", new TDeserializer()},
-                 {"gx:BigDecimal", new DecimalConverter()}
+ 
+                 //Extended
+                 {"gx:BigDecimal", new DecimalConverter()},
+                 {"gx:Duration", new DurationDeserializer()},
+                 {"gx:BigInteger", new BigIntegerDeserializer()},
+                 {"gx:Byte", new ByteConverter()},
+                 {"gx:ByteBuffer", new ByteBufferDeserializer()},
+                 {"gx:Char", new CharConverter()},
+                 {"gx:Int16", new Int16Converter() }
              };
  
          /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
index c93630f,74bf385..00cf853
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
@@@ -34,32 -36,22 +35,43 @@@ namespace Gremlin.Net.UnitTest.Structur
  {
      public class GraphSONReaderTests
      {
 -        private GraphSONReader CreateStandardGraphSONReader()
 -        {
 -            return new GraphSONReader();
 +        /// <summary>
 +        /// Parameters for each test supporting multiple versions of GraphSON
 +        /// </summary>
 +        public static IEnumerable<object[]> Versions => new []
 +        {
 +            new object[] { 2 },
 +            new object[] { 3 }
 +        };
 +        
 +        /// <summary>
 +        /// Parameters for each collections test supporting multiple versions of GraphSON
 +        /// </summary>
 +        public static IEnumerable<object[]> VersionsSupportingCollections => new []
 +        {
 +            new object[] { 3 }
 +        };
 +        
 +        private GraphSONReader CreateStandardGraphSONReader(int version)
 +        {
 +            if (version == 3)
 +            {
 +                return new GraphSON3Reader();
 +            }
 +            return new GraphSON2Reader();
          }
  
+         //During CI, we encountered a case where Newtonsoft.Json version 9.0.0
+         //was loaded although there is no obvious direct nor indirect dependency
+         //on that version of the library. An explicit reference to version
+         //11.0.0 from Gremlin.Net.UnitTest fixes that, however, it is
+         //still unclear what causes the downgrade. Until resolution, we keep this test.
+         [Fact]
+         public void NewtonsoftJsonVersionShouldSupportReallyBigIntegers()
+         {
+             Assert.Equal(new Version(11, 0, 0, 0), typeof(JToken).Assembly.GetName().Version);
+         }
+ 
          [Fact]
          public void ShouldDeserializeWithCustomDeserializerForNewType()
          {
@@@ -416,6 -334,102 +428,102 @@@
              Assert.NotNull(d);
              Assert.Equal("g:Traverser", (string)d["@type"]);
          }
+ 
 -        [Fact]
 -        public void ShouldDeserializeDurationToTimeSpan()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeDurationToTimeSpan(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Duration\",\"@value\":\"PT120H\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             TimeSpan deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(TimeSpan.FromDays(5), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeBigInteger()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeBigInteger(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeBigIntegerValueAsString()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeBigIntegerValueAsString(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeReallyBigIntegerValue()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeReallyBigIntegerValue(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789987654321123456789987654321}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789987654321123456789987654321"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeByte()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeByte(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Byte\",\"@value\":1}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(1, deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeByteBuffer()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeByteBuffer(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeChar()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeChar(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Char\",\"@value\":\"x\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal('x', deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeInt16()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeInt16(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Int16\",\"@value\":100}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(100, deserializedValue);
+         }
      }
  
      internal class TestGraphSONDeserializer : IGraphSONDeserializer

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
index 9f62abe,a544fb3..2d30fa1
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
@@@ -406,6 -347,70 +407,70 @@@ namespace Gremlin.Net.UnitTest.Structur
                  "{\"@type\":\"g:Lambda\",\"@value\":{\"script\":\"{ it.get() }\",\"language\":\"gremlin-groovy\",\"arguments\":-1}}";
              Assert.Equal(expected, graphSon);
          }
+ 
 -        [Fact]
 -        public void ShouldSerializeTimeSpan()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeTimeSpan(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+             var timeSpan = new TimeSpan(5, 4, 3, 2, 1);
+ 
+             var graphSon = writer.WriteObject(timeSpan);
+ 
+             const string expected = "{\"@type\":\"gx:Duration\",\"@value\":\"P5DT4H3M2.001S\"}";
+             Assert.Equal(expected, graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeBigInteger()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeBigInteger(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+             var bigInteger = BigInteger.Parse("123456789987654321123456789987654321");
+ 
+             var graphSon = writer.WriteObject(bigInteger);
+ 
+             const string expected = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789987654321123456789987654321\"}";
+             Assert.Equal(expected, graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeByte()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeByte(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject((byte)1);
+ 
+             Assert.Equal("{\"@type\":\"gx:Byte\",\"@value\":1}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeByteBuffer()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeByteBuffer(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"));
+ 
+             Assert.Equal("{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeChar()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeChar(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject('x');
+ 
+             Assert.Equal("{\"@type\":\"gx:Char\",\"@value\":\"x\"}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeInt16()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeInt16(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject((short)100);
+ 
+             Assert.Equal("{\"@type\":\"gx:Int16\",\"@value\":100}", graphSon);
+         }
      }
  
      internal class TestGraphSONSerializer : IGraphSONSerializer


[18/50] tinkerpop git commit: Another attempt to wait for flushed logs on kerberos tests CTR

Posted by sp...@apache.org.
Another attempt to wait for flushed logs on kerberos tests CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b9ebe159
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b9ebe159
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b9ebe159

Branch: refs/heads/TINKERPOP-2021
Commit: b9ebe15990b44bde0e2592ba62d52343d73edb4e
Parents: b12a3fd
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Aug 10 08:04:20 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Aug 10 08:04:20 2018 -0400

----------------------------------------------------------------------
 .../gremlin/server/auth/Krb5Authenticator.java  | 10 ++--
 .../GremlinServerAuthKrb5IntegrateTest.java     | 49 ++++++++++----------
 2 files changed, 27 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b9ebe159/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Krb5Authenticator.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Krb5Authenticator.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Krb5Authenticator.java
index a92e404..f4e5d77 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Krb5Authenticator.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/Krb5Authenticator.java
@@ -66,6 +66,7 @@ public class Krb5Authenticator implements Authenticator {
                 "Could not configure a %s - provide a 'config' in the 'authentication' settings",
                 Krb5Authenticator.class.getName()));
         }
+
         try {
             final File keytabFile = new File((String) config.get(KEYTAB_KEY));
             principalName = (String) config.get(PRINCIPAL_KEY);
@@ -73,19 +74,14 @@ public class Krb5Authenticator implements Authenticator {
         } catch (Exception e) {
             logger.warn("Failed to login to kdc");
         }
+        
         logger.debug("Done logging in to kdc");
     }
 
     @Override
     public SaslNegotiator newSaslNegotiator(final InetAddress remoteAddress) {
         logger.debug("newSaslNegotiator() called");
-        return Subject.doAs(subject,
-            new PrivilegedAction<SaslNegotiator>() {
-                public SaslNegotiator run() {
-                    return new Krb5SaslAuthenticator();
-                }
-            }
-        );
+        return Subject.doAs(subject, (PrivilegedAction<SaslNegotiator>) Krb5SaslAuthenticator::new);
     }
 
     public AuthenticatedUser authenticate(final Map<String, String> credentials) throws AuthenticationException {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b9ebe159/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
index 10ed834..c102446 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
@@ -39,15 +39,14 @@ import java.util.HashMap;
 import java.util.Map;
 import javax.security.auth.login.LoginException;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-
-
 /**
  * @author Marc de Lignie
- *
  */
 public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerIntegrationTest {
     private static final org.slf4j.Logger logger = LoggerFactory.getLogger(GremlinServerAuthKrb5IntegrateTest.class);
@@ -180,32 +179,17 @@ public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerInt
 
     @Test
     public void shouldFailWithNonexistentServerPrincipal() throws Exception {
-
-        // wait for logger to flush - (don't think there is a way to detect this)
-        stopServer();
-        Thread.sleep(1000);
-
-        assertTrue(recordingAppender.logContainsAny("WARN - Failed to login to kdc"));
+        assertFailedLogin();
     }
 
     @Test
     public void shouldFailWithEmptyServerKeytab() throws Exception {
-
-        // wait for logger to flush - (don't think there is a way to detect this)
-        stopServer();
-        Thread.sleep(1000);
-
-        assertTrue(recordingAppender.logContainsAny("WARN - Failed to login to kdc"));
+        assertFailedLogin();
     }
 
     @Test
     public void shouldFailWithWrongServerKeytab() throws Exception {
-
-        // wait for logger to flush - (don't think there is a way to detect this)
-        stopServer();
-        Thread.sleep(1000);
-
-        assertTrue(recordingAppender.logContainsAny("WARN - Failed to login to kdc"));
+        assertFailedLogin();
     }
 
     @Test
@@ -241,8 +225,8 @@ public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerInt
 
     @Test
     public void shouldAuthenticateWithSerializeResultToStringV1() throws Exception {
-        MessageSerializer serializer = new GryoMessageSerializerV1d0();
-        Map config = new HashMap<String, Object>();
+        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        final Map<String,Object> config = new HashMap<>();
         config.put("serializeResultToString", true);
         serializer.configure(config, null);
         final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE)
@@ -259,8 +243,8 @@ public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerInt
 
     @Test
     public void shouldAuthenticateWithSerializeResultToStringV3() throws Exception {
-        MessageSerializer serializer = new GryoMessageSerializerV3d0();
-        Map config = new HashMap<String, Object>();
+        final MessageSerializer serializer = new GryoMessageSerializerV3d0();
+        final Map<String, Object> config = new HashMap<>();
         config.put("serializeResultToString", true);
         serializer.configure(config, null);
         final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE)
@@ -274,4 +258,19 @@ public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerInt
             cluster.close();
         }
     }
+
+    /**
+     * Tries to force the logger to flush fully or at least wait until it does.
+     */
+    private void assertFailedLogin() throws Exception {
+        stopServer();
+
+        boolean logMessageIdentified = false;
+        for (int ix = 0; ix < 10 && !logMessageIdentified; ix++) {
+            logMessageIdentified = recordingAppender.logContainsAny("WARN - Failed to login to kdc");
+            if (!logMessageIdentified) Thread.sleep(1000);
+        }
+
+        assertThat(logMessageIdentified, is(true));
+    }
 }


[31/50] tinkerpop git commit: TINKERPOP-2023 added tests and some fixes

Posted by sp...@apache.org.
TINKERPOP-2023 added tests and some fixes


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d05e3c56
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d05e3c56
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d05e3c56

Branch: refs/heads/TINKERPOP-2021
Commit: d05e3c566b580f5aee020234e17b69df3f708b7a
Parents: 5d893cf
Author: Robert Dale <ro...@gmail.com>
Authored: Mon Aug 13 15:28:40 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Aug 17 15:06:33 2018 -0400

----------------------------------------------------------------------
 .../src/reference/gremlin-applications.asciidoc |   2 +-
 .../tinkerpop/gremlin/driver/Settings.java      |  28 ++-
 .../tinkerpop/gremlin/driver/SettingsTest.java  |  17 ++
 .../AbstractGremlinServerIntegrationTest.java   |  14 +-
 .../server/GremlinServerIntegrateTest.java      | 192 +++++++++++++++++--
 ...ctGremlinServerChannelizerIntegrateTest.java |   2 +
 .../src/test/resources/client-key.jks           | Bin 0 -> 2241 bytes
 .../src/test/resources/client-key.p12           | Bin 0 -> 2583 bytes
 .../src/test/resources/client-trust.jks         | Bin 0 -> 969 bytes
 .../src/test/resources/client-trust.p12         | Bin 0 -> 1202 bytes
 .../src/test/resources/server-key.jks           | Bin 0 -> 2258 bytes
 .../src/test/resources/server-key.p12           | Bin 0 -> 2613 bytes
 .../src/test/resources/server-trust.jks         | Bin 0 -> 952 bytes
 .../src/test/resources/server-trust.p12         | Bin 0 -> 1186 bytes
 gremlin-server/src/test/resources/server.jks    | Bin 2258 -> 0 bytes
 gremlin-server/src/test/resources/server.p12    | Bin 2613 -> 0 bytes
 16 files changed, 228 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 1f64f46..8ad8a0a 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -735,7 +735,7 @@ The following table describes the various configuration options for the Gremlin
 |connectionPool.keyPassword |The password of the `keyFile` if it is password-protected. |_none_
 |connectionPool.keyStore |The private key in JKS or PKCS#12 format. |_none_
 |connectionPool.keyStorePassword |The password of the `keyStore` if it is password-protected. |_none_
-|connectionPool.keyStoreType |JKS (Java 8 default) or PKCS#12 (Java 9+ default)|_none_
+|connectionPool.keyStoreType |`JKS` (Java 8 default) or `PKCS12` (Java 9+ default)|_none_
 |connectionPool.maxContentLength |The maximum length in bytes that a message can be sent to the server. This number can be no greater than the setting of the same name in the server configuration. |65536
 |connectionPool.maxInProcessPerConnection |The maximum number of in-flight requests that can occur on a connection. |4
 |connectionPool.maxSimultaneousUsagePerConnection |The maximum number of times that a connection can be borrowed from the pool simultaneously. |16

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
index 009a0bf..4d54792 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
@@ -181,6 +181,32 @@ final class Settings {
             if (connectionPoolConf.containsKey("trustCertChainFile"))
                 cpSettings.trustCertChainFile = connectionPoolConf.getString("trustCertChainFile");
 
+            if (connectionPoolConf.containsKey("keyStore"))
+                cpSettings.keyStore = connectionPoolConf.getString("keyStore");
+
+            if (connectionPoolConf.containsKey("keyStorePassword"))
+                cpSettings.keyStorePassword = connectionPoolConf.getString("keyStorePassword");
+
+            if (connectionPoolConf.containsKey("keyStoreType"))
+                cpSettings.keyStoreType = connectionPoolConf.getString("keyStoreType");
+
+            if (connectionPoolConf.containsKey("trustStore"))
+                cpSettings.trustStore = connectionPoolConf.getString("trustStore");
+
+            if (connectionPoolConf.containsKey("trustStorePassword"))
+                cpSettings.trustStorePassword = connectionPoolConf.getString("trustStorePassword");
+
+            if (connectionPoolConf.containsKey("sslEnabledProtocols"))
+                cpSettings.sslEnabledProtocols = connectionPoolConf.getList("sslEnabledProtocols").stream().map(Object::toString)
+                        .collect(Collectors.toList());
+
+            if (connectionPoolConf.containsKey("sslCipherSuites"))
+                cpSettings.sslCipherSuites = connectionPoolConf.getList("sslCipherSuites").stream().map(Object::toString)
+                        .collect(Collectors.toList());
+
+            if (connectionPoolConf.containsKey("sslSkipCertValidation"))
+                cpSettings.sslSkipCertValidation = connectionPoolConf.getBoolean("sslSkipCertValidation");
+
             if (connectionPoolConf.containsKey("minSize"))
                 cpSettings.minSize = connectionPoolConf.getInt("minSize");
 
@@ -283,7 +309,7 @@ final class Settings {
         public String trustStorePassword;
 
         /**
-         * JSSE keystore format. Similar to setting JSSE property
+         * JSSE keystore format. 'jks' or 'pkcs12'. Similar to setting JSSE property
          * {@code javax.net.ssl.keyStoreType}.
          */
         public String keyStoreType;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java
index c373879..56e0ec8 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java
@@ -49,6 +49,14 @@ public class SettingsTest {
         conf.setProperty("connectionPool.keyFile", "PKCS#8");
         conf.setProperty("connectionPool.keyPassword", "password1");
         conf.setProperty("connectionPool.trustCertChainFile", "pem");
+        conf.setProperty("connectionPool.keyStore", "server.jks");
+        conf.setProperty("connectionPool.keyStorePassword", "password2");
+        conf.setProperty("connectionPool.keyStoreType", "pkcs12");
+        conf.setProperty("connectionPool.trustStore", "trust.jks");
+        conf.setProperty("connectionPool.trustStorePassword", "password3");
+        conf.setProperty("connectionPool.sslEnabledProtocols", Arrays.asList("TLSv1.1","TLSv1.2"));
+        conf.setProperty("connectionPool.sslCipherSuites", Arrays.asList("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"));
+        conf.setProperty("connectionPool.sslSkipCertValidation", true);
         conf.setProperty("connectionPool.minSize", 100);
         conf.setProperty("connectionPool.maxSize", 200);
         conf.setProperty("connectionPool.minSimultaneousUsagePerConnection", 300);
@@ -71,6 +79,7 @@ public class SettingsTest {
         assertEquals("password1", settings.password);
         assertEquals("JaasIt", settings.jaasEntry);
         assertEquals("protocol0", settings.protocol);
+        assertEquals(Arrays.asList("255.0.0.1", "255.0.0.2", "255.0.0.3"), settings.hosts);
         assertEquals("my.serializers.MySerializer", settings.serializer.className);
         assertEquals("thing", settings.serializer.config.get("any"));
         assertEquals(true, settings.connectionPool.enableSsl);
@@ -78,6 +87,14 @@ public class SettingsTest {
         assertEquals("PKCS#8", settings.connectionPool.keyFile);
         assertEquals("password1", settings.connectionPool.keyPassword);
         assertEquals("pem", settings.connectionPool.trustCertChainFile);
+        assertEquals("server.jks", settings.connectionPool.keyStore);
+        assertEquals("password2", settings.connectionPool.keyStorePassword);
+        assertEquals("pkcs12", settings.connectionPool.keyStoreType);
+        assertEquals("trust.jks", settings.connectionPool.trustStore);
+        assertEquals("password3", settings.connectionPool.trustStorePassword);
+        assertEquals(Arrays.asList("TLSv1.1","TLSv1.2"), settings.connectionPool.sslEnabledProtocols);
+        assertEquals(Arrays.asList("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"), settings.connectionPool.sslCipherSuites);
+        assertEquals(true, settings.connectionPool.sslSkipCertValidation);
         assertEquals(100, settings.connectionPool.minSize);
         assertEquals(200, settings.connectionPool.maxSize);
         assertEquals(300, settings.connectionPool.minSimultaneousUsagePerConnection);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
index 0543a59..c5e3966 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
@@ -40,10 +40,16 @@ import static org.junit.Assume.assumeThat;
 public abstract class AbstractGremlinServerIntegrationTest {
     
     public static final String KEY_PASS = "changeit";
-    public static final String JKS_SERVER_KEY = "src/test/resources/server.jks";
-    public static final String JKS_CLIENT_KEY = "src/test/resources/client.jks";
-    public static final String P12_SERVER_KEY = "src/test/resources/server.p12";
-    public static final String P12_CLIENT_KEY = "src/test/resources/client.p12";
+    public static final String JKS_SERVER_KEY = "src/test/resources/server-key.jks";
+    public static final String JKS_SERVER_TRUST = "src/test/resources/server-trust.jks";
+    public static final String JKS_CLIENT_KEY = "src/test/resources/client-key.jks";
+    public static final String JKS_CLIENT_TRUST = "src/test/resources/client-trust.jks";
+    public static final String P12_SERVER_KEY = "src/test/resources/server-key.p12";
+    public static final String P12_SERVER_TRUST = "src/test/resources/server-trust.p12";
+    public static final String P12_CLIENT_KEY = "src/test/resources/client-key.p12";
+    public static final String P12_CLIENT_TRUST = "src/test/resources/client-trust.p12";
+    public static final String KEYSTORE_TYPE_JKS = "jks";
+    public static final String KEYSTORE_TYPE_PKCS12 = "pkcs12";
 
     protected GremlinServer server;
     private Settings overriddenSettings;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 238d2b2..a4e9478 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -74,6 +74,7 @@ import org.junit.Test;
 import java.lang.reflect.Field;
 import java.nio.channels.ClosedChannelException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -195,42 +196,97 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
                 settings.ssl.enabled = true;
                 settings.ssl.keyStore = JKS_SERVER_KEY;
                 settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
                 break;
             case "shouldEnableSslWithSslContextProgrammaticallySpecified":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
                 settings.ssl.overrideSslContext(createServerSslContext());
                 break;
-            case "shouldEnableSslAndClientCertificateAuth":
+            case "shouldEnableSslAndClientCertificateAuthWithLegacyPem":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
                 settings.ssl.keyCertChainFile = PEM_SERVER_CRT;
                 settings.ssl.keyFile = PEM_SERVER_KEY;
-                settings.ssl.keyPassword =KEY_PASS;
+                settings.ssl.keyPassword = KEY_PASS;
                 // Trust the client
                 settings.ssl.trustCertChainFile = PEM_CLIENT_CRT;
-            	break;
-            case "shouldEnableSslAndClientCertificateAuthAndFailWithoutCert":
+                break;
+            case "shouldEnableSslAndClientCertificateAuthAndFailWithoutCertWithLegacyPem":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
                 settings.ssl.keyCertChainFile = PEM_SERVER_CRT;
                 settings.ssl.keyFile = PEM_SERVER_KEY;
-                settings.ssl.keyPassword =KEY_PASS;
+                settings.ssl.keyPassword = KEY_PASS;
                 // Trust the client
                 settings.ssl.trustCertChainFile = PEM_CLIENT_CRT;
-            	break;
-            case "shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCert":
+                break;
+            case "shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCertWithLegacyPem":
                 settings.ssl = new Settings.SslSettings();
                 settings.ssl.enabled = true;
                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
                 settings.ssl.keyCertChainFile = PEM_SERVER_CRT;
                 settings.ssl.keyFile = PEM_SERVER_KEY;
-                settings.ssl.keyPassword =KEY_PASS;
+                settings.ssl.keyPassword = KEY_PASS;
                 // Trust ONLY the server cert
                 settings.ssl.trustCertChainFile = PEM_SERVER_CRT;
-            	break;
+                break;
+            case "shouldEnableSslAndClientCertificateAuthWithPkcs12":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                settings.ssl.needClientAuth = ClientAuth.REQUIRE;
+                settings.ssl.keyStore = P12_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_PKCS12;
+                settings.ssl.trustStore = P12_SERVER_TRUST;
+                settings.ssl.trustStorePassword = KEY_PASS;
+                break;
+            case "shouldEnableSslAndClientCertificateAuth":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                settings.ssl.needClientAuth = ClientAuth.REQUIRE;
+                settings.ssl.keyStore = JKS_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                settings.ssl.trustStore = JKS_SERVER_TRUST;
+                settings.ssl.trustStorePassword = KEY_PASS;
+                break;
+            case "shouldEnableSslAndClientCertificateAuthAndFailWithoutCert":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                settings.ssl.needClientAuth = ClientAuth.REQUIRE;
+                settings.ssl.keyStore = JKS_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                settings.ssl.trustStore = JKS_SERVER_TRUST;
+                settings.ssl.trustStorePassword = KEY_PASS;
+                break;
+            case "shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCert":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                settings.ssl.needClientAuth = ClientAuth.REQUIRE;
+                settings.ssl.keyStore = JKS_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                break;
+            case "shouldEnableSslAndFailIfProtocolsDontMatch":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                settings.ssl.keyStore = JKS_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                settings.ssl.sslEnabledProtocols = Arrays.asList("TLSv1.1");
+                break;
+            case "shouldEnableSslAndFailIfCiphersDontMatch":
+                settings.ssl = new Settings.SslSettings();
+                settings.ssl.enabled = true;
+                settings.ssl.keyStore = JKS_SERVER_KEY;
+                settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                settings.ssl.sslCipherSuites = Arrays.asList("TLS_DHE_RSA_WITH_AES_128_CBC_SHA");
+                break;
             case "shouldUseSimpleSandbox":
                 settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForSimpleSandbox();
                 break;
@@ -532,21 +588,21 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
-    public void shouldEnableSslAndClientCertificateAuth() {
-		final Cluster cluster = TestClientFactory.build().enableSsl(true)
-				.keyCertChainFile(PEM_CLIENT_CRT).keyFile(PEM_CLIENT_KEY)
-				.keyPassword(KEY_PASS).trustCertificateChainFile(PEM_SERVER_CRT).create();
-		final Client client = cluster.connect();
+    public void shouldEnableSslAndClientCertificateAuthWithLegacyPem() {
+        final Cluster cluster = TestClientFactory.build().enableSsl(true)
+                .keyCertChainFile(PEM_CLIENT_CRT).keyFile(PEM_CLIENT_KEY)
+                .keyPassword(KEY_PASS).trustCertificateChainFile(PEM_SERVER_CRT).create();
+        final Client client = cluster.connect();
 
         try {
-        	assertEquals("test", client.submit("'test'").one().getString());
+            assertEquals("test", client.submit("'test'").one().getString());
         } finally {
             cluster.close();
         }
     }
 
     @Test
-    public void shouldEnableSslAndClientCertificateAuthAndFailWithoutCert() {
+    public void shouldEnableSslAndClientCertificateAuthAndFailWithoutCertWithLegacyPem() {
         final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_SERVER_KEY).keyStorePassword(KEY_PASS).sslSkipCertValidation(true).create();
         final Client client = cluster.connect();
 
@@ -562,11 +618,11 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
-    public void shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCert() {
-		final Cluster cluster = TestClientFactory.build().enableSsl(true)
-				.keyCertChainFile(PEM_CLIENT_CRT).keyFile(PEM_CLIENT_KEY)
-				.keyPassword(KEY_PASS).trustCertificateChainFile(PEM_SERVER_CRT).create();
-		final Client client = cluster.connect();
+    public void shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCertWithLegacyPem() {
+        final Cluster cluster = TestClientFactory.build().enableSsl(true)
+                .keyCertChainFile(PEM_CLIENT_CRT).keyFile(PEM_CLIENT_KEY)
+                .keyPassword(KEY_PASS).trustCertificateChainFile(PEM_SERVER_CRT).create();
+        final Client client = cluster.connect();
 
         try {
             client.submit("'test'").one();
@@ -578,6 +634,100 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
             cluster.close();
         }
     }
+    
+    @Test
+    public void shouldEnableSslAndClientCertificateAuthWithPkcs12() {
+        final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(P12_CLIENT_KEY).keyStorePassword(KEY_PASS)
+                .keyStoreType(KEYSTORE_TYPE_PKCS12).trustStore(P12_CLIENT_TRUST).trustStorePassword(KEY_PASS).create();
+        final Client client = cluster.connect();
+
+        try {
+            assertEquals("test", client.submit("'test'").one().getString());
+        } finally {
+            cluster.close();
+        }
+    }
+
+    @Test
+    public void shouldEnableSslAndClientCertificateAuth() {
+        final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_CLIENT_KEY).keyStorePassword(KEY_PASS)
+                .keyStoreType(KEYSTORE_TYPE_JKS).trustStore(JKS_CLIENT_TRUST).trustStorePassword(KEY_PASS).create();
+        final Client client = cluster.connect();
+
+        try {
+            assertEquals("test", client.submit("'test'").one().getString());
+        } finally {
+            cluster.close();
+        }
+    }
+
+    @Test
+    public void shouldEnableSslAndClientCertificateAuthAndFailWithoutCert() {
+        final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_SERVER_KEY).keyStorePassword(KEY_PASS)
+                .keyStoreType(KEYSTORE_TYPE_JKS).sslSkipCertValidation(true).create();
+        final Client client = cluster.connect();
+
+        try {
+            client.submit("'test'").one();
+            fail("Should throw exception because ssl client auth is enabled on the server but client does not have a cert");
+        } catch (Exception x) {
+            final Throwable root = ExceptionUtils.getRootCause(x);
+            assertThat(root, instanceOf(TimeoutException.class));
+        } finally {
+            cluster.close();
+        }
+    }
+
+    @Test
+    public void shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCert() {
+        final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_CLIENT_KEY).keyStorePassword(KEY_PASS)
+                .keyStoreType(KEYSTORE_TYPE_JKS).trustStore(JKS_CLIENT_TRUST).trustStorePassword(KEY_PASS).create();
+        final Client client = cluster.connect();
+
+        try {
+            client.submit("'test'").one();
+            fail("Should throw exception because ssl client auth is enabled on the server but does not trust client's cert");
+        } catch (Exception x) {
+            final Throwable root = ExceptionUtils.getRootCause(x);
+            assertThat(root, instanceOf(TimeoutException.class));
+        } finally {
+            cluster.close();
+        }
+    }
+    
+    @Test
+    public void shouldEnableSslAndFailIfProtocolsDontMatch() {
+        final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_SERVER_KEY).keyStorePassword(KEY_PASS)
+                .sslSkipCertValidation(true).sslEnabledProtocols(Arrays.asList("TLSv1.2")).create();
+        final Client client = cluster.connect();
+
+        try {
+            client.submit("'test'").one();
+            fail("Should throw exception because ssl client requires TLSv1.2 whereas server supports only TLSv1.1");
+        } catch (Exception x) {
+            final Throwable root = ExceptionUtils.getRootCause(x);
+            assertThat(root, instanceOf(TimeoutException.class));
+        } finally {
+            cluster.close();
+        }
+    }
+
+    @Test
+    public void shouldEnableSslAndFailIfCiphersDontMatch() {
+        final Cluster cluster = TestClientFactory.build().enableSsl(true).keyStore(JKS_SERVER_KEY).keyStorePassword(KEY_PASS)
+                .sslSkipCertValidation(true).sslCipherSuites(Arrays.asList("SSL_RSA_WITH_RC4_128_SHA")).create();
+        final Client client = cluster.connect();
+
+        try {
+            client.submit("'test'").one();
+            fail("Should throw exception because ssl client requires TLSv1.2 whereas server supports only TLSv1.1");
+        } catch (Exception x) {
+            final Throwable root = ExceptionUtils.getRootCause(x);
+            assertThat(root, instanceOf(TimeoutException.class));
+        } finally {
+            cluster.close();
+        }
+    }
 
     @Test
     public void shouldRespectHighWaterMarkSettingAndSucceed() throws Exception {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
index 300a7f4..ced5247 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
@@ -102,6 +102,7 @@ abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGre
                 settings.ssl.enabled = true;
                 settings.ssl.keyStore = JKS_SERVER_KEY;
                 settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
                 break;
             case "shouldWorkWithAuth":
                 if (authSettings != null) {
@@ -113,6 +114,7 @@ abstract class AbstractGremlinServerChannelizerIntegrateTest extends AbstractGre
                 settings.ssl.enabled = true;
                 settings.ssl.keyStore = JKS_SERVER_KEY;
                 settings.ssl.keyStorePassword = KEY_PASS;
+                settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
                 if (authSettings != null) {
                     settings.authentication = getAuthSettings();
                 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/client-key.jks
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/client-key.jks b/gremlin-server/src/test/resources/client-key.jks
new file mode 100644
index 0000000..39df02b
Binary files /dev/null and b/gremlin-server/src/test/resources/client-key.jks differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/client-key.p12
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/client-key.p12 b/gremlin-server/src/test/resources/client-key.p12
new file mode 100644
index 0000000..74f182c
Binary files /dev/null and b/gremlin-server/src/test/resources/client-key.p12 differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/client-trust.jks
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/client-trust.jks b/gremlin-server/src/test/resources/client-trust.jks
new file mode 100644
index 0000000..d8b5479
Binary files /dev/null and b/gremlin-server/src/test/resources/client-trust.jks differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/client-trust.p12
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/client-trust.p12 b/gremlin-server/src/test/resources/client-trust.p12
new file mode 100644
index 0000000..2100e94
Binary files /dev/null and b/gremlin-server/src/test/resources/client-trust.p12 differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/server-key.jks
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/server-key.jks b/gremlin-server/src/test/resources/server-key.jks
new file mode 100644
index 0000000..85dbe67
Binary files /dev/null and b/gremlin-server/src/test/resources/server-key.jks differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/server-key.p12
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/server-key.p12 b/gremlin-server/src/test/resources/server-key.p12
new file mode 100644
index 0000000..4d1aad7
Binary files /dev/null and b/gremlin-server/src/test/resources/server-key.p12 differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/server-trust.jks
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/server-trust.jks b/gremlin-server/src/test/resources/server-trust.jks
new file mode 100644
index 0000000..a53cf47
Binary files /dev/null and b/gremlin-server/src/test/resources/server-trust.jks differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/server-trust.p12
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/server-trust.p12 b/gremlin-server/src/test/resources/server-trust.p12
new file mode 100644
index 0000000..a055de0
Binary files /dev/null and b/gremlin-server/src/test/resources/server-trust.p12 differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/server.jks
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/server.jks b/gremlin-server/src/test/resources/server.jks
deleted file mode 100644
index 85dbe67..0000000
Binary files a/gremlin-server/src/test/resources/server.jks and /dev/null differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d05e3c56/gremlin-server/src/test/resources/server.p12
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/server.p12 b/gremlin-server/src/test/resources/server.p12
deleted file mode 100644
index 4d1aad7..0000000
Binary files a/gremlin-server/src/test/resources/server.p12 and /dev/null differ


[35/50] tinkerpop git commit: Merge branch 'graphprovider-clear-tp32' into graphprovider-clear-tp33

Posted by sp...@apache.org.
Merge branch 'graphprovider-clear-tp32' into graphprovider-clear-tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/bf94f43f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bf94f43f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bf94f43f

Branch: refs/heads/TINKERPOP-2021
Commit: bf94f43f39c7812adec402730aaa2a8ed8526900
Parents: b46c295 038b9cd
Author: Justin Chu <15...@users.noreply.github.com>
Authored: Tue Aug 21 18:24:42 2018 -0400
Committer: Justin Chu <15...@users.noreply.github.com>
Committed: Tue Aug 21 18:24:42 2018 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/AbstractGremlinTest.java   |  4 +++-
 .../org/apache/tinkerpop/gremlin/GraphProvider.java     | 12 +++++++++---
 .../gremlin/neo4j/AbstractNeo4jGraphProvider.java       |  2 +-
 .../gremlin/tinkergraph/TinkerGraphProvider.java        |  2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bf94f43f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------


[44/50] tinkerpop git commit: Add self loop example to Cycle Detection recipe.

Posted by sp...@apache.org.
Add self loop example to Cycle Detection recipe.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3afc5765
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3afc5765
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3afc5765

Branch: refs/heads/TINKERPOP-2021
Commit: 3afc57653a9ca81ba560b1b9a6be8c3ad7b1251d
Parents: 47e0600
Author: Kevin Gallardo <ke...@datastax.com>
Authored: Fri Aug 24 17:18:43 2018 -0400
Committer: Kevin Gallardo <ke...@datastax.com>
Committed: Fri Aug 31 15:35:22 2018 -0400

----------------------------------------------------------------------
 docs/src/recipes/cycle-detection.asciidoc | 33 +++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3afc5765/docs/src/recipes/cycle-detection.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/recipes/cycle-detection.asciidoc b/docs/src/recipes/cycle-detection.asciidoc
index 57adc6e..1e25740 100644
--- a/docs/src/recipes/cycle-detection.asciidoc
+++ b/docs/src/recipes/cycle-detection.asciidoc
@@ -48,9 +48,36 @@ the length of the cycle is known to be three and there is no need to exceed that
 cycle. It returned three, because there was one for each vertex that started the cycle (i.e. one for `A`, one for `B`
 and one for `C`). This next line introduce deduplication to only return unique cycles.
 
-The above case assumed that the need was to only detect cycles over a path length of three. It also respected the
-directionality of the edges by only considering outgoing ones. What would need to change to detect cycles of
-arbitrary length over both incoming and outgoing edges in the modern graph?
+The above case assumed that the need was to only detect cycles over a path length of three.
+It also respected the directionality of the edges by only considering outgoing ones.
+
+Also note that the traversal above won't detect self-loops (vertices directly connected to
+themselves). To do so, you would need to `.emit()` a Traverser before the repeat()-loop.
+
+[gremlin-groovy]
+----
+g.addV().property(id,'a').as('a').
+  addV().property(id,'b').as('b').
+  addV().property(id,'c').as('c').
+  addV().property(id,'d').as('d').
+  addE('knows').from('a').to('b').
+  addE('knows').from('b').to('c').
+  addE('knows').from('c').to('a').
+  addE('knows').from('a').to('d').
+  addE('knows').from('c').to('d').
+  addE('self').from('a').to('a').iterate()
+g.V().as('a').
+  emit().
+    repeat(outE().inV().simplePath()).
+    times(2).
+  outE().inV().where(eq('a')).
+  path().
+    by(id).
+    by(label)
+----
+
+What would need to change to detect cycles of arbitrary length over both incoming and
+outgoing edges, in the modern graph?
 
 [gremlin-groovy,modern]
 ----


[34/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b46c295c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b46c295c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b46c295c

Branch: refs/heads/TINKERPOP-2021
Commit: b46c295c0019c8d690622587b3a46b8992d9fe37
Parents: 31f509d f49b279
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 20 12:30:43 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 20 12:30:43 2018 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/administration.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[42/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5ca69985
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5ca69985
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5ca69985

Branch: refs/heads/TINKERPOP-2021
Commit: 5ca69985731ef85fdf9c682634fdc51505fa8728
Parents: a873468 47e0600
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Aug 23 12:43:35 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Aug 23 12:43:35 2018 -0400

----------------------------------------------------------------------
 docs/src/upgrade/release-3.2.x-incubating.asciidoc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5ca69985/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------


[43/50] tinkerpop git commit: Enabled some asserts that were commented out on path serialization tests

Posted by sp...@apache.org.
Enabled some asserts that were commented out on path serialization tests

Not sure why this was commented out but it wasn't working at some point apparently - oh well, working now CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/94d9de04
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/94d9de04
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/94d9de04

Branch: refs/heads/TINKERPOP-2021
Commit: 94d9de04c3d9ad22efd0cbd4b9d29a3dfb6e0b92
Parents: 5ca6998
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Aug 28 16:20:57 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Aug 28 16:20:57 2018 -0400

----------------------------------------------------------------------
 .../gremlin/structure/SerializationTest.java      | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/94d9de04/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
index 4935175..0f910ab 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
@@ -722,27 +722,24 @@ public class SerializationTest {
             assertEquals(vOut.label(), detachedVOut.label());
             assertEquals(vOut.id(), detachedVOut.id());
 
-            // TODO: dunno GraphSON seems to return properties - will make this more consistent here
             // this is a SimpleTraverser so no properties are present in detachment
-            //assertFalse(detachedVOut.properties().hasNext());
+            assertFalse(detachedVOut.properties().hasNext());
 
             final Edge e = p.get("b");
             final Edge detachedE = detached.get("b");
             assertEquals(e.label(), detachedE.label());
             assertEquals(e.id(), detachedE.id());
 
-            // TODO: dunno GraphSON seems to return properties - will make this more consistent here
             // this is a SimpleTraverser so no properties are present in detachment
-            //assertFalse(detachedE.properties().hasNext());
+            assertFalse(detachedE.properties().hasNext());
 
             final Vertex vIn = p.get("c");
             final Vertex detachedVIn = detached.get("c");
             assertEquals(vIn.label(), detachedVIn.label());
             assertEquals(vIn.id(), detachedVIn.id());
 
-            // TODO: dunno GraphSON seems to return properties - will make this more consistent here
             // this is a SimpleTraverser so no properties are present in detachment
-            //assertFalse(detachedVIn.properties().hasNext());
+            assertFalse(detachedVIn.properties().hasNext());
         }
 
         @Test
@@ -927,27 +924,24 @@ public class SerializationTest {
             assertEquals(vOut.label(), detachedVOut.label());
             assertEquals(vOut.id(), detachedVOut.id());
 
-            // TODO: dunno GraphSON seems to return properties - will make this more consistent here
             // this is a SimpleTraverser so no properties are present in detachment
-            //assertFalse(detachedVOut.properties().hasNext());
+            assertFalse(detachedVOut.properties().hasNext());
 
             final Edge e = p.get("b");
             final Edge detachedE = detached.get("b");
             assertEquals(e.label(), detachedE.label());
             assertEquals(e.id(), detachedE.id());
 
-            // TODO: dunno GraphSON seems to return properties - will make this more consistent here
             // this is a SimpleTraverser so no properties are present in detachment
-            //assertFalse(detachedE.properties().hasNext());
+            assertFalse(detachedE.properties().hasNext());
 
             final Vertex vIn = p.get("c");
             final Vertex detachedVIn = detached.get("c");
             assertEquals(vIn.label(), detachedVIn.label());
             assertEquals(vIn.id(), detachedVIn.id());
 
-            // TODO: dunno GraphSON seems to return properties - will make this more consistent here
             // this is a SimpleTraverser so no properties are present in detachment
-            //assertFalse(detachedVIn.properties().hasNext());
+            assertFalse(detachedVIn.properties().hasNext());
         }
 
         @Test


[29/50] tinkerpop git commit: TINKERPOP-2023 default to TLSv1.2, updated upgrade notes

Posted by sp...@apache.org.
TINKERPOP-2023 default to TLSv1.2, updated upgrade notes


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ca83fbdf
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ca83fbdf
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ca83fbdf

Branch: refs/heads/TINKERPOP-2021
Commit: ca83fbdfdc885a9774ba1dbc17b3d9df75c49137
Parents: e3b4ae5
Author: Robert Dale <ro...@gmail.com>
Authored: Sun Aug 12 21:50:02 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Aug 17 15:06:33 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../upgrade/release-3.2.x-incubating.asciidoc   | 25 ++++++++++++++++++++
 gremlin-console/conf/remote-secure.yaml         |  2 +-
 .../conf/gremlin-server-rest-secure.yaml        |  1 +
 gremlin-server/conf/gremlin-server-secure.yaml  |  1 +
 5 files changed, 29 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ca83fbdf/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index eb1a6c5..9dec8df 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -23,6 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 [[release-3-2-10]]
 === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET)
 
+* SSL security enhancements
 * Fixed problem with Gremlin Server sometimes returning an additional message after a failure.
 * Allowed spaces in classpath for `gremlin-server.bat`.
 * Modified Maven archetype for Gremlin Server to use remote traversals rather than scripts.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ca83fbdf/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index af03937..9b0a120 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -29,6 +29,31 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.2.10/CHANGELOG.as
 
 === Upgrading for Users
 
+==== SSL Security
+
+TinkerPop improves its security posture by removing insecure defaults and adding forward-looking standards support.
+
+Gremlin Server no longer supports automatically creating self-signed certificates.
+Self-signed certificates can still be created manually outside of Gremlin Server.
+If ssl is enabled, a key store must be configured.
+
+Cluster client no longer trusts all certs by default as this is an insecure configuration.
+Instead, if no trust store is configured, Cluster will use the default CA certs.
+To revert to the previous behavior and accept all certs, it must be explicitly configured.
+
+This release introduces JKS and PKCS12 support. JKS is the legacy Java Key Store. PKCS12 has better cross-platform support and is gaining in adoption.
+Be aware that JKS is the default on Java 8.  Java 9 and higher use PKCS12 as the default. Both Java keytool and OpenSSL tools can create, read, update PKCS12 files.
+
+Other new features include specifying SSL protocols and cipher suites.
+The packaged `*-secure.yaml` files now restrict the protocol to `TLSv1.2` by default.
+
+PEM-based configurations are deprecated and may be removed in a future release.
+
+See the section on configuring SSL.
+
+link:https://issues.apache.org/jira/browse/TINKERPOP-2022[TINKERPOP-2022]
+link:https://issues.apache.org/jira/browse/TINKERPOP-2023[TINKERPOP-2023]
+
 ==== Bulk Import and Export
 
 TinkerPop has provided some general methods for importing and exporting data, but more and more graph providers are

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ca83fbdf/gremlin-console/conf/remote-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/conf/remote-secure.yaml b/gremlin-console/conf/remote-secure.yaml
index c7a2c44..b0a7309 100644
--- a/gremlin-console/conf/remote-secure.yaml
+++ b/gremlin-console/conf/remote-secure.yaml
@@ -30,5 +30,5 @@ username: stephen
 password: password
 connectionPool: {
   enableSsl: true,
-  sslSkipCertValidation: true }
+  sslEnabledProtocols: [TLSv1.2] }
 serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ca83fbdf/gremlin-server/conf/gremlin-server-rest-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-rest-secure.yaml b/gremlin-server/conf/gremlin-server-rest-secure.yaml
index fcfbba1..2f4db91 100644
--- a/gremlin-server/conf/gremlin-server-rest-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-rest-secure.yaml
@@ -70,6 +70,7 @@ authentication: {
     credentialsDb: conf/tinkergraph-credentials.properties}}
 ssl: {
   enabled: true,
+  sslEnabledProtocols: [TLSv1.2],
   # You must configure a keyStore!
   #keyStore: server.jks,
   #keyStorePassword: changeit

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ca83fbdf/gremlin-server/conf/gremlin-server-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-secure.yaml b/gremlin-server/conf/gremlin-server-secure.yaml
index af46c59..637af12 100644
--- a/gremlin-server/conf/gremlin-server-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-secure.yaml
@@ -74,6 +74,7 @@ authentication: {
     credentialsDb: conf/tinkergraph-credentials.properties}}
 ssl: {
   enabled: true,
+  sslEnabledProtocols: [TLSv1.2],
   # You must configure a keyStore!
   #keyStore: server.jks,
   #keyStorePassword: changeit


[04/50] tinkerpop git commit: Close server for auth tests prior to assertions

Posted by sp...@apache.org.
Close server for auth tests prior to assertions

Further trying to flush logs to prevent random failure - hoping that killing the server will do it and make these tests more stable CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e55ffc64
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e55ffc64
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e55ffc64

Branch: refs/heads/TINKERPOP-2021
Commit: e55ffc6432a188b9629d00177b5e01cfb07c3f9a
Parents: ffb8c3e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 26 14:15:20 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 26 14:15:20 2018 -0400

----------------------------------------------------------------------
 .../GremlinServerAuditLogIntegrateTest.java     | 14 +++++++++----
 .../server/GremlinServerAuthIntegrateTest.java  |  1 -
 .../GremlinServerAuthKrb5IntegrateTest.java     | 15 ++++++++++++++
 .../tinkerpop/gremlin/server/KdcFixture.java    | 21 ++++++++++----------
 4 files changed, 35 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e55ffc64/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
index c31ee69..0231bab 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java
@@ -23,8 +23,6 @@ import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
-import org.apache.log4j.Appender;
-import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.log4j.spi.LoggingEvent;
 import static org.apache.log4j.Level.INFO;
@@ -165,6 +163,7 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
         }
 
         // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
         Thread.sleep(1000);
 
         // WebSocketChannelizer does not add SaslAuthenticationHandler for AllowAllAuthenticator,
@@ -192,6 +191,10 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
             cluster.close();
         }
 
+        // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
+        Thread.sleep(1000);
+
         final String simpleAuthenticatorName = SimpleAuthenticator.class.getSimpleName();
         final String authMsg = recordingAppender.getMessages().stream()
                 .filter(msg -> msg.contains("by " + simpleAuthenticatorName)).iterator().next();
@@ -199,8 +202,6 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
         m.find();
         final String address = m.group(1);
 
-        // wait for logger to flush - (don't think there is a way to detect this)
-        Thread.sleep(1000);
 
         assertTrue(recordingAppender.logContainsAny(AUDIT_LOGGER_NAME, INFO,
                 String.format("User %s with address %s authenticated by %s", username, address, simpleAuthenticatorName)));
@@ -226,6 +227,7 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
         }
 
         // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
         Thread.sleep(1000);
 
         final List<LoggingEvent> log = recordingAppender.getEvents();
@@ -260,6 +262,7 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
         }
 
         // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
         Thread.sleep(1000);
 
         final List<LoggingEvent> log = recordingAppender.getEvents();
@@ -287,6 +290,7 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
         }
 
         // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
         Thread.sleep(1000);
 
         final List<LoggingEvent> log = recordingAppender.getEvents();
@@ -322,6 +326,7 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
         }
 
         // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
         Thread.sleep(1000);
 
         final List<LoggingEvent> log = recordingAppender.getEvents();
@@ -359,6 +364,7 @@ public class GremlinServerAuditLogIntegrateTest extends AbstractGremlinServerInt
         }
 
         // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
         Thread.sleep(1000);
 
         final List<LoggingEvent> log = recordingAppender.getEvents();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e55ffc64/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
index 6dda40b..35acf38 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
@@ -40,7 +40,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.AnyOf.anyOf;
 import static org.hamcrest.core.IsInstanceOf.instanceOf;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e55ffc64/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
index 5a02d0a..10ed834 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
@@ -180,16 +180,31 @@ public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerInt
 
     @Test
     public void shouldFailWithNonexistentServerPrincipal() throws Exception {
+
+        // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
+        Thread.sleep(1000);
+
         assertTrue(recordingAppender.logContainsAny("WARN - Failed to login to kdc"));
     }
 
     @Test
     public void shouldFailWithEmptyServerKeytab() throws Exception {
+
+        // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
+        Thread.sleep(1000);
+
         assertTrue(recordingAppender.logContainsAny("WARN - Failed to login to kdc"));
     }
 
     @Test
     public void shouldFailWithWrongServerKeytab() throws Exception {
+
+        // wait for logger to flush - (don't think there is a way to detect this)
+        stopServer();
+        Thread.sleep(1000);
+
         assertTrue(recordingAppender.logContainsAny("WARN - Failed to login to kdc"));
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e55ffc64/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/KdcFixture.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/KdcFixture.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/KdcFixture.java
index fce29d8..29eaf8d 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/KdcFixture.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/KdcFixture.java
@@ -32,14 +32,14 @@ import java.net.Inet4Address;
 
 
 /**
- * @author Marc de Lignie
- *
  * This class is derived from the following classes from https://github.com/apache/directory-kerby/blob/kerby-all-1.0.0-RC2:
  *  - org.apache.kerby.kerberos.kerb.server.TestKdcServer
  *  - org.apache.kerby.kerberos.kerb.server.KdcTestBase
  *  - org.apache.kerby.kerberos.kerb.server.LoginTestBase
  *
  * See also: gremlin-server/src/main/static/NOTICE
+ *
+ * @author Marc de Lignie
  */
 public class KdcFixture {
 
@@ -65,8 +65,7 @@ public class KdcFixture {
     final String hostname;
     private SimpleKdcServer kdcServer;
 
-
-    public KdcFixture(String authConfigName)  throws Exception {
+    public KdcFixture(final String authConfigName) {
         System.setProperty("java.security.auth.login.config", authConfigName);
         hostname = findHostname();
         serverPrincipal = serverPrincipalName + "/" + hostname + "@" + KdcFixture.TestKdcServer.KDC_REALM;
@@ -92,9 +91,9 @@ public class KdcFixture {
     }
 
     private File createTestDir() {
-        String basedir = System.getProperty("basedir");
-        File targetdir = new File(basedir, "target");
-        File testDir = new File(targetdir, "tmp");
+        final String basedir = System.getProperty("basedir");
+        final File targetdir = new File(basedir, "target");
+        final File testDir = new File(targetdir, "tmp");
         testDir.mkdirs();
         return testDir;
     }
@@ -110,8 +109,8 @@ public class KdcFixture {
             setAllowUdp(false);    // There are still udp issues in Apache Directory-Kerby 1.0.0-RC2
             setKdcTcpPort(NetworkUtil.getServerPort());
 
-            KrbClient krbClnt = getKrbClient();
-            KrbConfig krbConfig = krbClnt.getKrbConfig();
+            final KrbClient krbClnt = getKrbClient();
+            final KrbConfig krbConfig = krbClnt.getKrbConfig();
             krbConfig.setString(KrbConfigKey.PERMITTED_ENCTYPES,
                     "aes128-cts-hmac-sha1-96 des-cbc-crc des-cbc-md5 des3-cbc-sha1");
             krbClnt.setTimeout(10 * 1000);
@@ -135,11 +134,11 @@ public class KdcFixture {
         kdcServer.exportPrincipal(serverPrincipal, serviceKeytabFile);
 
         kdcServer.createPrincipal(clientPrincipal, clientPassword);
-        TgtTicket tgt = kdcServer.getKrbClient().requestTgt(clientPrincipal, clientPassword);
+        final TgtTicket tgt = kdcServer.getKrbClient().requestTgt(clientPrincipal, clientPassword);
         kdcServer.getKrbClient().storeTicket(tgt, ticketCacheFile);
 
         kdcServer.createPrincipal(clientPrincipal2, clientPassword2);
-        TgtTicket tgt2 = kdcServer.getKrbClient().requestTgt(clientPrincipal2, clientPassword2);
+        final TgtTicket tgt2 = kdcServer.getKrbClient().requestTgt(clientPrincipal2, clientPassword2);
         kdcServer.getKrbClient().storeTicket(tgt2, ticketCacheFile2);
     }
 


[24/50] tinkerpop git commit: Ignored pageRank() test for decimal assertion problems in GLVs CTR

Posted by sp...@apache.org.
Ignored pageRank() test for decimal assertion problems in GLVs CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/bdda9135
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bdda9135
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bdda9135

Branch: refs/heads/TINKERPOP-2021
Commit: bdda91355f91fe5074424a0396e346577d08a8a4
Parents: 25ae755
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Aug 14 07:07:49 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Aug 14 07:07:49 2018 -0400

----------------------------------------------------------------------
 gremlin-test/features/map/PageRank.feature | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bdda9135/gremlin-test/features/map/PageRank.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/PageRank.feature b/gremlin-test/features/map/PageRank.feature
index 8ead2d4..24a19ec 100644
--- a/gremlin-test/features/map/PageRank.feature
+++ b/gremlin-test/features/map/PageRank.feature
@@ -78,19 +78,12 @@ Feature: Step - pageRank()
 
   Scenario: g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX
     Given the modern graph
-    And the traversal of
+    Given an unsupported test
+    Then nothing should happen because
       """
-      g.withComputer().V().pageRank().by(__.outE("knows")).by("friendRank").valueMap("name", "friendRank")
+      The result is not completely deterministic with respect to the decimals that pageRank() produces and the
+      GLV framework does not have a notion for asserting anything beyond an equals() sort of state.
       """
-    When iterated to list
-    Then the result should be unordered
-      | result |
-      | m[{"name": ["marko"], "friendRank": [0.14598537777608422]}] |
-      | m[{"name": ["vadas"], "friendRank": [0.20802924444783155]}] |
-      | m[{"name": ["lop"], "friendRank": [0.14598537777608422]}] |
-      | m[{"name": ["josh"], "friendRank": [0.20802924444783155]}] |
-      | m[{"name": ["ripple"], "friendRank": [0.14598537777608422]}] |
-      | m[{"name": ["peter"], "friendRank": [0.14598537777608422]}] |
 
   Scenario: g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX
     Given an unsupported test


[06/50] tinkerpop git commit: Consistent use of hyphen for step references CTR

Posted by sp...@apache.org.
Consistent use of hyphen for step references CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9b693c02
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9b693c02
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9b693c02

Branch: refs/heads/TINKERPOP-2021
Commit: 9b693c02c6101b82af0d19bae3252fe022ecb988
Parents: 66099fe
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 27 07:18:25 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jul 27 07:18:25 2018 -0400

----------------------------------------------------------------------
 docs/src/upgrade/release-3.3.x.asciidoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9b693c02/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index a18075f..f6cade0 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -115,7 +115,7 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.3.1/CHANGELOG.asc
 ==== Gremlin Python path()
 
 There was a bug in GraphSON 3.0 serialization that prevented proper handling of results contain `Path` object. As a
-result, traversals that used and returned results from the `path()` step in Python would return unusable results,
+result, traversals that used and returned results from the `path()`-step in Python would return unusable results,
 but did not actually cause an exception condition. This problem is now resolved.
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1799[TINKERPOP-1799]
@@ -154,7 +154,7 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-1632[TINKERPOP-1632]
 
 ==== Changed Typing on `from()` and `to()`
 
-The `from()` and `to()` steps of `GraphTraversal` have a `Traversal<E,Vertex>` overload. The `E` has been changed to `?`
+The `from()` and `to()`-steps of `GraphTraversal` have a `Traversal<E,Vertex>` overload. The `E` has been changed to `?`
 in order to reduce `< >`-based coersion in strongly type Gremlin language variants.
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1793[TINKERPOP-1793]


[37/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b34515a9
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b34515a9
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b34515a9

Branch: refs/heads/TINKERPOP-2021
Commit: b34515a91b2055bef3c4561da65b2a1c5f8617ae
Parents: b46c295 ca3a343
Author: Robert Dale <ro...@gmail.com>
Authored: Wed Aug 22 12:42:46 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Wed Aug 22 12:42:46 2018 -0400

----------------------------------------------------------------------
 .../jsr223/AbstractGremlinScriptEngineFactory.java  |  6 +++---
 .../process/traversal/dsl/GremlinDslProcessor.java  | 12 +++++++-----
 .../traversal/util/DefaultTraversalMetrics.java     | 16 +++++++++-------
 3 files changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b34515a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b34515a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
index ae0bd8e,055e3ab..bfcfacc
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
@@@ -286,10 -188,121 +287,11 @@@ public final class DefaultTraversalMetr
      private static String padLeft(final String text, final int amountToPad) {
          // not sure why this method needed to exist. stupid string format stuff and commons utilities wouldn't
          // work for some reason in the context this method was used above.
-         String newText = text;
+         final StringBuilder newText = new StringBuilder();
          for (int ix = 0; ix < amountToPad; ix++) {
-             newText = " " + newText;
+             newText.append(" ");
          }
-         return newText;
+         newText.append(text);
+         return newText.toString();
      }
 -
 -    private void computeTotals() {
 -        // Create temp list of ordered metrics
 -        final List<MutableMetrics> tempMetrics = new ArrayList<>(this.metrics.size());
 -        for (final String label : this.indexToLabelMap.values()) {
 -            // The indexToLabelMap is sorted by index (key)
 -            tempMetrics.add(this.metrics.get(label).clone());
 -        }
 -
 -        // Calculate total duration
 -        this.totalStepDuration = 0;
 -        tempMetrics.forEach(metric -> this.totalStepDuration += metric.getDuration(MutableMetrics.SOURCE_UNIT));
 -
 -        // Assign %'s
 -        tempMetrics.forEach(m -> {
 -            final double dur = m.getDuration(TimeUnit.NANOSECONDS) * 100.d / this.totalStepDuration;
 -            m.setAnnotation(PERCENT_DURATION_KEY, dur);
 -        });
 -
 -        // Store immutable instances of the calculated metrics
 -        this.computedMetrics = new LinkedHashMap<>(this.metrics.size());
 -        tempMetrics.forEach(it -> this.computedMetrics.put(it.getId(), it.getImmutableClone()));
 -    }
 -
 -    public static DefaultTraversalMetrics merge(final Iterator<DefaultTraversalMetrics> toMerge) {
 -        final DefaultTraversalMetrics newTraversalMetrics = new DefaultTraversalMetrics();
 -
 -        // iterate the incoming TraversalMetrics
 -        toMerge.forEachRemaining(inTraversalMetrics -> {
 -            // aggregate the internal Metrics
 -            inTraversalMetrics.metrics.forEach((metricsId, toAggregate) -> {
 -
 -                MutableMetrics aggregateMetrics = newTraversalMetrics.metrics.get(metricsId);
 -                if (null == aggregateMetrics) {
 -                    // need to create a Metrics to aggregate into
 -                    aggregateMetrics = new MutableMetrics(toAggregate.getId(), toAggregate.getName());
 -
 -                    newTraversalMetrics.metrics.put(metricsId, aggregateMetrics);
 -                    // Set the index of the Metrics
 -                    for (final Map.Entry<Integer, String> entry : inTraversalMetrics.indexToLabelMap.entrySet()) {
 -                        if (metricsId.equals(entry.getValue())) {
 -                            newTraversalMetrics.indexToLabelMap.put(entry.getKey(), metricsId);
 -                            break;
 -                        }
 -                    }
 -                }
 -                aggregateMetrics.aggregate(toAggregate);
 -            });
 -        });
 -        return newTraversalMetrics;
 -    }
 -
 -    public void setMetrics(final Traversal.Admin traversal, final boolean onGraphComputer) {
 -        addTopLevelMetrics(traversal, onGraphComputer);
 -        handleNestedTraversals(traversal, null, onGraphComputer);
 -        computeTotals();
 -    }
 -
 -    private void addTopLevelMetrics(Traversal.Admin traversal, final boolean onGraphComputer) {
 -        final List<ProfileStep> profileSteps = TraversalHelper.getStepsOfClass(ProfileStep.class, traversal);
 -        for (int ii = 0; ii < profileSteps.size(); ii++) {
 -            // The index is necessary to ensure that step order is preserved after a merge.
 -            final ProfileStep step = profileSteps.get(ii);
 -            if (onGraphComputer) {
 -                final MutableMetrics stepMetrics = traversal.getSideEffects().get(step.getId());
 -                this.indexToLabelMap.put(ii, stepMetrics.getId());
 -                this.metrics.put(stepMetrics.getId(), stepMetrics);
 -            } else {
 -                final MutableMetrics stepMetrics = step.getMetrics();
 -                this.indexToLabelMap.put(ii, stepMetrics.getId());
 -                this.metrics.put(stepMetrics.getId(), stepMetrics);
 -            }
 -        }
 -    }
 -
 -    private void handleNestedTraversals(final Traversal.Admin traversal, final MutableMetrics parentMetrics, final boolean onGraphComputer) {
 -        long prevDur = 0;
 -        for (int i = 0; i < traversal.getSteps().size(); i++) {
 -            final Step step = (Step) traversal.getSteps().get(i);
 -            if (!(step instanceof ProfileStep))
 -                continue;
 -
 -            final MutableMetrics metrics = onGraphComputer ?
 -                    traversal.getSideEffects().get(step.getId()) :
 -                    ((ProfileStep) step).getMetrics();
 -
 -            if (null != metrics) { // this happens when a particular branch never received a .next() call (the metrics were never initialized)
 -                if (!onGraphComputer) {
 -                    // subtract upstream duration.
 -                    long durBeforeAdjustment = metrics.getDuration(TimeUnit.NANOSECONDS);
 -                    // adjust duration
 -                    metrics.setDuration(metrics.getDuration(TimeUnit.NANOSECONDS) - prevDur, TimeUnit.NANOSECONDS);
 -                    prevDur = durBeforeAdjustment;
 -                }
 -
 -                if (parentMetrics != null) {
 -                    parentMetrics.addNested(metrics);
 -                }
 -
 -                if (step.getPreviousStep() instanceof TraversalParent) {
 -                    for (Traversal.Admin<?, ?> t : ((TraversalParent) step.getPreviousStep()).getLocalChildren()) {
 -                        handleNestedTraversals(t, metrics, onGraphComputer);
 -                    }
 -                    for (Traversal.Admin<?, ?> t : ((TraversalParent) step.getPreviousStep()).getGlobalChildren()) {
 -                        handleNestedTraversals(t, metrics, onGraphComputer);
 -                    }
 -                }
 -            }
 -        }
 -    }
  }


[19/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5e48acce
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5e48acce
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5e48acce

Branch: refs/heads/TINKERPOP-2021
Commit: 5e48accebc6906c0069f6fb91548a28e5af09f9b
Parents: b9ebe15 b50a3c8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Aug 10 11:35:24 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Aug 10 11:35:24 2018 -0400

----------------------------------------------------------------------
 docs/src/reference/preface.asciidoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[47/50] tinkerpop git commit: merge tp32

Posted by sp...@apache.org.
merge tp32


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e1c46b26
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e1c46b26
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e1c46b26

Branch: refs/heads/TINKERPOP-2021
Commit: e1c46b2656ecbb4b5bbf059105bffe0dcd278e4a
Parents: 98ab1b0 e937a3a
Author: Robert Dale <ro...@gmail.com>
Authored: Tue Sep 4 07:42:32 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Tue Sep 4 11:41:17 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 .../src/reference/gremlin-applications.asciidoc |  82 +++++--
 .../upgrade/release-3.2.x-incubating.asciidoc   |  26 +++
 gremlin-console/conf/remote-secure.yaml         |   3 +-
 .../tinkerpop/gremlin/driver/Cluster.java       | 180 ++++++++++++++-
 .../tinkerpop/gremlin/driver/Settings.java      |  83 +++++++
 .../tinkerpop/gremlin/driver/SettingsTest.java  |  17 ++
 .../conf/gremlin-server-rest-secure.yaml        |   7 +-
 gremlin-server/conf/gremlin-server-secure.yaml  |   7 +-
 .../gremlin/server/AbstractChannelizer.java     |  91 ++++++--
 .../tinkerpop/gremlin/server/Settings.java      |  66 +++++-
 .../AbstractGremlinServerIntegrationTest.java   |  13 ++
 .../server/GremlinServerAuthIntegrateTest.java  |   4 +-
 .../GremlinServerAuthKrb5IntegrateTest.java     |   5 +-
 .../server/GremlinServerIntegrateTest.java      | 224 ++++++++++++++++---
 ...ctGremlinServerChannelizerIntegrateTest.java |  12 +-
 .../src/test/resources/client-key.jks           | Bin 0 -> 2241 bytes
 .../src/test/resources/client-key.p12           | Bin 0 -> 2583 bytes
 .../src/test/resources/client-trust.jks         | Bin 0 -> 969 bytes
 .../src/test/resources/client-trust.p12         | Bin 0 -> 1202 bytes
 .../src/test/resources/server-key.jks           | Bin 0 -> 2258 bytes
 .../src/test/resources/server-key.p12           | Bin 0 -> 2613 bytes
 .../src/test/resources/server-trust.jks         | Bin 0 -> 952 bytes
 .../src/test/resources/server-trust.p12         | Bin 0 -> 1186 bytes
 24 files changed, 725 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/reference/gremlin-applications.asciidoc
index e175d4b,1cd9964..83b52b6
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@@ -766,9 -742,14 +766,13 @@@ The following table describes the vario
  |connectionPool.minInProcessPerConnection |The minimum number of in-flight requests that can occur on a connection. |1
  |connectionPool.minSimultaneousUsagePerConnection |The maximum number of times that a connection can be borrowed from the pool simultaneously. |8
  |connectionPool.minSize |The minimum size of a connection pool for a host. |2
 -|connectionPool.reconnectInitialDelay |The amount of time in milliseconds to wait before trying to reconnect to a dead host for the first time. |1000
 -|connectionPool.reconnectInterval |The amount of time in milliseconds to wait before trying to reconnect to a dead host. This interval occurs after the time specified by the `reconnectInitialDelay`. |1000
 +|connectionPool.reconnectInterval |The amount of time in milliseconds to wait before trying to reconnect to a dead host. |1000
  |connectionPool.resultIterationBatchSize |The override value for the size of the result batches to be returned from the server. |64
- |connectionPool.trustCertChainFile |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the `TrustManager` will be established with a self-signed certificate which is NOT suitable for production purposes. |_none_
+ |connectionPool.sslCipherSuites |The list of JSSE ciphers to support for SSL connections. If specified, only the ciphers that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
+ |connectionPool.sslEnabledProtocols |The list of SSL protocols to support for SSL connections. If specified, only the protocols that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
+ |connectionPool.sslSkipCertValidation |Configures the `TrustManager` to trust all certs without any validation. Should not be used in production.|false
+ |connectionPool.trustStore |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
+ |connectionPool.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_
  |hosts |The list of hosts that the driver will connect to. |localhost
  |jaasEntry |Sets the `AuthProperties.Property.JAAS_ENTRY` properties for authentication to Gremlin Server. |_none_
  |nioPoolSize |Size of the pool for handling request/response operations. |available processors
@@@ -1313,8 -1246,50 +1320,48 @@@ authentication: 
    config: {
      credentialsDb: conf/tinkergraph-credentials.properties}}
  
 -===== Quick Start
 -
  A quick way to get started with the `SimpleAuthenticator` is to use TinkerGraph for the "credentials graph" and the
- "sample" credential graph that is packaged with the server.
+ "sample" credential graph that is packaged with the server.  To secure the transport for the credentials,
+ SSL should be enabled. For this Quick Start, a self-signed certificate will be created but this should not
+ be used in a production environment.
+ 
+ Generate the self-signed SSL certificate:
+ 
+ [source,text]
+ ----
+ $ keytool -genkey -alias localhost -keyalg RSA -keystore server.jks
+ Enter keystore password:
+ Re-enter new password:
+ What is your first and last name?
+   [Unknown]:  localhost
+ What is the name of your organizational unit?
+   [Unknown]:
+ What is the name of your organization?
+   [Unknown]:
+ What is the name of your City or Locality?
+   [Unknown]:
+ What is the name of your State or Province?
+   [Unknown]:
+ What is the two-letter country code for this unit?
+   [Unknown]:
+ Is CN=localhost, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
+   [no]:  yes
+ 
+ Enter key password for <localhost>
+ 	(RETURN if same as keystore password):
+ ----
+ 
+ Next, uncomment the `keyStore` and `keyStorePassword` lines in `conf/gremlin-server-secure.yaml`.
+ 
+ [source,yaml]
+ ----
+ ssl: {
+   enabled: true,
+   sslEnabledProtocols: [TLSv1.2],
+   keyStore: server.jks,
+   keyStorePassword: changeit
+ }
+ ----
  
  [source,text]
  ----

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-console/conf/remote-secure.yaml
----------------------------------------------------------------------
diff --cc gremlin-console/conf/remote-secure.yaml
index 592adcc,b0a7309..97b756b
--- a/gremlin-console/conf/remote-secure.yaml
+++ b/gremlin-console/conf/remote-secure.yaml
@@@ -29,5 -29,6 +29,6 @@@ port: 818
  username: stephen
  password: password
  connectionPool: {
-   enableSsl: true}
+   enableSsl: true,
+   sslEnabledProtocols: [TLSv1.2] }
 -serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
 +serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-server/conf/gremlin-server-rest-secure.yaml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-server/conf/gremlin-server-secure.yaml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
----------------------------------------------------------------------
diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
index c102446,0000000..a6f8f91
mode 100644,000000..100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthKrb5IntegrateTest.java
@@@ -1,276 -1,0 +1,279 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + * http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.tinkerpop.gremlin.server;
 +
 +import org.apache.commons.lang.exception.ExceptionUtils;
 +import org.apache.log4j.Logger;
 +import org.apache.tinkerpop.gremlin.driver.Client;
 +import org.apache.tinkerpop.gremlin.driver.Cluster;
 +import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 +import org.apache.tinkerpop.gremlin.driver.exception.ResponseException;
 +import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 +import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0;
 +import org.apache.tinkerpop.gremlin.server.auth.Krb5Authenticator;
 +import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
 +import org.ietf.jgss.GSSException;
 +import org.junit.After;
 +import org.junit.Before;
 +import org.junit.Test;
 +import org.slf4j.LoggerFactory;
 +
 +import java.io.File;
 +import java.util.HashMap;
 +import java.util.Map;
 +import javax.security.auth.login.LoginException;
 +
 +import static org.hamcrest.MatcherAssert.assertThat;
 +import static org.hamcrest.core.Is.is;
 +import static org.junit.Assert.assertEquals;
 +import static org.junit.Assert.assertTrue;
 +import static org.junit.Assert.fail;
 +
 +/**
 + * @author Marc de Lignie
 + */
 +public class GremlinServerAuthKrb5IntegrateTest extends AbstractGremlinServerIntegrationTest {
 +    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(GremlinServerAuthKrb5IntegrateTest.class);
 +    private Log4jRecordingAppender recordingAppender = null;
 +
 +    static final String TESTCONSOLE = "GremlinConsole";
 +    static final String TESTCONSOLE_NOT_LOGGED_IN = "UserNotLoggedIn";
 +
 +    private KdcFixture kdcServer;
 +
 +    @Before
 +    @Override
 +    public void setUp() throws Exception {
 +        setupForEachTest();
 +        try {
 +            final String buildDir = System.getProperty("build.dir");
 +            kdcServer = new KdcFixture(buildDir +
 +                    "/test-classes/org/apache/tinkerpop/gremlin/server/gremlin-console-jaas.conf");
 +            kdcServer.setUp();
 +        } catch(Exception e)  {
 +            logger.warn(e.getMessage());
 +        }
 +        super.setUp();
 +    }
 +
 +    public void setupForEachTest() {
 +        recordingAppender = new Log4jRecordingAppender();
 +        final Logger rootLogger = Logger.getRootLogger();
 +        rootLogger.addAppender(recordingAppender);
 +    }
 +
 +    @After
 +    public void teardownForEachTest() throws Exception {
 +        final Logger rootLogger = Logger.getRootLogger();
 +        rootLogger.removeAppender(recordingAppender);
 +        kdcServer.close();
 +    }
 +
 +    /**
 +     * Configure specific Gremlin Server settings for specific tests.
 +     */
 +    @Override
 +    public Settings overrideSettings(final Settings settings) {
 +        settings.host = kdcServer.hostname;
 +        final Settings.SslSettings sslConfig = new Settings.SslSettings();
 +        sslConfig.enabled = false;
 +        settings.ssl = sslConfig;
 +        final Settings.AuthenticationSettings authSettings = new Settings.AuthenticationSettings();
 +        settings.authentication = authSettings;
 +        authSettings.className = Krb5Authenticator.class.getName();
 +        final Map<String,Object> authConfig = new HashMap<>();
 +        authConfig.put("principal", kdcServer.serverPrincipal);
 +        authConfig.put("keytab", kdcServer.serviceKeytabFile.getAbsolutePath());
 +        authSettings.config = authConfig;
 +
 +        final String nameOfTest = name.getMethodName();
 +        switch (nameOfTest) {
 +            case "shouldAuthenticateWithDefaults":
 +            case "shouldFailWithoutClientJaasEntry":
 +            case "shouldFailWithoutClientTicketCache":
 +                break;
 +            case "shouldFailWithNonexistentServerPrincipal":
 +                authConfig.put("principal", "no-service");
 +                break;
 +            case "shouldFailWithEmptyServerKeytab":
 +                final File keytabFile = new File(".", "no-file");
 +                authConfig.put("keytab", keytabFile);
 +                break;
 +            case "shouldFailWithWrongServerKeytab":
 +                final String principal = "no-principal/somehost@TEST.COM";
 +                try { kdcServer.createPrincipal(principal); } catch(Exception e) {
 +                    logger.error("Cannot create principal in overrideSettings(): " + e.getMessage());
 +                };
 +                authConfig.put("principal", principal);
 +                break;
 +            case "shouldAuthenticateWithSsl":
 +                sslConfig.enabled = true;
++                sslConfig.keyStore = JKS_SERVER_KEY;
++                sslConfig.keyStorePassword = KEY_PASS;
++                sslConfig.keyStoreType = KEYSTORE_TYPE_JKS;
 +                break;
 +            case "shouldAuthenticateWithQop":
 +                break;
 +        }
 +        return settings;
 +    }
 +
 +    @Test
 +    public void shouldAuthenticateWithDefaults() throws Exception {
 +        final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE)
 +                .protocol(kdcServer.serverPrincipalName).addContactPoint(kdcServer.hostname).create();
 +        final Client client = cluster.connect();
 +        try {
 +            assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
 +            assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
 +            assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
 +        } finally {
 +            cluster.close();
 +        }
 +    }
 +
 +    @Test
 +    public void shouldFailWithoutClientJaasEntry() throws Exception {
 +        final Cluster cluster = TestClientFactory.build().protocol(kdcServer.serverPrincipalName)
 +                .addContactPoint(kdcServer.hostname).create();
 +        final Client client = cluster.connect();
 +        try {
 +            client.submit("1+1").all().get();
 +            fail("This should not succeed as the client config does not contain a JaasEntry");
 +        } catch(Exception ex) {
 +            final Throwable root = ExceptionUtils.getRootCause(ex);
 +            assertTrue(root instanceof ResponseException || root instanceof GSSException);
 +        } finally {
 +            cluster.close();
 +        }
 +    }
 +
 +    @Test
 +    public void shouldFailWithoutClientTicketCache() throws Exception {
 +        final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE_NOT_LOGGED_IN)
 +                .protocol(kdcServer.serverPrincipalName).addContactPoint(kdcServer.hostname).create();
 +        final Client client = cluster.connect();
 +        try {
 +            client.submit("1+1").all().get();
 +            fail("This should not succeed as the client config does not contain a valid ticket cache");
 +        } catch(Exception ex) {
 +            final Throwable root = ExceptionUtils.getRootCause(ex);
 +            assertEquals(LoginException.class, root.getClass());
 +        } finally {
 +            cluster.close();
 +        }
 +    }
 +
 +    @Test
 +    public void shouldFailWithNonexistentServerPrincipal() throws Exception {
 +        assertFailedLogin();
 +    }
 +
 +    @Test
 +    public void shouldFailWithEmptyServerKeytab() throws Exception {
 +        assertFailedLogin();
 +    }
 +
 +    @Test
 +    public void shouldFailWithWrongServerKeytab() throws Exception {
 +        assertFailedLogin();
 +    }
 +
 +    @Test
 +    public void shouldAuthenticateWithQop() throws Exception {
 +        final String oldQop = System.getProperty("javax.security.sasl.qop", "");
 +        System.setProperty("javax.security.sasl.qop", "auth-conf");
 +        final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE)
 +                .protocol(kdcServer.serverPrincipalName).addContactPoint(kdcServer.hostname).create();
 +        final Client client = cluster.connect();
 +        try {
 +            assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
 +            assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
 +            assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
 +        } finally {
 +            cluster.close();
 +            System.setProperty("javax.security.sasl.qop", oldQop);
 +        }
 +    }
 +
 +    @Test
 +    public void shouldAuthenticateWithSsl() throws Exception {
-         final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE).enableSsl(true)
++        final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE).enableSsl(true).sslSkipCertValidation(true)
 +                .protocol(kdcServer.serverPrincipalName).addContactPoint(kdcServer.hostname).create();
 +        final Client client = cluster.connect();
 +        try {
 +            assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
 +            assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
 +            assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
 +        } finally {
 +            cluster.close();
 +        }
 +    }
 +
 +    @Test
 +    public void shouldAuthenticateWithSerializeResultToStringV1() throws Exception {
 +        final MessageSerializer serializer = new GryoMessageSerializerV1d0();
 +        final Map<String,Object> config = new HashMap<>();
 +        config.put("serializeResultToString", true);
 +        serializer.configure(config, null);
 +        final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE)
 +                .protocol(kdcServer.serverPrincipalName).addContactPoint(kdcServer.hostname).serializer(serializer).create();
 +        final Client client = cluster.connect();
 +        try {
 +            assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
 +            assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
 +            assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
 +        } finally {
 +            cluster.close();
 +        }
 +    }
 +
 +    @Test
 +    public void shouldAuthenticateWithSerializeResultToStringV3() throws Exception {
 +        final MessageSerializer serializer = new GryoMessageSerializerV3d0();
 +        final Map<String, Object> config = new HashMap<>();
 +        config.put("serializeResultToString", true);
 +        serializer.configure(config, null);
 +        final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE)
 +                .protocol(kdcServer.serverPrincipalName).addContactPoint(kdcServer.hostname).serializer(serializer).create();
 +        final Client client = cluster.connect();
 +        try {
 +            assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
 +            assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
 +            assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
 +        } finally {
 +            cluster.close();
 +        }
 +    }
 +
 +    /**
 +     * Tries to force the logger to flush fully or at least wait until it does.
 +     */
 +    private void assertFailedLogin() throws Exception {
 +        stopServer();
 +
 +        boolean logMessageIdentified = false;
 +        for (int ix = 0; ix < 10 && !logMessageIdentified; ix++) {
 +            logMessageIdentified = recordingAppender.logContainsAny("WARN - Failed to login to kdc");
 +            if (!logMessageIdentified) Thread.sleep(1000);
 +        }
 +
 +        assertThat(logMessageIdentified, is(true));
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 0de3718,2198682..db2727a
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@@ -222,25 -227,76 +226,79 @@@ public class GremlinServerIntegrateTes
                  settings.ssl = new Settings.SslSettings();
                  settings.ssl.enabled = true;
                  settings.ssl.needClientAuth = ClientAuth.REQUIRE;
-                 settings.ssl.keyCertChainFile = SERVER_CRT;
-                 settings.ssl.keyFile = SERVER_KEY;
-                 settings.ssl.keyPassword =KEY_PASS;
+                 settings.ssl.keyCertChainFile = PEM_SERVER_CRT;
+                 settings.ssl.keyFile = PEM_SERVER_KEY;
+                 settings.ssl.keyPassword = KEY_PASS;
                  // Trust ONLY the server cert
-                 settings.ssl.trustCertChainFile = SERVER_CRT;
-             	break;
+                 settings.ssl.trustCertChainFile = PEM_SERVER_CRT;
+                 break;
+             case "shouldEnableSslAndClientCertificateAuthWithPkcs12":
+                 settings.ssl = new Settings.SslSettings();
+                 settings.ssl.enabled = true;
+                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
+                 settings.ssl.keyStore = P12_SERVER_KEY;
+                 settings.ssl.keyStorePassword = KEY_PASS;
+                 settings.ssl.keyStoreType = KEYSTORE_TYPE_PKCS12;
+                 settings.ssl.trustStore = P12_SERVER_TRUST;
+                 settings.ssl.trustStorePassword = KEY_PASS;
+                 break;
+             case "shouldEnableSslAndClientCertificateAuth":
+                 settings.ssl = new Settings.SslSettings();
+                 settings.ssl.enabled = true;
+                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
+                 settings.ssl.keyStore = JKS_SERVER_KEY;
+                 settings.ssl.keyStorePassword = KEY_PASS;
+                 settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                 settings.ssl.trustStore = JKS_SERVER_TRUST;
+                 settings.ssl.trustStorePassword = KEY_PASS;
+                 break;
+             case "shouldEnableSslAndClientCertificateAuthAndFailWithoutCert":
+                 settings.ssl = new Settings.SslSettings();
+                 settings.ssl.enabled = true;
+                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
+                 settings.ssl.keyStore = JKS_SERVER_KEY;
+                 settings.ssl.keyStorePassword = KEY_PASS;
+                 settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                 settings.ssl.trustStore = JKS_SERVER_TRUST;
+                 settings.ssl.trustStorePassword = KEY_PASS;
+                 break;
+             case "shouldEnableSslAndClientCertificateAuthAndFailWithoutTrustedClientCert":
+                 settings.ssl = new Settings.SslSettings();
+                 settings.ssl.enabled = true;
+                 settings.ssl.needClientAuth = ClientAuth.REQUIRE;
+                 settings.ssl.keyStore = JKS_SERVER_KEY;
+                 settings.ssl.keyStorePassword = KEY_PASS;
+                 settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                 break;
+             case "shouldEnableSslAndFailIfProtocolsDontMatch":
+                 settings.ssl = new Settings.SslSettings();
+                 settings.ssl.enabled = true;
+                 settings.ssl.keyStore = JKS_SERVER_KEY;
+                 settings.ssl.keyStorePassword = KEY_PASS;
+                 settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                 settings.ssl.sslEnabledProtocols = Arrays.asList("TLSv1.1");
+                 break;
+             case "shouldEnableSslAndFailIfCiphersDontMatch":
+                 settings.ssl = new Settings.SslSettings();
+                 settings.ssl.enabled = true;
+                 settings.ssl.keyStore = JKS_SERVER_KEY;
+                 settings.ssl.keyStorePassword = KEY_PASS;
+                 settings.ssl.keyStoreType = KEYSTORE_TYPE_JKS;
+                 settings.ssl.sslCipherSuites = Arrays.asList("TLS_DHE_RSA_WITH_AES_128_CBC_SHA");
+                 break;
              case "shouldUseSimpleSandbox":
 -                settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForSimpleSandbox();
 +                settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForSimpleSandbox());
 +                // remove the script because it isn't used in the test but also because it's not CompileStatic ready
 +                settings.scriptEngines.get("gremlin-groovy").plugins.remove(ScriptFileGremlinPlugin.class.getName());
                  break;
              case "shouldUseInterpreterMode":
 -                settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForInterpreterMode();
 +                settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForInterpreterMode());
                  break;
              case "shouldReceiveFailureTimeOutOnScriptEvalOfOutOfControlLoop":
 -                settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForTimedInterrupt();
 +                settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForTimedInterrupt());
                  break;
              case "shouldUseBaseScript":
 +                settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForBaseScript());
                  settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForBaseScript();
                  break;
              case "shouldReturnInvalidRequestArgsWhenBindingCountExceedsAllowable":

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1c46b26/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/channel/AbstractGremlinServerChannelizerIntegrateTest.java
----------------------------------------------------------------------


[36/50] tinkerpop git commit: Add null checking for configuration; Remove unused import

Posted by sp...@apache.org.
Add null checking for configuration;
Remove unused import


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6efd47da
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6efd47da
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6efd47da

Branch: refs/heads/TINKERPOP-2021
Commit: 6efd47da55c1d621714c481b21cf8b4494585680
Parents: bf94f43
Author: Justin Chu <15...@users.noreply.github.com>
Authored: Tue Aug 21 18:28:59 2018 -0400
Committer: Justin Chu <15...@users.noreply.github.com>
Committed: Tue Aug 21 18:28:59 2018 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java     | 2 +-
 .../java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java     | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6efd47da/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java
index 7a87414..bd2d20b 100644
--- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java
+++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/util/TinkerGraphProvider.java
@@ -85,7 +85,7 @@ public class TinkerGraphProvider extends AbstractGraphProvider {
             graph.close();
 
         // in the even the graph is persisted we need to clean up
-        final String graphLocation = configuration.getString(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, null);
+        final String graphLocation = null != configuration ? configuration.getString(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, null) : null;
         if (graphLocation != null) {
             final File f = new File(graphLocation);
             f.delete();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6efd47da/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index 2ccf762..a614252 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -41,7 +41,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Random;
 import java.util.Set;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;


[15/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2cf551f0
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2cf551f0
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2cf551f0

Branch: refs/heads/TINKERPOP-2021
Commit: 2cf551f089221f29e38627cf684fd89d6b3a3cea
Parents: 3e308f5 2d315e8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Aug 7 06:30:22 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Aug 7 06:30:22 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                                | 1 +
 .../tinkerpop/gremlin/server/util/GremlinServerInstall.java       | 3 +++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2cf551f0/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2cf551f0/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/GremlinServerInstall.java
----------------------------------------------------------------------


[45/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/98ab1b05
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/98ab1b05
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/98ab1b05

Branch: refs/heads/TINKERPOP-2021
Commit: 98ab1b05a731ce81f6a5d09310cda4fd4e1cd441
Parents: 94d9de0 3afc576
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Aug 31 15:51:08 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Aug 31 15:51:08 2018 -0400

----------------------------------------------------------------------
 docs/src/recipes/cycle-detection.asciidoc | 33 +++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[17/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33

Conflicts:
	gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPageRankTest.groovy
	gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPeerPressureTest.groovy
	gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
	gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b12a3fdd
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b12a3fdd
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b12a3fdd

Branch: refs/heads/TINKERPOP-2021
Commit: b12a3fdd01f0505773d865538e987de66c74d044
Parents: fa7a7f6 a533878
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Aug 9 10:12:44 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Aug 9 10:12:44 2018 -0400

----------------------------------------------------------------------
 .../gremlin/process/remote/RemoteGraph.java     |  17 ---
 .../io/graphson/TraversalSerializersV2d0.java   |   4 -
 .../ModernGraphTypeInformation.cs               |   4 +
 .../DriverRemoteTraversalSideEffects.java       |   3 +-
 .../test/cucumber/feature-steps.js              |  14 +-
 .../glv/GraphTraversalSource.template           |   2 +-
 .../gremlin_python/process/graph_traversal.py   |   2 +-
 .../RemoteGraphGroovyTranslatorProvider.java    |   3 +-
 gremlin-test/features/map/PageRank.feature      | 132 +++++++++++++++++++
 gremlin-test/features/map/PeerPressure.feature  |  60 +++++++++
 .../process/AbstractGremlinProcessTest.java     |  26 ++--
 .../traversal/step/map/PageRankTest.java        |  37 +++---
 .../traversal/step/map/PeerPressureTest.java    |  25 ++--
 .../TranslationStrategyProcessTest.java         |   3 +
 .../gremlin/process/FeatureCoverageTest.java    |   6 +-
 15 files changed, 266 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-python/glv/GraphTraversalSource.template
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/RemoteGraphGroovyTranslatorProvider.java
----------------------------------------------------------------------
diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/RemoteGraphGroovyTranslatorProvider.java
index 6949426,e170cb1..38935a0
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/RemoteGraphGroovyTranslatorProvider.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/RemoteGraphGroovyTranslatorProvider.java
@@@ -35,28 -29,9 +35,29 @@@ import java.util.Set
   */
  public class RemoteGraphGroovyTranslatorProvider extends RemoteGraphProvider {
  
 +    private static boolean SKIP = false;
 +
 +    private static Set<String> SKIP_TESTS = new HashSet<>(Arrays.asList(
-             "g_injectXg_VX1X_propertiesXnameX_nextX_value"));
++            "g_injectXg_VX1X_propertiesXnameX_nextX_value",
++            "shouldNotHaveAnonymousTraversalMixups"));
 +
 +
 +    @Override
 +    public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName,
 +                                                    final LoadGraphWith.GraphData loadGraphWith) {
 +
 +        final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith);
 +        SKIP = SKIP_TESTS.contains(testMethodName) || SKIP_TESTS.contains(test.getCanonicalName());
 +        return config;
 +    }
 +
      @Override
      public GraphTraversalSource traversal(final Graph graph) {
 -        final GraphTraversalSource g = graph.traversal();
 -        return g.withStrategies(new TranslationStrategy(g, GroovyTranslator.of("g")));
 +        if (SKIP)
 +            return super.traversal(graph);
 +        else {
 +            final GraphTraversalSource g = super.traversal(graph);
 +            return g.withStrategies(new TranslationStrategy(g, GroovyTranslator.of("g")));
 +        }
      }
  }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-test/features/map/PageRank.feature
----------------------------------------------------------------------
diff --cc gremlin-test/features/map/PageRank.feature
index 0000000,bf2ed26..8ead2d4
mode 000000,100644..100644
--- a/gremlin-test/features/map/PageRank.feature
+++ b/gremlin-test/features/map/PageRank.feature
@@@ -1,0 -1,142 +1,132 @@@
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements.  See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership.  The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License.  You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied.  See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+ 
+ Feature: Step - pageRank()
+                 
+   Scenario: g_V_pageRank_hasXpageRankX
+     Given the modern graph
+     And the traversal of
+       """
+       g.withComputer().V().pageRank().has("gremlin.pageRankVertexProgram.pageRank")
+       """
+     When iterated to list
+     Then the result should be unordered
+       | result |
+       | v[marko] |
+       | v[vadas] |
+       | v[lop] |
+       | v[josh] |
+       | v[ripple] |
+       | v[peter] |
+     And the graph should return 6 for count of "g.withComputer().V().pageRank().has(\"gremlin.pageRankVertexProgram.pageRank\")"
+ 
+   Scenario: g_V_outXcreatedX_pageRank_byXbothEX_byXprojectRankX_timesX0X_valueMapXname_projectRankX
+     Given the modern graph
+     And the traversal of
+       """
+       g.withComputer().V().out("created").pageRank().by(__.bothE()).by("projectRank").times(0).valueMap("name", "projectRank")
+       """
+     When iterated to list
+     Then the result should be unordered
+       | result |
+       | m[{"name": ["lop"], "projectRank": [3.0]}] |
+       | m[{"name": ["lop"], "projectRank": [3.0]}] |
+       | m[{"name": ["lop"], "projectRank": [3.0]}] |
+       | m[{"name": ["ripple"], "projectRank": [1.0]}] |
+ 
+   Scenario: g_V_pageRank_order_byXpageRank_decrX_byXnameX_name
+     Given the modern graph
+     And the traversal of
+       """
+       g.withComputer().V().pageRank().order().by("gremlin.pageRankVertexProgram.pageRank", Order.decr).by("name").values("name")
+       """
+     When iterated to list
+     Then the result should be ordered
+       | result |
+       | lop    |
+       | ripple |
+       | josh   |
+       | vadas  |
+       | marko  |
+       | peter  |
+ 
+   Scenario: g_V_pageRank_order_byXpageRank_decrX_name_limitX2X
+     Given the modern graph
+     And the traversal of
+       """
+       g.withComputer().V().pageRank().order().by("gremlin.pageRankVertexProgram.pageRank", Order.decr).values("name").limit(2)
+       """
+     When iterated to list
+     Then the result should be ordered
+       | result |
+       | lop    |
+       | ripple |
+ 
+   Scenario: g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX
+     Given the modern graph
+     And the traversal of
+       """
+       g.withComputer().V().pageRank().by(__.outE("knows")).by("friendRank").valueMap("name", "friendRank")
+       """
+     When iterated to list
+     Then the result should be unordered
+       | result |
 -      | m[{"name": ["marko"], "friendRank": [0.15000000000000002]}] |
 -      | m[{"name": ["vadas"], "friendRank": [0.21375000000000002]}] |
 -      | m[{"name": ["lop"], "friendRank": [0.15000000000000002]}] |
 -      | m[{"name": ["josh"], "friendRank": [0.21375000000000002]}] |
 -      | m[{"name": ["ripple"], "friendRank": [0.15000000000000002]}] |
 -      | m[{"name": ["peter"], "friendRank": [0.15000000000000002]}] |
++      | m[{"name": ["marko"], "friendRank": [0.14598537777608422]}] |
++      | m[{"name": ["vadas"], "friendRank": [0.20802924444783155]}] |
++      | m[{"name": ["lop"], "friendRank": [0.14598537777608422]}] |
++      | m[{"name": ["josh"], "friendRank": [0.20802924444783155]}] |
++      | m[{"name": ["ripple"], "friendRank": [0.14598537777608422]}] |
++      | m[{"name": ["peter"], "friendRank": [0.14598537777608422]}] |
+ 
+   Scenario: g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX
 -    Given the modern graph
 -    And the traversal of
++    Given an unsupported test
++    Then nothing should happen because
+       """
 -      g.withComputer().V().hasLabel("person").pageRank().by("pageRank").order().by("pageRank").valueMap("name", "pageRank")
++      The result is not completely deterministic with respect to the decimals that pageRank() produces and the
++      GLV framework does not have a notion for asserting anything beyond an equals() sort of state.
+       """
 -    When iterated to list
 -    Then the result should be unordered
 -      | result |
 -      | m[{"name": ["marko"], "pageRank": [0.15000000000000002]}] |
 -      | m[{"name": ["vadas"], "pageRank": [0.19250000000000003]}] |
 -      | m[{"name": ["josh"], "pageRank": [0.19250000000000003]}] |
 -      | m[{"name": ["peter"], "pageRank": [0.15000000000000002]}] |
+ 
+   Scenario: g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX
 -    Given the modern graph
 -    And the traversal of
++    Given an unsupported test
++    Then nothing should happen because
+       """
 -      g.withComputer().V().pageRank().by("pageRank").as("a").out("knows").values("pageRank").as("b").select("a", "b")
++      The result is not completely deterministic with respect to the decimals that pageRank() produces and the
++      GLV framework does not have a notion for asserting anything beyond an equals() sort of state.
+       """
 -    When iterated to list
 -    Then the result should be unordered
 -      | result |
 -      | m[{"a": "v[marko]", "b": 0.19250000000000003}] |
 -      | m[{"a": "v[marko]", "b": 0.19250000000000003}] |
+ 
+   Scenario: g_V_hasLabelXsoftwareX_hasXname_rippleX_pageRankX1X_byXinEXcreatedXX_timesX1X_byXpriorsX_inXcreatedX_unionXboth__identityX_valueMapXname_priorsX
+     Given the modern graph
+     And the traversal of
+       """
+       g.withComputer().V().hasLabel("software").has("name", "ripple").pageRank(1.0).by(__.inE("created")).times(1).by("priors").in("created").union(__.both(), __.identity()).valueMap("name", "priors")
+       """
+     When iterated to list
+     Then the result should be unordered
+       | result |
+       | m[{"name": ["josh"], "priors": [1.0]}] |
+       | m[{"name": ["marko"], "priors": [0.0]}] |
+       | m[{"name": ["lop"], "priors": [0.0]}] |
+       | m[{"name": ["ripple"], "priors": [0.0]}] |
+ 
+   Scenario: g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_byXpageRankX_byXinEX_timesX1X_inXcreatedX_groupXmX_byXpageRankX_capXmX()
+     Given an unsupported test
+     Then nothing should happen because
+       """
+       The result returned is not supported under GraphSON 2.x and therefore cannot be properly asserted. More
+       specifically it has long keys which basically get toString()'d under GraphSON 2.x. This test can be supported
+       with GraphSON 3.x.
+       """

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
----------------------------------------------------------------------
diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
index 2861724,c3f4dc2..4749e93
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
@@@ -128,9 -136,7 +136,9 @@@ public abstract class AbstractGremlinPr
  
          for (T t : results) {
              if (t instanceof Map) {
-                 assertThat("Checking map result existence: " + t, expectedResults.stream().filter(e -> e instanceof Map).filter(e -> internalCheckMap((Map) e, (Map) t)).findAny().isPresent(), is(true));
+                 assertThat("Checking map result existence: " + t, expectedResults.stream().filter(e -> e instanceof Map).anyMatch(e -> internalCheckMap((Map) e, (Map) t)), is(true));
 +            } else if (t instanceof List) {
-                 assertThat("Checking list result existence: " + t, expectedResults.stream().filter(e -> e instanceof List).filter(e -> internalCheckList((List) e, (List) t)).findAny().isPresent(), is(true));
++                assertThat("Checking list result existence: " + t, expectedResults.stream().filter(e -> e instanceof List).anyMatch(e -> internalCheckList((List) e, (List) t)), is(true));
              } else {
                  assertThat("Checking result existence: " + t, expectedResults.contains(t), is(true));
              }
@@@ -164,21 -170,9 +172,21 @@@
          }
      }
  
 +    private static <A> boolean internalCheckList(final List<A> expectedList, final List<A> actualList) {
 +        if (expectedList.size() != actualList.size()) {
 +            return false;
 +        }
 +        for (int i = 0; i < actualList.size(); i++) {
 +            if (!actualList.get(i).equals(expectedList.get(i))) {
 +                return false;
 +            }
 +        }
 +        return true;
 +    }
 +
      private static <A, B> boolean internalCheckMap(final Map<A, B> expectedMap, final Map<A, B> actualMap) {
-         final List<Map.Entry<A, B>> actualList = actualMap.entrySet().stream().sorted((a, b) -> a.getKey().toString().compareTo(b.getKey().toString())).collect(Collectors.toList());
-         final List<Map.Entry<A, B>> expectedList = expectedMap.entrySet().stream().sorted((a, b) -> a.getKey().toString().compareTo(b.getKey().toString())).collect(Collectors.toList());
+         final List<Map.Entry<A, B>> actualList = actualMap.entrySet().stream().sorted(Comparator.comparing(a -> a.getKey().toString())).collect(Collectors.toList());
+         final List<Map.Entry<A, B>> expectedList = expectedMap.entrySet().stream().sorted(Comparator.comparing(a -> a.getKey().toString())).collect(Collectors.toList());
  
          if (expectedList.size() != actualList.size()) {
              return false;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
----------------------------------------------------------------------
diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
index 07a2b04,0c0a91d..620d0e3
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PageRankTest.java
@@@ -51,9 -52,9 +52,9 @@@ public abstract class PageRankTest exte
  
      public abstract Traversal<Vertex, Map<String, List<Object>>> get_g_V_outXcreatedX_pageRank_byXbothEX_byXprojectRankX_timesX0X_valueMapXname_projectRankX();
  
-     public abstract Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_descX_name();
 -    public abstract Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_decrX_byXnameX_name();
++    public abstract Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_descX_byXnameX_name();
  
 -    public abstract Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_decrX_name_limitX2X();
 +    public abstract Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_descX_name_limitX2X();
  
      public abstract Traversal<Vertex, Map<String, List<Object>>> get_g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX();
  
@@@ -99,8 -94,8 +94,8 @@@
  
      @Test
      @LoadGraphWith(MODERN)
-     public void g_V_pageRank_order_byXpageRank_descX_name() {
-         final Traversal<Vertex, String> traversal = get_g_V_pageRank_order_byXpageRank_descX_name();
 -    public void g_V_pageRank_order_byXpageRank_decrX_byXnameX_name() {
 -        final Traversal<Vertex, String> traversal = get_g_V_pageRank_order_byXpageRank_decrX_byXnameX_name();
++    public void g_V_pageRank_order_byXpageRank_descX_byXnameX_name() {
++        final Traversal<Vertex, String> traversal = get_g_V_pageRank_order_byXpageRank_descX_byXnameX_name();
          printTraversalForm(traversal);
          final List<String> names = traversal.toList();
          assertEquals(6, names.size());
@@@ -256,8 -251,8 +251,8 @@@
          }
  
          @Override
-         public Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_descX_name() {
-             return g.V().pageRank().order().by(PageRankVertexProgram.PAGE_RANK, Order.desc).values("name");
 -        public Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_decrX_byXnameX_name() {
 -            return g.V().pageRank().order().by(PageRankVertexProgram.PAGE_RANK, Order.decr).by("name").values("name");
++        public Traversal<Vertex, String> get_g_V_pageRank_order_byXpageRank_descX_byXnameX_name() {
++            return g.V().pageRank().order().by(PageRankVertexProgram.PAGE_RANK, Order.desc).by("name").values("name");
          }
  
          @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b12a3fdd/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/PeerPressureTest.java
----------------------------------------------------------------------


[12/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8af78372
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8af78372
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8af78372

Branch: refs/heads/TINKERPOP-2021
Commit: 8af7837286c7eba82c831576a3291c77bfb727e9
Parents: dfe79c2 7fce137
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Aug 1 11:27:04 2018 -0700
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Aug 1 11:27:04 2018 -0700

----------------------------------------------------------------------
 docker/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[41/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a8734684
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a8734684
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a8734684

Branch: refs/heads/TINKERPOP-2021
Commit: a87346840db1ff86e8b899350ffe307449fd4ebd
Parents: 59fc032 b08d0d8
Author: Jorge Bay Gondra <jo...@gmail.com>
Authored: Thu Aug 23 14:50:35 2018 +0200
Committer: Jorge Bay Gondra <jo...@gmail.com>
Committed: Thu Aug 23 14:50:35 2018 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 docs/src/reference/gremlin-variants.asciidoc    |  8 ++
 .../upgrade/release-3.2.x-incubating.asciidoc   |  2 +
 .../main/javascript/gremlin-javascript/index.js |  8 +-
 .../lib/driver/auth/authenticator.js            | 38 ++++++++
 .../auth/mechanisms/sasl-mechanism-base.js      | 52 +++++++++++
 .../auth/mechanisms/sasl-mechanism-plain.js     | 96 ++++++++++++++++++++
 .../auth/plain-text-sasl-authenticator.js       | 55 +++++++++++
 .../lib/driver/auth/sasl-authenticator.js       | 49 ++++++++++
 .../lib/driver/driver-remote-connection.js      | 85 ++++++++++-------
 .../lib/driver/remote-connection.js             |  5 +-
 .../javascript/gremlin-javascript/lib/utils.js  | 23 ++++-
 .../gremlin-javascript/test/helper.js           | 11 +++
 .../integration/sasl-authentication-tests.js    | 63 +++++++++++++
 14 files changed, 461 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8734684/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8734684/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8734684/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8734684/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
----------------------------------------------------------------------
diff --cc gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
index d862882,15836ba..04deee7
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
@@@ -31,9 -30,10 +30,10 @@@ const serializer = require('../structur
  const responseStatusCode = {
    success: 200,
    noContent: 204,
-   partialContent: 206
+   partialContent: 206,
+   authenticationChallenge:  407,
  };
 -const defaultMimeType = 'application/vnd.gremlin-v2.0+json';
 +const defaultMimeType = 'application/vnd.gremlin-v3.0+json';
  
  class DriverRemoteConnection extends RemoteConnection {
    /**


[05/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33

Conflicts:
	docs/src/tutorials/getting-started/index.asciidoc


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/66099fed
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/66099fed
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/66099fed

Branch: refs/heads/TINKERPOP-2021
Commit: 66099fed82e57ef29d1983a5f95725dcd4e5c157
Parents: e55ffc6 dde73e4
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jul 27 07:17:54 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jul 27 07:17:54 2018 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/for-committers.asciidoc    |  2 +-
 docs/src/recipes/between-vertices.asciidoc        |  6 +++---
 docs/src/recipes/collections.asciidoc             | 18 +++++++++---------
 docs/src/recipes/pagination.asciidoc              |  2 +-
 .../recipes/traversal-component-reuse.asciidoc    |  4 ++--
 docs/src/recipes/tree.asciidoc                    |  2 +-
 docs/src/reference/the-traversal.asciidoc         |  2 +-
 docs/src/tutorials/getting-started/index.asciidoc | 10 +++++-----
 .../src/tutorials/gremlins-anatomy/index.asciidoc | 16 ++++++++--------
 .../tutorials/the-gremlin-console/index.asciidoc  |  2 +-
 10 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66099fed/docs/src/dev/developer/for-committers.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66099fed/docs/src/recipes/collections.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66099fed/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/66099fed/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------


[08/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33

Conflicts:
	gremlin-server/src/main/bin/gremlin-server.sh


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/88b6e143
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/88b6e143
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/88b6e143

Branch: refs/heads/TINKERPOP-2021
Commit: 88b6e143dd81134074c17e5fa098f03972514273
Parents: 7985106 2b045f3
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 30 07:16:27 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 30 07:16:27 2018 -0400

----------------------------------------------------------------------
 gremlin-server/src/main/bin/gremlin-server.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/88b6e143/gremlin-server/src/main/bin/gremlin-server.sh
----------------------------------------------------------------------
diff --cc gremlin-server/src/main/bin/gremlin-server.sh
index fec465c,06b065a..a09e10c
--- a/gremlin-server/src/main/bin/gremlin-server.sh
+++ b/gremlin-server/src/main/bin/gremlin-server.sh
@@@ -90,191 -49,14 +90,191 @@@ els
  fi
  
  # Set Java options
 -if [ "$JAVA_OPTIONS" = "" ] ; then
 +if [[ "$JAVA_OPTIONS" = "" ]] ; then
-     JAVA_OPTIONS="-Xms32m -Xmx512m"
+     JAVA_OPTIONS="-Xms512m -Xmx4096m"
  fi
  
 -# Execute the application and return its exit code
 -if [ "$1" = "-i" ]; then
 -  shift
 -  exec $JAVA -Dlog4j.configuration=conf/log4j-server.properties $JAVA_OPTIONS -cp $CP:$CLASSPATH org.apache.tinkerpop.gremlin.server.util.GremlinServerInstall "$@"
 -else
 -  exec $JAVA -Dlog4j.configuration=conf/log4j-server.properties $JAVA_OPTIONS -cp $CP:$CLASSPATH org.apache.tinkerpop.gremlin.server.GremlinServer "$@"
 -fi
 +# Build Java CLASSPATH
 +CP="$GREMLIN_HOME/conf/"
 +CP="$CP":$( echo $GREMLIN_HOME/lib/*.jar . | sed 's/ /:/g')
 +CP="$CP":$( find -L "$GREMLIN_HOME"/ext -mindepth 1 -maxdepth 1 -type d | \
 +        sort | sed 's/$/\/plugin\/*/' | tr '\n' ':' )
 +
 +CLASSPATH="${CLASSPATH:-}:$CP"
 +
 +GREMLIN_SERVER_CMD=org.apache.tinkerpop.gremlin.server.GremlinServer
 +GREMLIN_INSTALL_CMD=org.apache.tinkerpop.gremlin.server.util.GremlinServerInstall
 +
 +
 +isRunning() {
 +  if [[ -r "$PID_FILE" ]] ; then
 +    PID=$(cat "$PID_FILE")
 +    ps -p "$PID" &> /dev/null
 +    return $?
 +  else
 +    return 1
 +  fi
 +}
 +
 +status() {
 +  isRunning
 +  RUNNING=$?
 +    if [[ $RUNNING -gt 0 ]]; then
 +      echo Server not running
 +    else
 +      echo Server running with PID $(cat "$PID_FILE")
 +    fi
 +}
 +
 +stop() {
 +  isRunning
 +  RUNNING=$?
 +  if [[ $RUNNING -gt 0 ]]; then
 +    echo Server not running
 +    rm -f "$PID_FILE"
 +  else
 +    kill "$PID" &> /dev/null || { echo "Unable to kill server [$PID]"; exit 1; }
 +    for i in $(seq 1 60); do
 +      ps -p "$PID" &> /dev/null || { echo "Server stopped [$PID]"; rm -f "$PID_FILE"; return 0; }
 +      [[ $i -eq 30 ]] && kill "$PID" &> /dev/null
 +      sleep 1
 +    done
 +    echo "Unable to kill server [$PID]";
 +    exit 1;
 +  fi
 +}
 +
 +start() {
 +  isRunning
 +  RUNNING=$?
 +  if [[ $RUNNING -eq 0 ]]; then
 +    echo Server already running with PID $(cat "$PID_FILE").
 +    exit 1
 +  fi
 +
 +  if [[ -z "$RUNAS" ]]; then
 +
 +    mkdir -p "$LOG_DIR" &>/dev/null
 +    if [[ ! -d "$LOG_DIR" ]]; then
 +      echo ERROR: LOG_DIR $LOG_DIR does not exist and could not be created.
 +      exit 1
 +    fi
 +
 +    mkdir -p "$PID_DIR" &>/dev/null
 +    if [[ ! -d "$PID_DIR" ]]; then
 +      echo ERROR: PID_DIR $PID_DIR does not exist and could not be created.
 +      exit 1
 +    fi
 +
 +    $JAVA -Dlog4j.configuration=$LOG4J_CONF $JAVA_OPTIONS -cp $CP:$CLASSPATH $GREMLIN_SERVER_CMD "$GREMLIN_YAML" >> "$LOG_FILE" 2>&1 &
 +    PID=$!
 +    disown $PID
 +    echo $PID > "$PID_FILE"
 +  else
 +
 +    su -c "mkdir -p $LOG_DIR &>/dev/null"  "$RUNAS"
 +    if [[ ! -d "$LOG_DIR" ]]; then
 +      echo ERROR: LOG_DIR $LOG_DIR does not exist and could not be created.
 +      exit 1
 +    fi
 +
 +    su -c "mkdir -p $PID_DIR &>/dev/null"  "$RUNAS"
 +    if [[ ! -d "$PID_DIR" ]]; then
 +      echo ERROR: PID_DIR $PID_DIR does not exist and could not be created.
 +      exit 1
 +    fi
 +
 +    su -c "$JAVA -Dlog4j.configuration=$LOG4J_CONF $JAVA_OPTIONS -cp $CP:$CLASSPATH $GREMLIN_SERVER_CMD \"$GREMLIN_YAML\" >> \"$LOG_FILE\" 2>&1 & echo \$! "  "$RUNAS" > "$PID_FILE"
 +    chown "$RUNAS" "$PID_FILE"
 +  fi
 +
 +  isRunning
 +  RUNNING=$?
 +  if [[ $RUNNING -eq 0 ]]; then
 +    echo Server started $(cat "$PID_FILE").
 +    exit 0
 +  else
 +    echo Server failed
 +    exit 1
 +  fi
 +
 +}
 +
 +startForeground() {
 +  isRunning
 +  RUNNING=$?
 +  if [[ $RUNNING -eq 0 ]]; then
 +    echo Server already running with PID $(cat "$PID_FILE").
 +    exit 1
 +  fi
 +
 +  if [[ -z "$RUNAS" ]]; then
 +    $JAVA -Dlog4j.configuration=$LOG4J_CONF $JAVA_OPTIONS -cp $CP:$CLASSPATH $GREMLIN_SERVER_CMD "$GREMLIN_YAML"
 +    exit 0
 +  else
 +    echo Starting in foreground not supported with RUNAS
 +    exit 1
 +  fi
 +
 +}
 +
 +install() {
 +
 +  isRunning
 +  RUNNING=$?
 +  if [[ $RUNNING -eq 0 ]]; then
 +    echo Server must be stopped before installing.
 +    exit 1
 +  fi
 +
 +  echo Installing dependency $@
 +
 +  DEPS="$@"
 +  if [[ -z "$RUNAS" ]]; then
 +    $JAVA -Dlog4j.configuration=$LOG4J_CONF $JAVA_OPTIONS -cp $CP:$CLASSPATH  $GREMLIN_INSTALL_CMD $DEPS
 +  else
 +    su -c "$JAVA -Dlog4j.configuration=$LOG4J_CONF $JAVA_OPTIONS -cp $CP:$CLASSPATH $GREMLIN_INSTALL_CMD $DEPS "  "$RUNAS"
 +  fi
 +
 +}
 +
 +case "$1" in
 +  status)
 +    status
 +    ;;
 +  restart)
 +    stop
 +    start
 +    ;;
 +  start)
 +    start
 +    ;;
 +  stop)
 +    stop
 +    ;;
 +  -i)
 +    shift
 +    echo "Redirecting to 'install $@' (-i will be removed in a future release)"
 +    install "$@"
 +    ;;
 +  install)
 +    shift
 +    install "$@"
 +    ;;
 +  console)
 +    startForeground
 +    ;;
 +  *)
 +    if [[ -n "$1" ]] ; then
 +      if [[ -r "$1" ]]; then
 +        GREMLIN_YAML="$1"
 +        startForeground
 +      elif [[ -r "$GREMLIN_HOME/$1" ]] ; then
 +        GREMLIN_YAML="$GREMLIN_HOME/$1"
 +        startForeground
 +      fi
 +      echo Configuration file not found.
 +    fi
 +    echo "Usage: $0 {start|stop|restart|status|console|install <group> <artifact> <version>|<conf file>}"; exit 1;
 +    ;;
 +esac


[03/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ffb8c3e4
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ffb8c3e4
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ffb8c3e4

Branch: refs/heads/TINKERPOP-2021
Commit: ffb8c3e4e6e8a87d9fea31f2a2f92deb7f809ac5
Parents: 445a8bf 0bd9b5a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jul 26 08:28:33 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 26 08:28:33 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                |  1 +
 .../traversal/dsl/graph/GraphTraversalSource.java | 18 +++++++-----------
 .../dsl/graph/GraphTraversalSourceTest.java       |  9 ++-------
 3 files changed, 10 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ffb8c3e4/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ffb8c3e4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------


[27/50] tinkerpop git commit: TINKERPOP-2023 minor edits

Posted by sp...@apache.org.
TINKERPOP-2023 minor edits


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6434d040
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6434d040
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6434d040

Branch: refs/heads/TINKERPOP-2021
Commit: 6434d0406c13ca2b5315fbfd0ff1c7b49c2fddfe
Parents: d05e3c5
Author: Robert Dale <ro...@gmail.com>
Authored: Mon Aug 13 15:45:27 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Aug 17 15:06:33 2018 -0400

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc   | 4 ++--
 docs/src/upgrade/release-3.2.x-incubating.asciidoc | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6434d040/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 8ad8a0a..d13e2ef 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -751,7 +751,7 @@ The following table describes the various configuration options for the Gremlin
 |connectionPool.sslCipherSuites |The list of JSSE ciphers to support for SSL connections. If specified, only the ciphers that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
 |connectionPool.sslEnabledProtocols |The list of SSL protocols to support for SSL connections. If specified, only the protocols that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
 |connectionPool.sslSkipCertValidation |Configures the `TrustManager` to trust all certs without any validation. Should not be used in production.|false
-|connectionPool.trustCertChainFile |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be uesd. |_none_
+|connectionPool.trustCertChainFile |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
 |connectionPool.trustStore |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
 |connectionPool.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_
 |hosts |The list of hosts that the driver will connect to. |localhost
@@ -1161,7 +1161,7 @@ The following table describes the various configuration options that Gremlin Ser
 |ssl.keyPassword |The password of the `keyFile` if it is password-protected. |_none_
 |ssl.keyStore |The private key in JKS or PKCS#12 format.  |_none_
 |ssl.keyStorePassword |The password of the `keyStore` if it is password-protected. |_none_
-|ssl.keyStoreType |JKS (Java 8 default) or PKCS#12 (Java 9+ default) |_none_
+|ssl.keyStoreType |`JKS` (Java 8 default) or `PKCS12` (Java 9+ default) |_none_
 |ssl.needClientAuth | Optional. One of NONE, OPTIONAL, REQUIRE.  Enables client certificate authentication at the enforcement level specified. Can be used in combination with Authenticator. |_none_
 |ssl.sslCipherSuites |The list of JSSE ciphers to support for SSL connections. If specified, only the ciphers that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
 |ssl.sslEnabledProtocols |The list of SSL protocols to support for SSL connections. If specified, only the protocols that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6434d040/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 9b0a120..ec973de 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -49,7 +49,8 @@ The packaged `*-secure.yaml` files now restrict the protocol to `TLSv1.2` by def
 
 PEM-based configurations are deprecated and may be removed in a future release.
 
-See the section on configuring SSL.
+See also http://tinkerpop.apache.org/docs/current/reference/#_configuration[Connecting via Java Configuration],
+http://tinkerpop.apache.org/docs/current/reference/#_configuring_2[Gremlin Server Configuration].
 
 link:https://issues.apache.org/jira/browse/TINKERPOP-2022[TINKERPOP-2022]
 link:https://issues.apache.org/jira/browse/TINKERPOP-2023[TINKERPOP-2023]


[33/50] tinkerpop git commit: TINKERPOP-2023 updated docs with creating self-signed cert, incorrect ssl configuration will prevent server from starting removed OPTIONAL from needClientAuth

Posted by sp...@apache.org.
TINKERPOP-2023 updated docs with creating self-signed cert,
incorrect ssl configuration will prevent server from starting
removed OPTIONAL from needClientAuth


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b77c0c7b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b77c0c7b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b77c0c7b

Branch: refs/heads/TINKERPOP-2021
Commit: b77c0c7b55866bbbddd8d721142118b53fcfe154
Parents: bbc0265
Author: Robert Dale <ro...@gmail.com>
Authored: Fri Aug 17 17:35:41 2018 -0400
Committer: Robert Dale <ro...@gmail.com>
Committed: Fri Aug 17 17:35:41 2018 -0400

----------------------------------------------------------------------
 .../src/reference/gremlin-applications.asciidoc | 59 ++++++++++++++++----
 .../gremlin/server/AbstractChannelizer.java     | 16 ++++--
 2 files changed, 60 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b77c0c7b/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 8372a8a..1cd9964 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1155,10 +1155,10 @@ The following table describes the various configuration options that Gremlin Ser
 |ssl.keyStore |The private key in JKS or PKCS#12 format.  |_none_
 |ssl.keyStorePassword |The password of the `keyStore` if it is password-protected. |_none_
 |ssl.keyStoreType |`JKS` (Java 8 default) or `PKCS12` (Java 9+ default) |_none_
-|ssl.needClientAuth | Optional. One of NONE, OPTIONAL, REQUIRE.  Enables client certificate authentication at the enforcement level specified. Can be used in combination with Authenticator. |_none_
+|ssl.needClientAuth | Optional. One of NONE, REQUIRE.  Enables client certificate authentication at the enforcement level specified. Can be used in combination with Authenticator. |_none_
 |ssl.sslCipherSuites |The list of JSSE ciphers to support for SSL connections. If specified, only the ciphers that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
 |ssl.sslEnabledProtocols |The list of SSL protocols to support for SSL connections. If specified, only the protocols that are listed and supported will be enabled. If not specified, the JVM default is used.  |_none_
-|ssl.trustStore |Required when needClientAuth is OPTIONAL or REQUIRE. Trusted certificates for verifying the remote endpoint's certificate. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
+|ssl.trustStore |Required when needClientAuth is REQUIRE. Trusted certificates for verifying the remote endpoint's certificate. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_
 |ssl.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_
 |strictTransactionManagement |Set to `true` to require `aliases` to be submitted on every requests, where the `aliases` become the scope of transaction management. |false
 |threadPoolBoss |The number of threads available to Gremlin Server for accepting connections. Should always be set to `1`. |1
@@ -1249,7 +1249,47 @@ authentication: {
 ===== Quick Start
 
 A quick way to get started with the `SimpleAuthenticator` is to use TinkerGraph for the "credentials graph" and the
-"sample" credential graph that is packaged with the server.
+"sample" credential graph that is packaged with the server.  To secure the transport for the credentials,
+SSL should be enabled. For this Quick Start, a self-signed certificate will be created but this should not
+be used in a production environment.
+
+Generate the self-signed SSL certificate:
+
+[source,text]
+----
+$ keytool -genkey -alias localhost -keyalg RSA -keystore server.jks
+Enter keystore password:
+Re-enter new password:
+What is your first and last name?
+  [Unknown]:  localhost
+What is the name of your organizational unit?
+  [Unknown]:
+What is the name of your organization?
+  [Unknown]:
+What is the name of your City or Locality?
+  [Unknown]:
+What is the name of your State or Province?
+  [Unknown]:
+What is the two-letter country code for this unit?
+  [Unknown]:
+Is CN=localhost, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
+  [no]:  yes
+
+Enter key password for <localhost>
+	(RETURN if same as keystore password):
+----
+
+Next, uncomment the `keyStore` and `keyStorePassword` lines in `conf/gremlin-server-secure.yaml`.
+
+[source,yaml]
+----
+ssl: {
+  enabled: true,
+  sslEnabledProtocols: [TLSv1.2],
+  keyStore: server.jks,
+  keyStorePassword: changeit
+}
+----
 
 [source,text]
 ----
@@ -1261,7 +1301,6 @@ $ bin/gremlin-server.sh conf/gremlin-server-secure.yaml
 
 [INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-secure.yaml
 ...
-[WARN] AbstractChannelizer - Enabling SSL with self-signed certificate (NOT SUITABLE FOR PRODUCTION)
 [INFO] AbstractChannelizer - SSL enabled
 [INFO] SimpleAuthenticator - Initializing authentication with the org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator
 [INFO] SimpleAuthenticator - CredentialGraph initialized at CredentialGraph{graph=tinkergraph[vertices:1 edges:0]}
@@ -1269,19 +1308,18 @@ $ bin/gremlin-server.sh conf/gremlin-server-secure.yaml
 [INFO] GremlinServer$1 - Channel started at port 8182.
 ----
 
-In addition to configuring the authenticator, `gremlin-server-secure.yaml` also enables SSL with a self-signed
-certificate.  As SSL is enabled on the server it must also be enabled on the client when connecting.  To connect to
-Gremlin Server with `gremlin-driver`, set the `credentials` and `enableSsl` when constructing the `Cluster`.
+As SSL is enabled on the server it must also be enabled on the client when connecting.  To connect to
+Gremlin Server with `gremlin-driver`, set the `credentials`, `enableSsl`, and `trustStore` when constructing the `Cluster`.
 
 [source,java]
 Cluster cluster = Cluster.build().credentials("stephen", "password")
-                                 .enableSsl(true).create();
+                                 .enableSsl(true).trustStore("server.jks").create();
 
 If connecting with Gremlin Console, which utilizes `gremlin-driver` for remote script execution, use the provided
 `conf/remote-secure.yaml` file when defining the remote.  That file contains configuration for the username and
-password as well as enablement of SSL from the client side.
+password as well as enablement of SSL from the client side. Be sure to configure the trustStore if using self-signed certificates.
 
-Similarly, Gremlin Server can be configured for REST and security.
+Similarly, Gremlin Server can be configured for REST and security. Follow the steps above for configuring the SSL certificate.
 
 [source,text]
 ----
@@ -1293,7 +1331,6 @@ $ bin/gremlin-server.sh conf/gremlin-server-rest-secure.yaml
 
 [INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-secure.yaml
 ...
-[WARN] AbstractChannelizer - Enabling SSL with self-signed certificate (NOT SUITABLE FOR PRODUCTION)
 [INFO] AbstractChannelizer - SSL enabled
 [INFO] SimpleAuthenticator - Initializing authentication with the org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator
 [INFO] SimpleAuthenticator - CredentialGraph initialized at CredentialGraph{graph=tinkergraph[vertices:1 edges:0]}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b77c0c7b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index 2a29fec..d7f3ec1 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.server;
 
 import io.netty.channel.EventLoopGroup;
+import io.netty.handler.ssl.ClientAuth;
 import io.netty.handler.ssl.SslContext;
 import io.netty.handler.ssl.SslContextBuilder;
 import io.netty.handler.ssl.SslProvider;
@@ -305,6 +306,8 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
                         keystore.load(in, password);
                     }
                     kmf.init(keystore, password);
+                } else {
+                    throw new IllegalStateException("keyStore must be configured when SSL is enabled.");
                 }
 
                 builder = SslContextBuilder.forServer(kmf);
@@ -323,8 +326,8 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
                 }
 
             } catch (UnrecoverableKeyException | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e) {
-                logger.error("There was an error enabling SSL.", e);
-                return null;
+                logger.error(e.getMessage());
+                throw new RuntimeException("There was an error enabling SSL.", e);
             }
 
         }
@@ -336,14 +339,19 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
         if (null != sslSettings.sslEnabledProtocols && !sslSettings.sslEnabledProtocols.isEmpty()) {
             builder.protocols(sslSettings.sslEnabledProtocols.toArray(new String[] {}));
         }
+        
+        if (null != sslSettings.needClientAuth && ClientAuth.OPTIONAL == sslSettings.needClientAuth) {
+            logger.warn("needClientAuth = OPTIONAL is not a secure configuration. Setting to REQUIRE.");
+            sslSettings.needClientAuth = ClientAuth.REQUIRE;
+        }
 
         builder.clientAuth(sslSettings.needClientAuth).sslProvider(provider);
 
         try {
             return builder.build();
         } catch (SSLException ssle) {
-            logger.error("There was an error enabling SSL", ssle);
-            return null;
+            logger.error(ssle.getMessage());
+            throw new RuntimeException("There was an error enabling SSL.", ssle);
         }
     }
 }


[38/50] tinkerpop git commit: Merge branch 'pr-918' into tp33

Posted by sp...@apache.org.
Merge branch 'pr-918' into tp33


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a8931d58
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a8931d58
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a8931d58

Branch: refs/heads/TINKERPOP-2021
Commit: a8931d581c26d355b92285400239ec588246bd4f
Parents: b34515a 6efd47d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Aug 22 16:16:54 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Aug 22 16:16:54 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/util/TinkerGraphProvider.java     |  2 +-
 .../apache/tinkerpop/gremlin/AbstractGremlinTest.java   |  5 +++--
 .../org/apache/tinkerpop/gremlin/GraphProvider.java     | 12 +++++++++---
 .../gremlin/neo4j/AbstractNeo4jGraphProvider.java       |  2 +-
 .../gremlin/tinkergraph/TinkerGraphProvider.java        |  2 +-
 5 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------