{"action":"created","comment":{"url":"https://api.github.com/repos/abiquo/noVNC/pulls/comments/79363375","id":79363375,"diff_hunk":"@@ -0,0 +1,60 @@\n+#!/usr/bin/env ruby\n+\n+require 'rubygems'\n+require 'trollop'\n+require 'abiquo-api'\n+\n+def link(h, a)\n+  AbiquoAPI::Link.new(:href => h, :type => \"application/vnd.abiquo.#{a}+json\", :client => $client)\n+end\n+\n+begin\n+  opts = Trollop::options do\n+    opt :endpoint, \"API endpoint\", :type => :string\n+    opt :username, \"API username\", :type => :string, :default => \"admin\"\n+    opt :password, \"API password\", :type => :string, :default => \"xabiquo\"\n+    opt :mode    , \"Authmode\",     :type => :string, :default => \"basic\"\n+    opt :file    , \"Tokens file\",  :type => :string, :default => \"/opt/websockify/config.vnc\"\n+    opt :key     , \"Consumer key\", :type => :string\n+    opt :secret  , \"Consumer key\", :type => :string\n+    opt :tkey    , \"Token key\"   , :type => :string\n+    opt :tsecret , \"Token secret\", :type => :string\n+  end\n+  \n+  $client = case opts[:mode]\n+    when \"oauth\" then\n+      AbiquoAPI.new(\n+        :abiquo_api_url      => opts[:endpoint],\n+        :abiquo_api_key      => opts[:key],\n+        :abiquo_api_secret   => opts[:secret],\n+        :abiquo_token_key    => opts[:tkey],\n+        :abiquo_token_secret => opts[:tsecret])\n+    else\n+      AbiquoAPI.new(\n+        :abiquo_api_url => opts[:endpoint],\n+        :abiquo_username => opts[:username],\n+        :abiquo_password => opts[:password])\n+    end\n+\n+  # Get tokens\n+  tokens = []\n+  datacenters = link(\"/api/admin/datacenters\", \"datacenters\").get\n+  datacenters.each do |d|\n+    racks = d.link(:racks).get\n+    racks.each do |r|\n+      vms = link(\"#{r.url}/deployedvms\", \"virtualmachines\").get","path":"novnc_tokens2.rb","position":45,"original_position":45,"commit_id":"118cd90134513e89dd0576ee16fd315ee2967285","original_commit_id":"118cd90134513e89dd0576ee16fd315ee2967285","user":{"login":"chirauki","id":1199619,"avatar_url":"https://avatars.githubusercontent.com/u/1199619?v=3","gravatar_id":"","url":"https://api.github.com/users/chirauki","html_url":"https://github.com/chirauki","followers_url":"https://api.github.com/users/chirauki/followers","following_url":"https://api.github.com/users/chirauki/following{/other_user}","gists_url":"https://api.github.com/users/chirauki/gists{/gist_id}","starred_url":"https://api.github.com/users/chirauki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chirauki/subscriptions","organizations_url":"https://api.github.com/users/chirauki/orgs","repos_url":"https://api.github.com/users/chirauki/repos","events_url":"https://api.github.com/users/chirauki/events{/privacy}","received_events_url":"https://api.github.com/users/chirauki/received_events","type":"User","site_admin":false},"body":"OK I see now.","created_at":"2016-09-19T10:27:28Z","updated_at":"2016-09-19T10:27:28Z","html_url":"https://github.com/abiquo/noVNC/pull/6#discussion_r79363375","pull_request_url":"https://api.github.com/repos/abiquo/noVNC/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/abiquo/noVNC/pulls/comments/79363375"},"html":{"href":"https://github.com/abiquo/noVNC/pull/6#discussion_r79363375"},"pull_request":{"href":"https://api.github.com/repos/abiquo/noVNC/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/abiquo/noVNC/pulls/6","id":85421441,"html_url":"https://github.com/abiquo/noVNC/pull/6","diff_url":"https://github.com/abiquo/noVNC/pull/6.diff","patch_url":"https://github.com/abiquo/noVNC/pull/6.patch","issue_url":"https://api.github.com/repos/abiquo/noVNC/issues/6","number":6,"state":"open","locked":false,"title":"Oauth","user":{"login":"agoca80","id":8769822,"avatar_url":"https://avatars.githubusercontent.com/u/8769822?v=3","gravatar_id":"","url":"https://api.github.com/users/agoca80","html_url":"https://github.com/agoca80","followers_url":"https://api.github.com/users/agoca80/followers","following_url":"https://api.github.com/users/agoca80/following{/other_user}","gists_url":"https://api.github.com/users/agoca80/gists{/gist_id}","starred_url":"https://api.github.com/users/agoca80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agoca80/subscriptions","organizations_url":"https://api.github.com/users/agoca80/orgs","repos_url":"https://api.github.com/users/agoca80/repos","events_url":"https://api.github.com/users/agoca80/events{/privacy}","received_events_url":"https://api.github.com/users/agoca80/received_events","type":"User","site_admin":false},"body":"novnc tokens using the abiquo gem with oauth support","created_at":"2016-09-15T15:02:57Z","updated_at":"2016-09-19T10:27:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8f9632f5478d112be16a8a13bf1931e4348bbbb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/abiquo/noVNC/pulls/6/commits","review_comments_url":"https://api.github.com/repos/abiquo/noVNC/pulls/6/comments","review_comment_url":"https://api.github.com/repos/abiquo/noVNC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/abiquo/noVNC/issues/6/comments","statuses_url":"https://api.github.com/repos/abiquo/noVNC/statuses/118cd90134513e89dd0576ee16fd315ee2967285","head":{"label":"abiquo:oauth","ref":"oauth","sha":"118cd90134513e89dd0576ee16fd315ee2967285","user":{"login":"abiquo","id":53275,"avatar_url":"https://avatars.githubusercontent.com/u/53275?v=3","gravatar_id":"","url":"https://api.github.com/users/abiquo","html_url":"https://github.com/abiquo","followers_url":"https://api.github.com/users/abiquo/followers","following_url":"https://api.github.com/users/abiquo/following{/other_user}","gists_url":"https://api.github.com/users/abiquo/gists{/gist_id}","starred_url":"https://api.github.com/users/abiquo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abiquo/subscriptions","organizations_url":"https://api.github.com/users/abiquo/orgs","repos_url":"https://api.github.com/users/abiquo/repos","events_url":"https://api.github.com/users/abiquo/events{/privacy}","received_events_url":"https://api.github.com/users/abiquo/received_events","type":"Organization","site_admin":false},"repo":{"id":15998497,"name":"noVNC","full_name":"abiquo/noVNC","owner":{"login":"abiquo","id":53275,"avatar_url":"https://avatars.githubusercontent.com/u/53275?v=3","gravatar_id":"","url":"https://api.github.com/users/abiquo","html_url":"https://github.com/abiquo","followers_url":"https://api.github.com/users/abiquo/followers","following_url":"https://api.github.com/users/abiquo/following{/other_user}","gists_url":"https://api.github.com/users/abiquo/gists{/gist_id}","starred_url":"https://api.github.com/users/abiquo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abiquo/subscriptions","organizations_url":"https://api.github.com/users/abiquo/orgs","repos_url":"https://api.github.com/users/abiquo/repos","events_url":"https://api.github.com/users/abiquo/events{/privacy}","received_events_url":"https://api.github.com/users/abiquo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/abiquo/noVNC","description":"Files to run noVNC in Abiquo","fork":false,"url":"https://api.github.com/repos/abiquo/noVNC","forks_url":"https://api.github.com/repos/abiquo/noVNC/forks","keys_url":"https://api.github.com/repos/abiquo/noVNC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abiquo/noVNC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abiquo/noVNC/teams","hooks_url":"https://api.github.com/repos/abiquo/noVNC/hooks","issue_events_url":"https://api.github.com/repos/abiquo/noVNC/issues/events{/number}","events_url":"https://api.github.com/repos/abiquo/noVNC/events","assignees_url":"https://api.github.com/repos/abiquo/noVNC/assignees{/user}","branches_url":"https://api.github.com/repos/abiquo/noVNC/branches{/branch}","tags_url":"https://api.github.com/repos/abiquo/noVNC/tags","blobs_url":"https://api.github.com/repos/abiquo/noVNC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abiquo/noVNC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abiquo/noVNC/git/refs{/sha}","trees_url":"https://api.github.com/repos/abiquo/noVNC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abiquo/noVNC/statuses/{sha}","languages_url":"https://api.github.com/repos/abiquo/noVNC/languages","stargazers_url":"https://api.github.com/repos/abiquo/noVNC/stargazers","contributors_url":"https://api.github.com/repos/abiquo/noVNC/contributors","subscribers_url":"https://api.github.com/repos/abiquo/noVNC/subscribers","subscription_url":"https://api.github.com/repos/abiquo/noVNC/subscription","commits_url":"https://api.github.com/repos/abiquo/noVNC/commits{/sha}","git_commits_url":"https://api.github.com/repos/abiquo/noVNC/git/commits{/sha}","comments_url":"https://api.github.com/repos/abiquo/noVNC/comments{/number}","issue_comment_url":"https://api.github.com/repos/abiquo/noVNC/issues/comments{/number}","contents_url":"https://api.github.com/repos/abiquo/noVNC/contents/{+path}","compare_url":"https://api.github.com/repos/abiquo/noVNC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abiquo/noVNC/merges","archive_url":"https://api.github.com/repos/abiquo/noVNC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abiquo/noVNC/downloads","issues_url":"https://api.github.com/repos/abiquo/noVNC/issues{/number}","pulls_url":"https://api.github.com/repos/abiquo/noVNC/pulls{/number}","milestones_url":"https://api.github.com/repos/abiquo/noVNC/milestones{/number}","notifications_url":"https://api.github.com/repos/abiquo/noVNC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abiquo/noVNC/labels{/name}","releases_url":"https://api.github.com/repos/abiquo/noVNC/releases{/id}","deployments_url":"https://api.github.com/repos/abiquo/noVNC/deployments","created_at":"2014-01-17T11:54:26Z","updated_at":"2015-03-13T19:46:07Z","pushed_at":"2016-09-15T15:02:57Z","git_url":"git://github.com/abiquo/noVNC.git","ssh_url":"git@github.com:abiquo/noVNC.git","clone_url":"https://github.com/abiquo/noVNC.git","svn_url":"https://github.com/abiquo/noVNC","homepage":null,"size":167,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"abiquo:master","ref":"master","sha":"af92a7f33f1adf458f616e5d57fc52671afc2daf","user":{"login":"abiquo","id":53275,"avatar_url":"https://avatars.githubusercontent.com/u/53275?v=3","gravatar_id":"","url":"https://api.github.com/users/abiquo","html_url":"https://github.com/abiquo","followers_url":"https://api.github.com/users/abiquo/followers","following_url":"https://api.github.com/users/abiquo/following{/other_user}","gists_url":"https://api.github.com/users/abiquo/gists{/gist_id}","starred_url":"https://api.github.com/users/abiquo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abiquo/subscriptions","organizations_url":"https://api.github.com/users/abiquo/orgs","repos_url":"https://api.github.com/users/abiquo/repos","events_url":"https://api.github.com/users/abiquo/events{/privacy}","received_events_url":"https://api.github.com/users/abiquo/received_events","type":"Organization","site_admin":false},"repo":{"id":15998497,"name":"noVNC","full_name":"abiquo/noVNC","owner":{"login":"abiquo","id":53275,"avatar_url":"https://avatars.githubusercontent.com/u/53275?v=3","gravatar_id":"","url":"https://api.github.com/users/abiquo","html_url":"https://github.com/abiquo","followers_url":"https://api.github.com/users/abiquo/followers","following_url":"https://api.github.com/users/abiquo/following{/other_user}","gists_url":"https://api.github.com/users/abiquo/gists{/gist_id}","starred_url":"https://api.github.com/users/abiquo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abiquo/subscriptions","organizations_url":"https://api.github.com/users/abiquo/orgs","repos_url":"https://api.github.com/users/abiquo/repos","events_url":"https://api.github.com/users/abiquo/events{/privacy}","received_events_url":"https://api.github.com/users/abiquo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/abiquo/noVNC","description":"Files to run noVNC in Abiquo","fork":false,"url":"https://api.github.com/repos/abiquo/noVNC","forks_url":"https://api.github.com/repos/abiquo/noVNC/forks","keys_url":"https://api.github.com/repos/abiquo/noVNC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abiquo/noVNC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abiquo/noVNC/teams","hooks_url":"https://api.github.com/repos/abiquo/noVNC/hooks","issue_events_url":"https://api.github.com/repos/abiquo/noVNC/issues/events{/number}","events_url":"https://api.github.com/repos/abiquo/noVNC/events","assignees_url":"https://api.github.com/repos/abiquo/noVNC/assignees{/user}","branches_url":"https://api.github.com/repos/abiquo/noVNC/branches{/branch}","tags_url":"https://api.github.com/repos/abiquo/noVNC/tags","blobs_url":"https://api.github.com/repos/abiquo/noVNC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abiquo/noVNC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abiquo/noVNC/git/refs{/sha}","trees_url":"https://api.github.com/repos/abiquo/noVNC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abiquo/noVNC/statuses/{sha}","languages_url":"https://api.github.com/repos/abiquo/noVNC/languages","stargazers_url":"https://api.github.com/repos/abiquo/noVNC/stargazers","contributors_url":"https://api.github.com/repos/abiquo/noVNC/contributors","subscribers_url":"https://api.github.com/repos/abiquo/noVNC/subscribers","subscription_url":"https://api.github.com/repos/abiquo/noVNC/subscription","commits_url":"https://api.github.com/repos/abiquo/noVNC/commits{/sha}","git_commits_url":"https://api.github.com/repos/abiquo/noVNC/git/commits{/sha}","comments_url":"https://api.github.com/repos/abiquo/noVNC/comments{/number}","issue_comment_url":"https://api.github.com/repos/abiquo/noVNC/issues/comments{/number}","contents_url":"https://api.github.com/repos/abiquo/noVNC/contents/{+path}","compare_url":"https://api.github.com/repos/abiquo/noVNC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abiquo/noVNC/merges","archive_url":"https://api.github.com/repos/abiquo/noVNC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abiquo/noVNC/downloads","issues_url":"https://api.github.com/repos/abiquo/noVNC/issues{/number}","pulls_url":"https://api.github.com/repos/abiquo/noVNC/pulls{/number}","milestones_url":"https://api.github.com/repos/abiquo/noVNC/milestones{/number}","notifications_url":"https://api.github.com/repos/abiquo/noVNC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abiquo/noVNC/labels{/name}","releases_url":"https://api.github.com/repos/abiquo/noVNC/releases{/id}","deployments_url":"https://api.github.com/repos/abiquo/noVNC/deployments","created_at":"2014-01-17T11:54:26Z","updated_at":"2015-03-13T19:46:07Z","pushed_at":"2016-09-15T15:02:57Z","git_url":"git://github.com/abiquo/noVNC.git","ssh_url":"git@github.com:abiquo/noVNC.git","clone_url":"https://github.com/abiquo/noVNC.git","svn_url":"https://github.com/abiquo/noVNC","homepage":null,"size":167,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/abiquo/noVNC/pulls/6"},"html":{"href":"https://github.com/abiquo/noVNC/pull/6"},"issue":{"href":"https://api.github.com/repos/abiquo/noVNC/issues/6"},"comments":{"href":"https://api.github.com/repos/abiquo/noVNC/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/abiquo/noVNC/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/abiquo/noVNC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/abiquo/noVNC/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/abiquo/noVNC/statuses/118cd90134513e89dd0576ee16fd315ee2967285"}}}}
{"actor":{"display_login":"chirauki"}}