You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by FlorianHockmann <gi...@git.apache.org> on 2018/09/09 13:32:54 UTC

[GitHub] tinkerpop pull request #928: TINKERPOP-2015 Expose WebSocket configuration i...

GitHub user FlorianHockmann opened a pull request:

    https://github.com/apache/tinkerpop/pull/928

    TINKERPOP-2015 Expose WebSocket configuration in Gremlin.Net driver

    https://issues.apache.org/jira/browse/TINKERPOP-2015
    
    Users can now provide a delegate to the Gremlin.Net driver that will be used to configure WebSocket connections. Using a delegate for this has the advantage that it's extensible as the options available via [`ClientWebSocketOptions`](https://docs.microsoft.com/dotnet/api/system.net.websockets.clientwebsocketoptions) change between different .NET implementations, e.g., as mentioned in the ticket, a `RemoteCertificateValidationCallback` was added with .NET Core 2.1.
    
    When #903 is merged first, then we need to add this new option also to the docs when merging this into `master` as #903 adds descriptions for the config options to the docs.
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-2015

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/928.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #928
    
----
commit 828b0503e4d0f0a9b21f89158bbef31de20ffa3a
Author: Florian Hockmann <fh...@...>
Date:   2018-09-09T12:49:03Z

    Expose WebSocket configuration TINKERPOP-2015
    
    Users can now provide a delegate to the Gremlin.Net driver that will be
    used to configure WebSocket connections.

----


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by jantzeca <gi...@git.apache.org>.
Github user jantzeca commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    My latest Gremlin.net NuGet package is showing as 3.3.3. Is the package for these new changes not ready yet?


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by deejvince <gi...@git.apache.org>.
Github user deejvince commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    @FlorianHockmann
    
    Could you please post a working example on how to use the delegate with the driver connection with GremlinClient?


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by jantzeca <gi...@git.apache.org>.
Github user jantzeca commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    @spmallette Okay, thank you!


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by FlorianHockmann <gi...@git.apache.org>.
Github user FlorianHockmann commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    Yes, that should be possible. With this PR, you can provide a delegate to configure the ClientWebSocketOptions which should also include custom headers. 


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by Pede23 <gi...@git.apache.org>.
Github user Pede23 commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    I need this merged so I add authentication headers to my gremlin requests! I'm sure this will be extremely useful to anyone else trying to encrypt their connection with Amazon Neptune.
    
    VOTE +1


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    Hm, alright. I don't have an environment to test it myself, but apparently I'm missing something; I thought it would be a simple property delegation.
    
    VOTE +1


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    IMO it would be better to expose the options as a property unless there's a good reason to not allow any changes in options after the client has been initialized. But since the underlying `ClientWebSocket` allows a change in options at any point in time, `GremlinClient` should preferably do the same.


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    @jantzeca this merged a day or so ago.  it has not been released yet to nuget. we have releases scheduled for 3.2.10 and 3.3.4 in the next couple of weeks. it will be available then.


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by FlorianHockmann <gi...@git.apache.org>.
Github user FlorianHockmann commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    @deejvince: Did you see [the integration test](https://github.com/apache/tinkerpop/blob/master/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/GremlinClientTests.cs#L233) added with this PR?
    
    The relevant part is basically this:
    ```cs
    var webSocketConfiguration =
                    new Action<ClientWebSocketOptions>(options =>
                    {
                        options.UseDefaultCredentials = false;
                        options.KeepAliveInterval = TimeSpan.FromMilliseconds(11);
                    });
    var gremlinClient = new GremlinClient(gremlinServer,
                    webSocketConfiguration: webSocketConfiguration);
    ```
    
    The `Action` you provide will be called for every `ClientWebSocket` created by the driver of Gremlin.Net.
    
    I haven't tested that specifically, but it should also be possible to set a request header like this:
    ```cs
    var webSocketConfiguration =
                    new Action<ClientWebSocketOptions>(options =>
                    {
                        options.SetRequestHeader("Authorization", "Bearer " + token);
                    });
    ```
    
    Please report back if that doesn't work.


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by FlorianHockmann <gi...@git.apache.org>.
Github user FlorianHockmann commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    I also wanted to implement it like that as first, but unfortunately the [`ClientWebSocket.Options` property](https://docs.microsoft.com/dotnet/api/system.net.websockets.clientwebsocket.options) only has a `get`, but no `set`. So, we have no way to provide our own `ClientWebSocketOptions` object. I also don't see how we could forward changes to the `ClientWebSocketOptions` of every already created connection.


---

[GitHub] tinkerpop issue #928: TINKERPOP-2015 Expose WebSocket configuration in Greml...

Posted by deejvince <gi...@git.apache.org>.
Github user deejvince commented on the issue:

    https://github.com/apache/tinkerpop/pull/928
  
    @FlorianHockmann this PR should enable  setting custom headers on the WebSocket, right? 
    
    like:
    Options.SetRequestHeader("Authorization", "Bearer " + token);
    
    Thank you,
    DjV


---

[GitHub] tinkerpop pull request #928: TINKERPOP-2015 Expose WebSocket configuration i...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/tinkerpop/pull/928


---