{"action":"created","comment":{"url":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/comments/43301935","id":43301935,"diff_hunk":"@@ -42,14 +43,30 @@ namespace :pub_sub do\n     task topics: :environment do\n       puts 'Topics: ', '----------'\n       PubSub.config.regions.each do |region|\n-        Aws::SNS::Client.new(region: region).list_topics.topics.each do |topic|\n+        client = Aws::SNS::Client.new(region: region)\n+        topics = collect_all(client, :topics)\n+        topics.each do |topic|\n           puts \" - #{split_name(topic.topic_arn)} in #{region}\"\n         end\n       end\n     end\n   end\n \n+\n   def split_name(string, delimiter = ':')\n     string.to_s.split(delimiter).last\n   end\n+\n+  def collect_all(client, collection_type)\n+    elements = []\n+    next_token = \"\"\n+    loop do\n+      response = client.send(\"list_#{collection_type}\".to_sym, next_token: next_token)\n+      elements.concat response.send(collection_type.to_sym)","path":"lib/pub_sub/tasks/debug.rake","position":40,"original_position":40,"commit_id":"661d600a49a30bc936e63887d1fd0c04ecb6b957","original_commit_id":"661d600a49a30bc936e63887d1fd0c04ecb6b957","user":{"login":"ltran","id":197954,"avatar_url":"https://avatars.githubusercontent.com/u/197954?v=3","gravatar_id":"","url":"https://api.github.com/users/ltran","html_url":"https://github.com/ltran","followers_url":"https://api.github.com/users/ltran/followers","following_url":"https://api.github.com/users/ltran/following{/other_user}","gists_url":"https://api.github.com/users/ltran/gists{/gist_id}","starred_url":"https://api.github.com/users/ltran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltran/subscriptions","organizations_url":"https://api.github.com/users/ltran/orgs","repos_url":"https://api.github.com/users/ltran/repos","events_url":"https://api.github.com/users/ltran/events{/privacy}","received_events_url":"https://api.github.com/users/ltran/received_events","type":"User","site_admin":false},"body":"Do we need to whitelist this  send? or is the input a considered safe?","created_at":"2015-10-28T18:57:26Z","updated_at":"2015-10-28T18:57:26Z","html_url":"https://github.com/westfieldlabs/pub_sub/pull/40#discussion_r43301935","pull_request_url":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/comments/43301935"},"html":{"href":"https://github.com/westfieldlabs/pub_sub/pull/40#discussion_r43301935"},"pull_request":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/40","id":49042872,"html_url":"https://github.com/westfieldlabs/pub_sub/pull/40","diff_url":"https://github.com/westfieldlabs/pub_sub/pull/40.diff","patch_url":"https://github.com/westfieldlabs/pub_sub/pull/40.patch","issue_url":"https://api.github.com/repos/westfieldlabs/pub_sub/issues/40","number":40,"state":"closed","locked":false,"title":"[WFAPI-1010] List ALL subscriptions rather than the first 100","user":{"login":"emirkin","id":1053956,"avatar_url":"https://avatars.githubusercontent.com/u/1053956?v=3","gravatar_id":"","url":"https://api.github.com/users/emirkin","html_url":"https://github.com/emirkin","followers_url":"https://api.github.com/users/emirkin/followers","following_url":"https://api.github.com/users/emirkin/following{/other_user}","gists_url":"https://api.github.com/users/emirkin/gists{/gist_id}","starred_url":"https://api.github.com/users/emirkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emirkin/subscriptions","organizations_url":"https://api.github.com/users/emirkin/orgs","repos_url":"https://api.github.com/users/emirkin/repos","events_url":"https://api.github.com/users/emirkin/events{/privacy}","received_events_url":"https://api.github.com/users/emirkin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-28T17:52:35Z","updated_at":"2015-10-28T18:57:26Z","closed_at":"2015-10-28T18:56:20Z","merged_at":"2015-10-28T18:56:20Z","merge_commit_sha":"f95ea738125dd5ba5007872c5fe79be69572ca85","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/40/commits","review_comments_url":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/40/comments","review_comment_url":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/westfieldlabs/pub_sub/issues/40/comments","statuses_url":"https://api.github.com/repos/westfieldlabs/pub_sub/statuses/661d600a49a30bc936e63887d1fd0c04ecb6b957","head":{"label":"emirkin:WFAPI-1010_list_all_subscriptions_correctly","ref":"WFAPI-1010_list_all_subscriptions_correctly","sha":"661d600a49a30bc936e63887d1fd0c04ecb6b957","user":{"login":"emirkin","id":1053956,"avatar_url":"https://avatars.githubusercontent.com/u/1053956?v=3","gravatar_id":"","url":"https://api.github.com/users/emirkin","html_url":"https://github.com/emirkin","followers_url":"https://api.github.com/users/emirkin/followers","following_url":"https://api.github.com/users/emirkin/following{/other_user}","gists_url":"https://api.github.com/users/emirkin/gists{/gist_id}","starred_url":"https://api.github.com/users/emirkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emirkin/subscriptions","organizations_url":"https://api.github.com/users/emirkin/orgs","repos_url":"https://api.github.com/users/emirkin/repos","events_url":"https://api.github.com/users/emirkin/events{/privacy}","received_events_url":"https://api.github.com/users/emirkin/received_events","type":"User","site_admin":false},"repo":{"id":41831146,"name":"pub_sub","full_name":"emirkin/pub_sub","owner":{"login":"emirkin","id":1053956,"avatar_url":"https://avatars.githubusercontent.com/u/1053956?v=3","gravatar_id":"","url":"https://api.github.com/users/emirkin","html_url":"https://github.com/emirkin","followers_url":"https://api.github.com/users/emirkin/followers","following_url":"https://api.github.com/users/emirkin/following{/other_user}","gists_url":"https://api.github.com/users/emirkin/gists{/gist_id}","starred_url":"https://api.github.com/users/emirkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emirkin/subscriptions","organizations_url":"https://api.github.com/users/emirkin/orgs","repos_url":"https://api.github.com/users/emirkin/repos","events_url":"https://api.github.com/users/emirkin/events{/privacy}","received_events_url":"https://api.github.com/users/emirkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/emirkin/pub_sub","description":"","fork":true,"url":"https://api.github.com/repos/emirkin/pub_sub","forks_url":"https://api.github.com/repos/emirkin/pub_sub/forks","keys_url":"https://api.github.com/repos/emirkin/pub_sub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emirkin/pub_sub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emirkin/pub_sub/teams","hooks_url":"https://api.github.com/repos/emirkin/pub_sub/hooks","issue_events_url":"https://api.github.com/repos/emirkin/pub_sub/issues/events{/number}","events_url":"https://api.github.com/repos/emirkin/pub_sub/events","assignees_url":"https://api.github.com/repos/emirkin/pub_sub/assignees{/user}","branches_url":"https://api.github.com/repos/emirkin/pub_sub/branches{/branch}","tags_url":"https://api.github.com/repos/emirkin/pub_sub/tags","blobs_url":"https://api.github.com/repos/emirkin/pub_sub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emirkin/pub_sub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emirkin/pub_sub/git/refs{/sha}","trees_url":"https://api.github.com/repos/emirkin/pub_sub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emirkin/pub_sub/statuses/{sha}","languages_url":"https://api.github.com/repos/emirkin/pub_sub/languages","stargazers_url":"https://api.github.com/repos/emirkin/pub_sub/stargazers","contributors_url":"https://api.github.com/repos/emirkin/pub_sub/contributors","subscribers_url":"https://api.github.com/repos/emirkin/pub_sub/subscribers","subscription_url":"https://api.github.com/repos/emirkin/pub_sub/subscription","commits_url":"https://api.github.com/repos/emirkin/pub_sub/commits{/sha}","git_commits_url":"https://api.github.com/repos/emirkin/pub_sub/git/commits{/sha}","comments_url":"https://api.github.com/repos/emirkin/pub_sub/comments{/number}","issue_comment_url":"https://api.github.com/repos/emirkin/pub_sub/issues/comments{/number}","contents_url":"https://api.github.com/repos/emirkin/pub_sub/contents/{+path}","compare_url":"https://api.github.com/repos/emirkin/pub_sub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emirkin/pub_sub/merges","archive_url":"https://api.github.com/repos/emirkin/pub_sub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emirkin/pub_sub/downloads","issues_url":"https://api.github.com/repos/emirkin/pub_sub/issues{/number}","pulls_url":"https://api.github.com/repos/emirkin/pub_sub/pulls{/number}","milestones_url":"https://api.github.com/repos/emirkin/pub_sub/milestones{/number}","notifications_url":"https://api.github.com/repos/emirkin/pub_sub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emirkin/pub_sub/labels{/name}","releases_url":"https://api.github.com/repos/emirkin/pub_sub/releases{/id}","created_at":"2015-09-02T22:37:19Z","updated_at":"2015-09-02T22:37:19Z","pushed_at":"2015-10-28T18:26:13Z","git_url":"git://github.com/emirkin/pub_sub.git","ssh_url":"git@github.com:emirkin/pub_sub.git","clone_url":"https://github.com/emirkin/pub_sub.git","svn_url":"https://github.com/emirkin/pub_sub","homepage":null,"size":237,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"westfieldlabs:master","ref":"master","sha":"0f6ad5ba6a3aeec1d4b2f0e4d909ef750a35c180","user":{"login":"westfieldlabs","id":4454594,"avatar_url":"https://avatars.githubusercontent.com/u/4454594?v=3","gravatar_id":"","url":"https://api.github.com/users/westfieldlabs","html_url":"https://github.com/westfieldlabs","followers_url":"https://api.github.com/users/westfieldlabs/followers","following_url":"https://api.github.com/users/westfieldlabs/following{/other_user}","gists_url":"https://api.github.com/users/westfieldlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/westfieldlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westfieldlabs/subscriptions","organizations_url":"https://api.github.com/users/westfieldlabs/orgs","repos_url":"https://api.github.com/users/westfieldlabs/repos","events_url":"https://api.github.com/users/westfieldlabs/events{/privacy}","received_events_url":"https://api.github.com/users/westfieldlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":33651236,"name":"pub_sub","full_name":"westfieldlabs/pub_sub","owner":{"login":"westfieldlabs","id":4454594,"avatar_url":"https://avatars.githubusercontent.com/u/4454594?v=3","gravatar_id":"","url":"https://api.github.com/users/westfieldlabs","html_url":"https://github.com/westfieldlabs","followers_url":"https://api.github.com/users/westfieldlabs/followers","following_url":"https://api.github.com/users/westfieldlabs/following{/other_user}","gists_url":"https://api.github.com/users/westfieldlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/westfieldlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westfieldlabs/subscriptions","organizations_url":"https://api.github.com/users/westfieldlabs/orgs","repos_url":"https://api.github.com/users/westfieldlabs/repos","events_url":"https://api.github.com/users/westfieldlabs/events{/privacy}","received_events_url":"https://api.github.com/users/westfieldlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/westfieldlabs/pub_sub","description":"","fork":false,"url":"https://api.github.com/repos/westfieldlabs/pub_sub","forks_url":"https://api.github.com/repos/westfieldlabs/pub_sub/forks","keys_url":"https://api.github.com/repos/westfieldlabs/pub_sub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/westfieldlabs/pub_sub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/westfieldlabs/pub_sub/teams","hooks_url":"https://api.github.com/repos/westfieldlabs/pub_sub/hooks","issue_events_url":"https://api.github.com/repos/westfieldlabs/pub_sub/issues/events{/number}","events_url":"https://api.github.com/repos/westfieldlabs/pub_sub/events","assignees_url":"https://api.github.com/repos/westfieldlabs/pub_sub/assignees{/user}","branches_url":"https://api.github.com/repos/westfieldlabs/pub_sub/branches{/branch}","tags_url":"https://api.github.com/repos/westfieldlabs/pub_sub/tags","blobs_url":"https://api.github.com/repos/westfieldlabs/pub_sub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/westfieldlabs/pub_sub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/westfieldlabs/pub_sub/git/refs{/sha}","trees_url":"https://api.github.com/repos/westfieldlabs/pub_sub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/westfieldlabs/pub_sub/statuses/{sha}","languages_url":"https://api.github.com/repos/westfieldlabs/pub_sub/languages","stargazers_url":"https://api.github.com/repos/westfieldlabs/pub_sub/stargazers","contributors_url":"https://api.github.com/repos/westfieldlabs/pub_sub/contributors","subscribers_url":"https://api.github.com/repos/westfieldlabs/pub_sub/subscribers","subscription_url":"https://api.github.com/repos/westfieldlabs/pub_sub/subscription","commits_url":"https://api.github.com/repos/westfieldlabs/pub_sub/commits{/sha}","git_commits_url":"https://api.github.com/repos/westfieldlabs/pub_sub/git/commits{/sha}","comments_url":"https://api.github.com/repos/westfieldlabs/pub_sub/comments{/number}","issue_comment_url":"https://api.github.com/repos/westfieldlabs/pub_sub/issues/comments{/number}","contents_url":"https://api.github.com/repos/westfieldlabs/pub_sub/contents/{+path}","compare_url":"https://api.github.com/repos/westfieldlabs/pub_sub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/westfieldlabs/pub_sub/merges","archive_url":"https://api.github.com/repos/westfieldlabs/pub_sub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/westfieldlabs/pub_sub/downloads","issues_url":"https://api.github.com/repos/westfieldlabs/pub_sub/issues{/number}","pulls_url":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls{/number}","milestones_url":"https://api.github.com/repos/westfieldlabs/pub_sub/milestones{/number}","notifications_url":"https://api.github.com/repos/westfieldlabs/pub_sub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/westfieldlabs/pub_sub/labels{/name}","releases_url":"https://api.github.com/repos/westfieldlabs/pub_sub/releases{/id}","created_at":"2015-04-09T05:58:45Z","updated_at":"2015-10-22T10:50:03Z","pushed_at":"2015-10-28T18:56:20Z","git_url":"git://github.com/westfieldlabs/pub_sub.git","ssh_url":"git@github.com:westfieldlabs/pub_sub.git","clone_url":"https://github.com/westfieldlabs/pub_sub.git","svn_url":"https://github.com/westfieldlabs/pub_sub","homepage":null,"size":538,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":0,"forks":4,"open_issues":0,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/40"},"html":{"href":"https://github.com/westfieldlabs/pub_sub/pull/40"},"issue":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/issues/40"},"comments":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/westfieldlabs/pub_sub/statuses/661d600a49a30bc936e63887d1fd0c04ecb6b957"}}}}