{"action":"closed","number":507,"pull_request":{"url":"https://api.github.com/repos/arsduo/koala/pulls/507","id":59542485,"html_url":"https://github.com/arsduo/koala/pull/507","diff_url":"https://github.com/arsduo/koala/pull/507.diff","patch_url":"https://github.com/arsduo/koala/pull/507.patch","issue_url":"https://api.github.com/repos/arsduo/koala/issues/507","number":507,"state":"closed","locked":false,"title":"Provide appsecret_proof in batch calls with different access tokens","user":{"login":"mwpastore","id":8540936,"avatar_url":"https://avatars.githubusercontent.com/u/8540936?v=3","gravatar_id":"","url":"https://api.github.com/users/mwpastore","html_url":"https://github.com/mwpastore","followers_url":"https://api.github.com/users/mwpastore/followers","following_url":"https://api.github.com/users/mwpastore/following{/other_user}","gists_url":"https://api.github.com/users/mwpastore/gists{/gist_id}","starred_url":"https://api.github.com/users/mwpastore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwpastore/subscriptions","organizations_url":"https://api.github.com/users/mwpastore/orgs","repos_url":"https://api.github.com/users/mwpastore/repos","events_url":"https://api.github.com/users/mwpastore/events{/privacy}","received_events_url":"https://api.github.com/users/mwpastore/received_events","type":"User","site_admin":false},"body":"Hi Alex, this is my first, clumsy attempt at a fix for an issue I'm having with batched requests. I'm sure you're going to find lots of ducks, so just let me know what I missed and how you'd like this to be implemented.\r\n\r\nConsider the following scenario: I have three users and three access tokens for those users, and I want to make a single batch call to get an endpoint for each user using the corresponding access token. Let's say I want to get some private elements of the user's info to which the user has granted my app permission. The batch would look something like this:\r\n\r\n```ruby\r\n[{\"method\"=>\"get\",\r\n  \"relative_url\"=>\"1?fields=location&access_token=foo\"},\r\n {\"method\"=>\"get\",\r\n  \"relative_url\"=>\"2?fields=location&access_token=bar\"},\r\n {\"method\"=>\"get\",\r\n  \"relative_url\"=>\"3?fields=location&access_token=qux\"}]\r\n```\r\n\r\nHowever, Facebook requires appsecret_proof for these endpoints, and to the best of my knowledge it's not sufficient to provide it once for the entire batch. You have to sign each access token individually with the app_secret and embed it in the relative URL. This is the only way I've been able to get it work in PHP, and now in Ruby:\r\n\r\n```ruby\r\n[{\"method\"=>\"get\",\r\n  \"relative_url\"=>\"1?fields=location&access_token=foo&appsecret_proof=fooprime\"},\r\n {\"method\"=>\"get\",\r\n  \"relative_url\"=>\"2?fields=location&access_token=bar&appsecret_proof=barprime\"},\r\n {\"method\"=>\"get\",\r\n  \"relative_url\"=>\"3?fields=location&access_token=qux&appsecret_proof=quxprime\"}]\r\n```\r\n\r\nThis patch attempts to detect when a BatchOperation has its own access_token (per the existing logic) and sign each access token with the app_secret if available.\r\n\r\nThanks in advance for your time.","created_at":"2016-02-16T19:39:20Z","updated_at":"2016-04-10T16:04:16Z","closed_at":"2016-04-10T16:04:16Z","merged_at":"2016-04-10T16:04:16Z","merge_commit_sha":"36fccbddee319a780ad6fbd1ea0d921c0bdeeb87","assignee":{"login":"arsduo","id":48325,"avatar_url":"https://avatars.githubusercontent.com/u/48325?v=3","gravatar_id":"","url":"https://api.github.com/users/arsduo","html_url":"https://github.com/arsduo","followers_url":"https://api.github.com/users/arsduo/followers","following_url":"https://api.github.com/users/arsduo/following{/other_user}","gists_url":"https://api.github.com/users/arsduo/gists{/gist_id}","starred_url":"https://api.github.com/users/arsduo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arsduo/subscriptions","organizations_url":"https://api.github.com/users/arsduo/orgs","repos_url":"https://api.github.com/users/arsduo/repos","events_url":"https://api.github.com/users/arsduo/events{/privacy}","received_events_url":"https://api.github.com/users/arsduo/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/arsduo/koala/milestones/8","html_url":"https://github.com/arsduo/koala/milestones/Koala%202.4","labels_url":"https://api.github.com/repos/arsduo/koala/milestones/8/labels","id":1696104,"number":8,"title":"Koala 2.4","description":null,"creator":{"login":"arsduo","id":48325,"avatar_url":"https://avatars.githubusercontent.com/u/48325?v=3","gravatar_id":"","url":"https://api.github.com/users/arsduo","html_url":"https://github.com/arsduo","followers_url":"https://api.github.com/users/arsduo/followers","following_url":"https://api.github.com/users/arsduo/following{/other_user}","gists_url":"https://api.github.com/users/arsduo/gists{/gist_id}","starred_url":"https://api.github.com/users/arsduo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arsduo/subscriptions","organizations_url":"https://api.github.com/users/arsduo/orgs","repos_url":"https://api.github.com/users/arsduo/repos","events_url":"https://api.github.com/users/arsduo/events{/privacy}","received_events_url":"https://api.github.com/users/arsduo/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2016-04-10T15:22:38Z","updated_at":"2016-04-10T16:04:16Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/arsduo/koala/pulls/507/commits","review_comments_url":"https://api.github.com/repos/arsduo/koala/pulls/507/comments","review_comment_url":"https://api.github.com/repos/arsduo/koala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arsduo/koala/issues/507/comments","statuses_url":"https://api.github.com/repos/arsduo/koala/statuses/5781ac36a5bdf023e239c59e53734b5d7ffd56e4","head":{"label":"mwpastore:batch-appsecret-proof","ref":"batch-appsecret-proof","sha":"5781ac36a5bdf023e239c59e53734b5d7ffd56e4","user":{"login":"mwpastore","id":8540936,"avatar_url":"https://avatars.githubusercontent.com/u/8540936?v=3","gravatar_id":"","url":"https://api.github.com/users/mwpastore","html_url":"https://github.com/mwpastore","followers_url":"https://api.github.com/users/mwpastore/followers","following_url":"https://api.github.com/users/mwpastore/following{/other_user}","gists_url":"https://api.github.com/users/mwpastore/gists{/gist_id}","starred_url":"https://api.github.com/users/mwpastore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwpastore/subscriptions","organizations_url":"https://api.github.com/users/mwpastore/orgs","repos_url":"https://api.github.com/users/mwpastore/repos","events_url":"https://api.github.com/users/mwpastore/events{/privacy}","received_events_url":"https://api.github.com/users/mwpastore/received_events","type":"User","site_admin":false},"repo":{"id":51858104,"name":"koala","full_name":"mwpastore/koala","owner":{"login":"mwpastore","id":8540936,"avatar_url":"https://avatars.githubusercontent.com/u/8540936?v=3","gravatar_id":"","url":"https://api.github.com/users/mwpastore","html_url":"https://github.com/mwpastore","followers_url":"https://api.github.com/users/mwpastore/followers","following_url":"https://api.github.com/users/mwpastore/following{/other_user}","gists_url":"https://api.github.com/users/mwpastore/gists{/gist_id}","starred_url":"https://api.github.com/users/mwpastore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwpastore/subscriptions","organizations_url":"https://api.github.com/users/mwpastore/orgs","repos_url":"https://api.github.com/users/mwpastore/repos","events_url":"https://api.github.com/users/mwpastore/events{/privacy}","received_events_url":"https://api.github.com/users/mwpastore/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mwpastore/koala","description":"A lightweight, flexible library for Facebook with support for OAuth authentication, the Graph and REST APIs, realtime updates, and test users.","fork":true,"url":"https://api.github.com/repos/mwpastore/koala","forks_url":"https://api.github.com/repos/mwpastore/koala/forks","keys_url":"https://api.github.com/repos/mwpastore/koala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mwpastore/koala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mwpastore/koala/teams","hooks_url":"https://api.github.com/repos/mwpastore/koala/hooks","issue_events_url":"https://api.github.com/repos/mwpastore/koala/issues/events{/number}","events_url":"https://api.github.com/repos/mwpastore/koala/events","assignees_url":"https://api.github.com/repos/mwpastore/koala/assignees{/user}","branches_url":"https://api.github.com/repos/mwpastore/koala/branches{/branch}","tags_url":"https://api.github.com/repos/mwpastore/koala/tags","blobs_url":"https://api.github.com/repos/mwpastore/koala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mwpastore/koala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mwpastore/koala/git/refs{/sha}","trees_url":"https://api.github.com/repos/mwpastore/koala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mwpastore/koala/statuses/{sha}","languages_url":"https://api.github.com/repos/mwpastore/koala/languages","stargazers_url":"https://api.github.com/repos/mwpastore/koala/stargazers","contributors_url":"https://api.github.com/repos/mwpastore/koala/contributors","subscribers_url":"https://api.github.com/repos/mwpastore/koala/subscribers","subscription_url":"https://api.github.com/repos/mwpastore/koala/subscription","commits_url":"https://api.github.com/repos/mwpastore/koala/commits{/sha}","git_commits_url":"https://api.github.com/repos/mwpastore/koala/git/commits{/sha}","comments_url":"https://api.github.com/repos/mwpastore/koala/comments{/number}","issue_comment_url":"https://api.github.com/repos/mwpastore/koala/issues/comments{/number}","contents_url":"https://api.github.com/repos/mwpastore/koala/contents/{+path}","compare_url":"https://api.github.com/repos/mwpastore/koala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mwpastore/koala/merges","archive_url":"https://api.github.com/repos/mwpastore/koala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mwpastore/koala/downloads","issues_url":"https://api.github.com/repos/mwpastore/koala/issues{/number}","pulls_url":"https://api.github.com/repos/mwpastore/koala/pulls{/number}","milestones_url":"https://api.github.com/repos/mwpastore/koala/milestones{/number}","notifications_url":"https://api.github.com/repos/mwpastore/koala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mwpastore/koala/labels{/name}","releases_url":"https://api.github.com/repos/mwpastore/koala/releases{/id}","deployments_url":"https://api.github.com/repos/mwpastore/koala/deployments","created_at":"2016-02-16T18:25:40Z","updated_at":"2016-02-16T18:25:41Z","pushed_at":"2016-04-01T15:58:40Z","git_url":"git://github.com/mwpastore/koala.git","ssh_url":"git@github.com:mwpastore/koala.git","clone_url":"https://github.com/mwpastore/koala.git","svn_url":"https://github.com/mwpastore/koala","homepage":"http://developers.facebook.com/","size":2133,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"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":"arsduo:master","ref":"master","sha":"f38492bb2397cb38dda3d57612df5f0b0c3ddc65","user":{"login":"arsduo","id":48325,"avatar_url":"https://avatars.githubusercontent.com/u/48325?v=3","gravatar_id":"","url":"https://api.github.com/users/arsduo","html_url":"https://github.com/arsduo","followers_url":"https://api.github.com/users/arsduo/followers","following_url":"https://api.github.com/users/arsduo/following{/other_user}","gists_url":"https://api.github.com/users/arsduo/gists{/gist_id}","starred_url":"https://api.github.com/users/arsduo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arsduo/subscriptions","organizations_url":"https://api.github.com/users/arsduo/orgs","repos_url":"https://api.github.com/users/arsduo/repos","events_url":"https://api.github.com/users/arsduo/events{/privacy}","received_events_url":"https://api.github.com/users/arsduo/received_events","type":"User","site_admin":false},"repo":{"id":623018,"name":"koala","full_name":"arsduo/koala","owner":{"login":"arsduo","id":48325,"avatar_url":"https://avatars.githubusercontent.com/u/48325?v=3","gravatar_id":"","url":"https://api.github.com/users/arsduo","html_url":"https://github.com/arsduo","followers_url":"https://api.github.com/users/arsduo/followers","following_url":"https://api.github.com/users/arsduo/following{/other_user}","gists_url":"https://api.github.com/users/arsduo/gists{/gist_id}","starred_url":"https://api.github.com/users/arsduo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arsduo/subscriptions","organizations_url":"https://api.github.com/users/arsduo/orgs","repos_url":"https://api.github.com/users/arsduo/repos","events_url":"https://api.github.com/users/arsduo/events{/privacy}","received_events_url":"https://api.github.com/users/arsduo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arsduo/koala","description":"A lightweight, flexible library for Facebook with support for OAuth authentication, the Graph and REST APIs, realtime updates, and test users.","fork":false,"url":"https://api.github.com/repos/arsduo/koala","forks_url":"https://api.github.com/repos/arsduo/koala/forks","keys_url":"https://api.github.com/repos/arsduo/koala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arsduo/koala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arsduo/koala/teams","hooks_url":"https://api.github.com/repos/arsduo/koala/hooks","issue_events_url":"https://api.github.com/repos/arsduo/koala/issues/events{/number}","events_url":"https://api.github.com/repos/arsduo/koala/events","assignees_url":"https://api.github.com/repos/arsduo/koala/assignees{/user}","branches_url":"https://api.github.com/repos/arsduo/koala/branches{/branch}","tags_url":"https://api.github.com/repos/arsduo/koala/tags","blobs_url":"https://api.github.com/repos/arsduo/koala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arsduo/koala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arsduo/koala/git/refs{/sha}","trees_url":"https://api.github.com/repos/arsduo/koala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arsduo/koala/statuses/{sha}","languages_url":"https://api.github.com/repos/arsduo/koala/languages","stargazers_url":"https://api.github.com/repos/arsduo/koala/stargazers","contributors_url":"https://api.github.com/repos/arsduo/koala/contributors","subscribers_url":"https://api.github.com/repos/arsduo/koala/subscribers","subscription_url":"https://api.github.com/repos/arsduo/koala/subscription","commits_url":"https://api.github.com/repos/arsduo/koala/commits{/sha}","git_commits_url":"https://api.github.com/repos/arsduo/koala/git/commits{/sha}","comments_url":"https://api.github.com/repos/arsduo/koala/comments{/number}","issue_comment_url":"https://api.github.com/repos/arsduo/koala/issues/comments{/number}","contents_url":"https://api.github.com/repos/arsduo/koala/contents/{+path}","compare_url":"https://api.github.com/repos/arsduo/koala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arsduo/koala/merges","archive_url":"https://api.github.com/repos/arsduo/koala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arsduo/koala/downloads","issues_url":"https://api.github.com/repos/arsduo/koala/issues{/number}","pulls_url":"https://api.github.com/repos/arsduo/koala/pulls{/number}","milestones_url":"https://api.github.com/repos/arsduo/koala/milestones{/number}","notifications_url":"https://api.github.com/repos/arsduo/koala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arsduo/koala/labels{/name}","releases_url":"https://api.github.com/repos/arsduo/koala/releases{/id}","deployments_url":"https://api.github.com/repos/arsduo/koala/deployments","created_at":"2010-04-22T07:14:55Z","updated_at":"2016-04-09T17:16:53Z","pushed_at":"2016-04-10T16:04:16Z","git_url":"git://github.com/arsduo/koala.git","ssh_url":"git@github.com:arsduo/koala.git","clone_url":"https://github.com/arsduo/koala.git","svn_url":"https://github.com/arsduo/koala","homepage":"http://developers.facebook.com/","size":2183,"stargazers_count":2929,"watchers_count":2929,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":392,"mirror_url":null,"open_issues_count":72,"forks":392,"open_issues":72,"watchers":2929,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arsduo/koala/pulls/507"},"html":{"href":"https://github.com/arsduo/koala/pull/507"},"issue":{"href":"https://api.github.com/repos/arsduo/koala/issues/507"},"comments":{"href":"https://api.github.com/repos/arsduo/koala/issues/507/comments"},"review_comments":{"href":"https://api.github.com/repos/arsduo/koala/pulls/507/comments"},"review_comment":{"href":"https://api.github.com/repos/arsduo/koala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arsduo/koala/pulls/507/commits"},"statuses":{"href":"https://api.github.com/repos/arsduo/koala/statuses/5781ac36a5bdf023e239c59e53734b5d7ffd56e4"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"arsduo","id":48325,"avatar_url":"https://avatars.githubusercontent.com/u/48325?v=3","gravatar_id":"","url":"https://api.github.com/users/arsduo","html_url":"https://github.com/arsduo","followers_url":"https://api.github.com/users/arsduo/followers","following_url":"https://api.github.com/users/arsduo/following{/other_user}","gists_url":"https://api.github.com/users/arsduo/gists{/gist_id}","starred_url":"https://api.github.com/users/arsduo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arsduo/subscriptions","organizations_url":"https://api.github.com/users/arsduo/orgs","repos_url":"https://api.github.com/users/arsduo/repos","events_url":"https://api.github.com/users/arsduo/events{/privacy}","received_events_url":"https://api.github.com/users/arsduo/received_events","type":"User","site_admin":false},"comments":2,"review_comments":5,"commits":1,"additions":33,"deletions":22,"changed_files":3}}