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 2021/03/02 16:10:14 UTC
[tinkerpop] branch master updated (99ac89a -> 9a123f7)
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.
from 99ac89a Merge branch '3.4-dev'
add 09d0254 Allow users to set ssl_options in gremlin-python.CTR
add b1a710c Changed "secure" tests to use TLS CTR
new 9a123f7 Merge branch '3.4-dev'
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGELOG.asciidoc | 1 +
.../Driver/GremlinClientAuthenticationTests.cs | 46 +++++++++++++++++++---
.../javascript/gremlin-javascript/test/helper.js | 2 +-
.../gremlin_python/driver/tornado/transport.py | 8 ++--
gremlin-python/src/main/python/tests/conftest.py | 16 ++++++--
.../src/test/scripts/test-server-start.groovy | 5 +++
6 files changed, 65 insertions(+), 13 deletions(-)
[tinkerpop] 01/01: Merge branch '3.4-dev'
Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 9a123f70e2d634af3d3f810e01b87fb5131a0f19
Merge: 99ac89a b1a710c
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Tue Mar 2 11:09:45 2021 -0500
Merge branch '3.4-dev'
CHANGELOG.asciidoc | 1 +
.../Driver/GremlinClientAuthenticationTests.cs | 46 +++++++++++++++++++---
.../javascript/gremlin-javascript/test/helper.js | 2 +-
.../gremlin_python/driver/tornado/transport.py | 8 ++--
gremlin-python/src/main/python/tests/conftest.py | 16 ++++++--
.../src/test/scripts/test-server-start.groovy | 5 +++
6 files changed, 65 insertions(+), 13 deletions(-)
diff --cc gremlin-python/src/main/python/tests/conftest.py
index a5bbbcc,0000000..b277b1c
mode 100644,000000..100644
--- a/gremlin-python/src/main/python/tests/conftest.py
+++ b/gremlin-python/src/main/python/tests/conftest.py
@@@ -1,166 -1,0 +1,176 @@@
+#
+# 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.
+#
+
+import concurrent.futures
++import ssl
+import pytest
++import sys
+import socket
+
+from six.moves import queue
+
+from gremlin_python.driver.client import Client
+from gremlin_python.driver.connection import Connection
+from gremlin_python.driver import serializer
+from gremlin_python.driver.driver_remote_connection import (
+ DriverRemoteConnection)
+from gremlin_python.driver.protocol import GremlinServerWSProtocol
+from gremlin_python.driver.serializer import (
+ GraphSONMessageSerializer, GraphSONSerializersV2d0, GraphSONSerializersV3d0,
+ GraphBinarySerializersV1)
+from gremlin_python.driver.tornado.transport import TornadoTransport
+
+gremlin_server_url = 'ws://localhost:{}/gremlin'
+anonymous_url = gremlin_server_url.format(45940)
- basic_url = gremlin_server_url.format(45941)
++basic_url = 'wss://localhost:{}/gremlin'.format(45941)
+kerberos_url = gremlin_server_url.format(45942)
+kerberized_service = 'test-service@{}'.format(socket.gethostname())
+
+
+@pytest.fixture
+def connection(request):
+ protocol = GremlinServerWSProtocol(
+ GraphSONMessageSerializer(),
+ username='stephen', password='password')
+ executor = concurrent.futures.ThreadPoolExecutor(5)
+ pool = queue.Queue()
+ try:
+ conn = Connection(anonymous_url, 'gmodern', protocol,
+ lambda: TornadoTransport(), executor, pool)
+ except OSError:
+ executor.shutdown()
+ pytest.skip('Gremlin Server is not running')
+ else:
+ def fin():
+ executor.shutdown()
+ conn.close()
+ request.addfinalizer(fin)
+ return conn
+
+
+@pytest.fixture
+def client(request):
+ try:
+ client = Client(anonymous_url, 'gmodern')
+ except OSError:
+ pytest.skip('Gremlin Server is not running')
+ else:
+ def fin():
+ client.close()
+ request.addfinalizer(fin)
+ return client
+
+
+@pytest.fixture(params=['basic', 'kerberos'])
+def authenticated_client(request):
+ try:
+ if request.param == 'basic':
- client = Client(basic_url, 'gmodern', username='stephen', password='password')
++ # turn off certificate verification for testing purposes only
++ ssl_opts = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
++ ssl_opts.verify_mode = ssl.CERT_NONE
++ client = Client(basic_url, 'gmodern', username='stephen', password='password',
++ transport_factory=lambda: TornadoTransport(ssl_options=ssl_opts))
+ elif request.param == 'kerberos':
+ client = Client(kerberos_url, 'gmodern', kerberized_service=kerberized_service)
+ else:
+ raise ValueError("Invalid authentication option - " + request.param)
+ except OSError:
+ pytest.skip('Gremlin Server is not running')
+ else:
+ def fin():
+ client.close()
+ request.addfinalizer(fin)
+ return client
+
+
+@pytest.fixture(params=['graphsonv2', 'graphsonv3', 'graphbinaryv1'])
+def remote_connection(request):
+ try:
+ if request.param == 'graphbinaryv1':
+ remote_conn = DriverRemoteConnection(anonymous_url, 'gmodern',
+ message_serializer=serializer.GraphBinarySerializersV1())
+ elif request.param == 'graphsonv2':
+ remote_conn = DriverRemoteConnection(anonymous_url, 'gmodern',
+ message_serializer=serializer.GraphSONSerializersV2d0())
+ elif request.param == 'graphsonv3':
+ remote_conn = DriverRemoteConnection(anonymous_url, 'gmodern',
+ message_serializer=serializer.GraphSONSerializersV3d0())
+ else:
+ raise ValueError("Invalid serializer option - " + request.param)
+ except OSError:
+ pytest.skip('Gremlin Server is not running')
+ else:
+ def fin():
+ remote_conn.close()
+ request.addfinalizer(fin)
+ return remote_conn
+
+
+@pytest.fixture(params=['basic', 'kerberos'])
+def remote_connection_authenticated(request):
+ try:
+ if request.param == 'basic':
++ # turn off certificate verification for testing purposes only
++ ssl_opts = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
++ ssl_opts.verify_mode = ssl.CERT_NONE
+ remote_conn = DriverRemoteConnection(basic_url, 'gmodern',
+ username='stephen', password='password',
- message_serializer=serializer.GraphSONSerializersV2d0())
++ message_serializer=serializer.GraphSONSerializersV2d0(),
++ transport_factory=lambda: TornadoTransport(ssl_options=ssl_opts))
+ elif request.param == 'kerberos':
+ remote_conn = DriverRemoteConnection(kerberos_url, 'gmodern', kerberized_service=kerberized_service,
+ message_serializer=serializer.GraphSONSerializersV2d0())
+ else:
+ raise ValueError("Invalid authentication option - " + request.param)
+ except OSError:
+ pytest.skip('Gremlin Server is not running')
+ else:
+ def fin():
+ remote_conn.close()
+ request.addfinalizer(fin)
+ return remote_conn
+
+
+@pytest.fixture
+def remote_connection_graphsonV2(request):
+ try:
+ remote_conn = DriverRemoteConnection(anonymous_url, 'g',
+ message_serializer=serializer.GraphSONSerializersV2d0())
+ except OSError:
+ pytest.skip('Gremlin Server is not running')
+ else:
+ def fin():
+ remote_conn.close()
+ request.addfinalizer(fin)
+ return remote_conn
+
+
+@pytest.fixture
+def graphson_serializer_v2(request):
+ return GraphSONSerializersV2d0()
+
+
+@pytest.fixture
+def graphson_serializer_v3(request):
+ return GraphSONSerializersV3d0()
+
+
+@pytest.fixture
+def graphbinary_serializer_v1(request):
+ return GraphBinarySerializersV1()