为什么不能使用 GraphSON 序列化程序将 DSE 身份验证与 Gremlin 服务器一起使用?
Why isn't it possible to use DSE Authentication with Gremlin Server using the GraphSON serializer?
我正在尝试在使用 DSE 身份验证的 DSE 实例上将 GraphSON 序列化程序与 gremlin 服务器一起使用。基于 TinkerPop provider docs,收到 407
结果后,将通过发送以下请求(前面是 application/json
mime header)来实现身份验证:
{
"requestId":"2c8ecdca-07bf-48f2-b0df-2ed26c2ce778",
"op":"authentication",
"processor":"",
"args":{
"sasl":"AHVzZXJuYW1lAHBhc3N3b3Jk",
"saslMechanism":"PLAIN"
}
}
其中 "sasl"
的值是 <ASCII_NUL><USERNAME><ASCII_NUL><PASSWORD>
的 base64 编码字符串。上面的示例使用凭据 username
、password
.
我可以使用来自 tinkerpop.apache.org 的上游 gremlin-server 包和 gremlin-server-secure.yaml
配置确认此身份验证请求成功。但是,当尝试对启用了 DSE 身份验证的 DSE Graph 实例进行身份验证时,相同的请求会失败。发生这种情况时,服务器会记录以下异常:
WARN [gremlin-server-worker-1] 2016-11-01 12:37:40,284 Slf4JLogger.java:151 - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.ClassCastException: java.lang.String cannot be cast to [B
at com.datastax.bdp.graph.plugin.GremlinServerAuthenticationHandler.handleRequestMessage(GremlinServerAuthenticationHandler.java:67) ~[dse-graph-5.0.3.jar:5.0.3]
at com.datastax.bdp.graph.plugin.AbstractRequestMessageHandler.channelRead(AbstractRequestMessageHandler.java:62) [dse-graph-5.0.3.jar:5.0.3]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at com.datastax.bdp.cassandra.audit.GremlinServerAuditLogRequestHandler.handleRequestMessage(GremlinServerAuditLogRequestHandler.java:32) [dse-graph-5.0.3.jar:5.0.3]
at com.datastax.bdp.graph.plugin.AbstractRequestMessageHandler.channelRead(AbstractRequestMessageHandler.java:62) [dse-graph-5.0.3.jar:5.0.3]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler.channelRead(WebSocketServerProtocolHandler.java:147) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:840) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:112) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
我在处理 Goblin 的 DSE 支持时遇到了这个问题,但是这个问题可以通过 gremlin-console 重现,方法是使用以下 remote.yaml
:
hosts: [127.0.0.1]
port: 8182
username: username
password: password
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistry] }}
connectionPool: {
maxContentLength: 65536000
}
这看起来像是一个一直存在的错误(5.0.4 和更早版本),尽管它更像是 DSE Graph 中的身份验证逻辑与 TinkerPop 逻辑有点不同。 TinkerPop 支持将 sasl
字段作为字节数组或字符串传递,但 DSE Graph 似乎只支持字节数组。我认为 5.0.5 的修复程序已经准备就绪。
我正在尝试在使用 DSE 身份验证的 DSE 实例上将 GraphSON 序列化程序与 gremlin 服务器一起使用。基于 TinkerPop provider docs,收到 407
结果后,将通过发送以下请求(前面是 application/json
mime header)来实现身份验证:
{
"requestId":"2c8ecdca-07bf-48f2-b0df-2ed26c2ce778",
"op":"authentication",
"processor":"",
"args":{
"sasl":"AHVzZXJuYW1lAHBhc3N3b3Jk",
"saslMechanism":"PLAIN"
}
}
其中 "sasl"
的值是 <ASCII_NUL><USERNAME><ASCII_NUL><PASSWORD>
的 base64 编码字符串。上面的示例使用凭据 username
、password
.
我可以使用来自 tinkerpop.apache.org 的上游 gremlin-server 包和 gremlin-server-secure.yaml
配置确认此身份验证请求成功。但是,当尝试对启用了 DSE 身份验证的 DSE Graph 实例进行身份验证时,相同的请求会失败。发生这种情况时,服务器会记录以下异常:
WARN [gremlin-server-worker-1] 2016-11-01 12:37:40,284 Slf4JLogger.java:151 - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.ClassCastException: java.lang.String cannot be cast to [B
at com.datastax.bdp.graph.plugin.GremlinServerAuthenticationHandler.handleRequestMessage(GremlinServerAuthenticationHandler.java:67) ~[dse-graph-5.0.3.jar:5.0.3]
at com.datastax.bdp.graph.plugin.AbstractRequestMessageHandler.channelRead(AbstractRequestMessageHandler.java:62) [dse-graph-5.0.3.jar:5.0.3]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at com.datastax.bdp.cassandra.audit.GremlinServerAuditLogRequestHandler.handleRequestMessage(GremlinServerAuditLogRequestHandler.java:32) [dse-graph-5.0.3.jar:5.0.3]
at com.datastax.bdp.graph.plugin.AbstractRequestMessageHandler.channelRead(AbstractRequestMessageHandler.java:62) [dse-graph-5.0.3.jar:5.0.3]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler.channelRead(WebSocketServerProtocolHandler.java:147) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:840) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:112) [netty-all-4.0.34.Final.jar:4.0.34.Final]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
我在处理 Goblin 的 DSE 支持时遇到了这个问题,但是这个问题可以通过 gremlin-console 重现,方法是使用以下 remote.yaml
:
hosts: [127.0.0.1]
port: 8182
username: username
password: password
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistry] }}
connectionPool: {
maxContentLength: 65536000
}
这看起来像是一个一直存在的错误(5.0.4 和更早版本),尽管它更像是 DSE Graph 中的身份验证逻辑与 TinkerPop 逻辑有点不同。 TinkerPop 支持将 sasl
字段作为字节数组或字符串传递,但 DSE Graph 似乎只支持字节数组。我认为 5.0.5 的修复程序已经准备就绪。