forked from krishkg/gremlin-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for SASL (revisiting PR jbmusso#78) (jbmusso#83)
* SSL and SASL support. * Updating README to show how to use SASL Authentication. * Update, adding user and password to options list. Additionally, updating SASL auth example to remove session option, and adding ssl option. * Changed ordering of options. * -Moved utf8 importing to the top, to avoid reloading each time. (Also changed the pattern to follow standard javascript importing) -Added an example for gremlin client with SASL. (username and pwd have to be set accordingly based on your gremlin server)
- Loading branch information
Showing
4 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
var gremlin = require('../src'); | ||
|
||
var client = gremlin.createClient(51549, 'localhost', { | ||
session: false, | ||
ssl:true, | ||
user:'username', | ||
password:'password' }); | ||
|
||
var script = 'g.V()'; | ||
|
||
// Callback style | ||
client.execute(script, function(err, res) { | ||
console.log(err, res); | ||
}); | ||
|
||
// Stream style | ||
var s = client.stream(script); | ||
|
||
s.on('data', function(result) { | ||
console.log(result); | ||
}); | ||
|
||
s.on('end', function() { | ||
console.log("All results fetched"); | ||
}); | ||
|
||
s.on('error', function(e) { | ||
console.log(e); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters