GitHub PullRequestEvent at 2014-12-17 01:08:15
Repository: oriento
Actor: phpnode
Payload: {"action":"closed","number":165,"pull_request":{"url":"https://api.github.com/repos/codemix/oriento/pulls/165","id":26193889,"html_url":"https://github.com/codemix/oriento/pull/165","diff_url":"https://github.com/codemix/oriento/pull/165.diff","patch_url":"https://github.com/codemix/oriento/pull/165.patch","issue_url":"https://api.github.com/repos/codemix/oriento/issues/165","number":165,"state":"closed","locked":false,"title":"Add support for token based authentication.","user":{"login":"phpnode","id":363611,"avatar_url":"https://avatars.githubusercontent.com/u/363611?v=3","gravatar_id":"","url":"https://api.github.com/users/phpnode","html_url":"https://github.com/phpnode","followers_url":"https://api.github.com/users/phpnode/followers","following_url":"https://api.github.com/users/phpnode/following{/other_user}","gists_url":"https://api.github.com/users/phpnode/gists{/gist_id}","starred_url":"https://api.github.com/users/phpnode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpnode/subscriptions","organizations_url":"https://api.github.com/users/phpnode/orgs","repos_url":"https://api.github.com/users/phpnode/repos","events_url":"https://api.github.com/users/phpnode/events{/privacy}","received_events_url":"https://api.github.com/users/phpnode/received_events","type":"User","site_admin":false},"body":"This adds support for using tokens to authenticate with OrientDB.\r\n\r\n```js\r\nvar oriento = require('oriento');\r\nvar server = oriento({\r\n  username: 'root',\r\n  password: 'root',\r\n  useToken: true\r\n});\r\n\r\n\r\n\r\nvar readerToken, adminToken;\r\n\r\nvar db = server.use({\r\n  name: 'mydb',\r\n  username: 'admin',\r\n  password: 'admin'\r\n});\r\n\r\n\r\ndb.open()\r\n.then(function () {\r\n  adminToken = db.token;\r\n   // by default, execute a command using the main user (admin)\r\n   return db.select().from('OUser').all();\r\n})\r\n.then(function (users) {\r\n  // get a token for the `reader` user.\r\n  return server.use({\r\n    name: 'mydb',\r\n    username: 'reader',\r\n    password: 'reader'\r\n  })\r\n  .open()\r\n  .then(function (readerDb) {\r\n    readerToken = readerDb.token;\r\n  })  \r\n})\r\n.then(function () {\r\n  // execute a command on behalf of the reader:\r\n  return db.select().from('OUser').token(readerToken).all();\r\n})\r\n.then(function (users) {\r\n  // try and insert something using the reader user.\r\n  return db.insert().into('V').set({foo: 'bar'}).token(readerToken).one(); // fails, no permissions!\r\n});\r\n\r\n\r\n```","created_at":"2014-12-17T01:05:10Z","updated_at":"2014-12-17T01:08:15Z","closed_at":"2014-12-17T01:08:14Z","merged_at":"2014-12-17T01:08:14Z","merge_commit_sha":"c43b4721ae901ef063e8c85c6eddbd151b1beda1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codemix/oriento/pulls/165/commits","review_comments_url":"https://api.github.com/repos/codemix/oriento/pulls/165/comments","review_comment_url":"https://api.github.com/repos/codemix/oriento/pulls/comments/{number}","comments_url":"https://api.github.com/repos/codemix/oriento/issues/165/comments","statuses_url":"https://api.github.com/repos/codemix/oriento/statuses/fef3482d413b5e71ef1a2968f229bb1dca5848a3","head":{"label":"codemix:jwt","ref":"jwt","sha":"fef3482d413b5e71ef1a2968f229bb1dca5848a3","user":{"login":"codemix","id":4009461,"avatar_url":"https://avatars.githubusercontent.com/u/4009461?v=3","gravatar_id":"","url":"https://api.github.com/users/codemix","html_url":"https://github.com/codemix","followers_url":"https://api.github.com/users/codemix/followers","following_url":"https://api.github.com/users/codemix/following{/other_user}","gists_url":"https://api.github.com/users/codemix/gists{/gist_id}","starred_url":"https://api.github.com/users/codemix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codemix/subscriptions","organizations_url":"https://api.github.com/users/codemix/orgs","repos_url":"https://api.github.com/users/codemix/repos","events_url":"https://api.github.com/users/codemix/events{/privacy}","received_events_url":"https://api.github.com/users/codemix/received_events","type":"Organization","site_admin":false},"repo":{"id":17458040,"name":"oriento","full_name":"codemix/oriento","owner":{"login":"codemix","id":4009461,"avatar_url":"https://avatars.githubusercontent.com/u/4009461?v=3","gravatar_id":"","url":"https://api.github.com/users/codemix","html_url":"https://github.com/codemix","followers_url":"https://api.github.com/users/codemix/followers","following_url":"https://api.github.com/users/codemix/following{/other_user}","gists_url":"https://api.github.com/users/codemix/gists{/gist_id}","starred_url":"https://api.github.com/users/codemix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codemix/subscriptions","organizations_url":"https://api.github.com/users/codemix/orgs","repos_url":"https://api.github.com/users/codemix/repos","events_url":"https://api.github.com/users/codemix/events{/privacy}","received_events_url":"https://api.github.com/users/codemix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codemix/oriento","description":"Official node.js driver for OrientDB. Fast, lightweight, uses the binary protocol.","fork":false,"url":"https://api.github.com/repos/codemix/oriento","forks_url":"https://api.github.com/repos/codemix/oriento/forks","keys_url":"https://api.github.com/repos/codemix/oriento/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codemix/oriento/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codemix/oriento/teams","hooks_url":"https://api.github.com/repos/codemix/oriento/hooks","issue_events_url":"https://api.github.com/repos/codemix/oriento/issues/events{/number}","events_url":"https://api.github.com/repos/codemix/oriento/events","assignees_url":"https://api.github.com/repos/codemix/oriento/assignees{/user}","branches_url":"https://api.github.com/repos/codemix/oriento/branches{/branch}","tags_url":"https://api.github.com/repos/codemix/oriento/tags","blobs_url":"https://api.github.com/repos/codemix/oriento/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codemix/oriento/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codemix/oriento/git/refs{/sha}","trees_url":"https://api.github.com/repos/codemix/oriento/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codemix/oriento/statuses/{sha}","languages_url":"https://api.github.com/repos/codemix/oriento/languages","stargazers_url":"https://api.github.com/repos/codemix/oriento/stargazers","contributors_url":"https://api.github.com/repos/codemix/oriento/contributors","subscribers_url":"https://api.github.com/repos/codemix/oriento/subscribers","subscription_url":"https://api.github.com/repos/codemix/oriento/subscription","commits_url":"https://api.github.com/repos/codemix/oriento/commits{/sha}","git_commits_url":"https://api.github.com/repos/codemix/oriento/git/commits{/sha}","comments_url":"https://api.github.com/repos/codemix/oriento/comments{/number}","issue_comment_url":"https://api.github.com/repos/codemix/oriento/issues/comments/{number}","contents_url":"https://api.github.com/repos/codemix/oriento/contents/{+path}","compare_url":"https://api.github.com/repos/codemix/oriento/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codemix/oriento/merges","archive_url":"https://api.github.com/repos/codemix/oriento/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codemix/oriento/downloads","issues_url":"https://api.github.com/repos/codemix/oriento/issues{/number}","pulls_url":"https://api.github.com/repos/codemix/oriento/pulls{/number}","milestones_url":"https://api.github.com/repos/codemix/oriento/milestones{/number}","notifications_url":"https://api.github.com/repos/codemix/oriento/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codemix/oriento/labels{/name}","releases_url":"https://api.github.com/repos/codemix/oriento/releases{/id}","created_at":"2014-03-05T22:48:02Z","updated_at":"2014-12-13T02:27:38Z","pushed_at":"2014-12-17T01:08:14Z","git_url":"git://github.com/codemix/oriento.git","ssh_url":"git@github.com:codemix/oriento.git","clone_url":"https://github.com/codemix/oriento.git","svn_url":"https://github.com/codemix/oriento","homepage":"","size":4547,"stargazers_count":94,"watchers_count":94,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":4,"forks":20,"open_issues":4,"watchers":94,"default_branch":"master"}},"base":{"label":"codemix:master","ref":"master","sha":"b5594b91b4e313646d373da6dc7cc7130651d015","user":{"login":"codemix","id":4009461,"avatar_url":"https://avatars.githubusercontent.com/u/4009461?v=3","gravatar_id":"","url":"https://api.github.com/users/codemix","html_url":"https://github.com/codemix","followers_url":"https://api.github.com/users/codemix/followers","following_url":"https://api.github.com/users/codemix/following{/other_user}","gists_url":"https://api.github.com/users/codemix/gists{/gist_id}","starred_url":"https://api.github.com/users/codemix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codemix/subscriptions","organizations_url":"https://api.github.com/users/codemix/orgs","repos_url":"https://api.github.com/users/codemix/repos","events_url":"https://api.github.com/users/codemix/events{/privacy}","received_events_url":"https://api.github.com/users/codemix/received_events","type":"Organization","site_admin":false},"repo":{"id":17458040,"name":"oriento","full_name":"codemix/oriento","owner":{"login":"codemix","id":4009461,"avatar_url":"https://avatars.githubusercontent.com/u/4009461?v=3","gravatar_id":"","url":"https://api.github.com/users/codemix","html_url":"https://github.com/codemix","followers_url":"https://api.github.com/users/codemix/followers","following_url":"https://api.github.com/users/codemix/following{/other_user}","gists_url":"https://api.github.com/users/codemix/gists{/gist_id}","starred_url":"https://api.github.com/users/codemix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codemix/subscriptions","organizations_url":"https://api.github.com/users/codemix/orgs","repos_url":"https://api.github.com/users/codemix/repos","events_url":"https://api.github.com/users/codemix/events{/privacy}","received_events_url":"https://api.github.com/users/codemix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codemix/oriento","description":"Official node.js driver for OrientDB. Fast, lightweight, uses the binary protocol.","fork":false,"url":"https://api.github.com/repos/codemix/oriento","forks_url":"https://api.github.com/repos/codemix/oriento/forks","keys_url":"https://api.github.com/repos/codemix/oriento/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codemix/oriento/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codemix/oriento/teams","hooks_url":"https://api.github.com/repos/codemix/oriento/hooks","issue_events_url":"https://api.github.com/repos/codemix/oriento/issues/events{/number}","events_url":"https://api.github.com/repos/codemix/oriento/events","assignees_url":"https://api.github.com/repos/codemix/oriento/assignees{/user}","branches_url":"https://api.github.com/repos/codemix/oriento/branches{/branch}","tags_url":"https://api.github.com/repos/codemix/oriento/tags","blobs_url":"https://api.github.com/repos/codemix/oriento/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codemix/oriento/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codemix/oriento/git/refs{/sha}","trees_url":"https://api.github.com/repos/codemix/oriento/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codemix/oriento/statuses/{sha}","languages_url":"https://api.github.com/repos/codemix/oriento/languages","stargazers_url":"https://api.github.com/repos/codemix/oriento/stargazers","contributors_url":"https://api.github.com/repos/codemix/oriento/contributors","subscribers_url":"https://api.github.com/repos/codemix/oriento/subscribers","subscription_url":"https://api.github.com/repos/codemix/oriento/subscription","commits_url":"https://api.github.com/repos/codemix/oriento/commits{/sha}","git_commits_url":"https://api.github.com/repos/codemix/oriento/git/commits{/sha}","comments_url":"https://api.github.com/repos/codemix/oriento/comments{/number}","issue_comment_url":"https://api.github.com/repos/codemix/oriento/issues/comments/{number}","contents_url":"https://api.github.com/repos/codemix/oriento/contents/{+path}","compare_url":"https://api.github.com/repos/codemix/oriento/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codemix/oriento/merges","archive_url":"https://api.github.com/repos/codemix/oriento/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codemix/oriento/downloads","issues_url":"https://api.github.com/repos/codemix/oriento/issues{/number}","pulls_url":"https://api.github.com/repos/codemix/oriento/pulls{/number}","milestones_url":"https://api.github.com/repos/codemix/oriento/milestones{/number}","notifications_url":"https://api.github.com/repos/codemix/oriento/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codemix/oriento/labels{/name}","releases_url":"https://api.github.com/repos/codemix/oriento/releases{/id}","created_at":"2014-03-05T22:48:02Z","updated_at":"2014-12-13T02:27:38Z","pushed_at":"2014-12-17T01:08:14Z","git_url":"git://github.com/codemix/oriento.git","ssh_url":"git@github.com:codemix/oriento.git","clone_url":"https://github.com/codemix/oriento.git","svn_url":"https://github.com/codemix/oriento","homepage":"","size":4547,"stargazers_count":94,"watchers_count":94,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":4,"forks":20,"open_issues":4,"watchers":94,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codemix/oriento/pulls/165"},"html":{"href":"https://github.com/codemix/oriento/pull/165"},"issue":{"href":"https://api.github.com/repos/codemix/oriento/issues/165"},"comments":{"href":"https://api.github.com/repos/codemix/oriento/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/codemix/oriento/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/codemix/oriento/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/codemix/oriento/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/codemix/oriento/statuses/fef3482d413b5e71ef1a2968f229bb1dca5848a3"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"phpnode","id":363611,"avatar_url":"https://avatars.githubusercontent.com/u/363611?v=3","gravatar_id":"","url":"https://api.github.com/users/phpnode","html_url":"https://github.com/phpnode","followers_url":"https://api.github.com/users/phpnode/followers","following_url":"https://api.github.com/users/phpnode/following{/other_user}","gists_url":"https://api.github.com/users/phpnode/gists{/gist_id}","starred_url":"https://api.github.com/users/phpnode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpnode/subscriptions","organizations_url":"https://api.github.com/users/phpnode/orgs","repos_url":"https://api.github.com/users/phpnode/repos","events_url":"https://api.github.com/users/phpnode/events{/privacy}","received_events_url":"https://api.github.com/users/phpnode/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":6,"additions":3427,"deletions":198,"changed_files":48}}