[ 
https://issues.apache.org/jira/browse/TINKERPOP3-950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15003353#comment-15003353
 ] 

stephen mallette commented on TINKERPOP3-950:
---------------------------------------------

I don't think this is an issue and is expected behavior.  I don't know why I 
didn't notice it before.  Using the {{conf/gremlin-server-secure.yaml}} config 
does a lot more than just turn on authentication.  It also "sandboxes" the 
{{ScriptEngine}} and puts it in {{CompileStatic}} mode.  That's why you have to 
define your variables as groovy is effectively type checked under this mode of 
execution.  

See the "Script Execution" section here:

http://tinkerpop.incubator.apache.org/docs/3.0.2-incubating/#_security

for more info.  [~pluradj] was already saying that this was the problem in the 
mailing list thread - again, not sure why it didn't register with me.

[~davebshow] you can test things out if you remove the {{ScriptEngine}} configs 
from your server yaml file:

https://github.com/apache/incubator-tinkerpop/blob/cbbf9789b959d5dec3911dccf8c1de81ab6ee9dd/gremlin-server/conf/gremlin-server-secure.yaml#L42-L46

I have a feeling that will solve your problem.  

> SASL and in session requests fail to set/recognize bindings
> -----------------------------------------------------------
>
>                 Key: TINKERPOP3-950
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-950
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.0.2-incubating
>            Reporter: Dylan Millikin
>            Assignee: stephen mallette
>
> We aren't entirely sure where the issue lies, once it becomes clearer I'll 
> change the title.
> The discussion around this issue can be found here : 
> https://pony-poc.apache.org/thread.html/4402fe28badece112e51cf7d369844f8da3f382d3ce1ffb7666ed0bf@1446656912@%3Cdev.tinkerpop.apache.org%3E
> In essence, when queries against gremlin-server are made using authentication 
> in-session a couple of weird behaviors can be noticed:
> - Variables need to be properly defined via {{def v = ...}} or we will get an 
> exception.
> - Variables set within queries aren't available in the following queries
> Bellow is an example of payloads that recreate this error:
> {code}
> Message : 
> b'\x10application/json{"requestId":"1afa7873-df64-43a1-82a2-4aaa3cc35d82","processor":"session","args":{"bindings":null,"language":"gremlin-groovy","session":"e4deb7ef-c551-49bc-896d-089dba9cb5e6","gremlin":"v=graph.addVertex(\'name\',
>  \'Dave\')","rebindings":{}},"op":"eval"}' 
> Response: 
> {'status': {'message': '', 'code': 407, 'attributes': {}}, 'requestId': 
> '1afa7873-df64-43a1-82a2-4aaa3cc35d82', 'result': {'meta': {}, 'data': None}} 
>  
> Message: 
> b'\x10application/json{"requestId":"78e3e4e1-08d9-4222-a57a-3fd07180d974","processor":"","args":{"sasl":"AHN0ZXBoZW4AcGFzc3dvcmQ="},"op":"authentication"}'
>    
> Response: 
> {'status': {'message': "startup failed:\nScript2.groovy: 1: [Static type 
> checking] - The variable [v] is undeclared.\n @ line 1, column 1.\n 
> v=graph.addVertex('name', 'Dave')\n ^\n\n1 error\n", 'code': 597, 
> 'attributes': {}}, 'requestId': '1afa7873-df64-43a1-82a2-4aaa3cc35d82', 
> 'result': {'meta': {}, 'data': None}}
> {code}
> It's worth noting that this same scenario seems to work when using 
> gremlin-driver as per these tests : 
> https://github.com/apache/incubator-tinkerpop/commit/4cb087d039990f643494146e48ab95264cc99805
> First step will probably be to reproduce this with the "simple" client.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to