{"action":"created","issue":{"url":"https://api.github.com/repos/zapier/zapier-platform-cli/issues/295","repository_url":"https://api.github.com/repos/zapier/zapier-platform-cli","labels_url":"https://api.github.com/repos/zapier/zapier-platform-cli/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/zapier/zapier-platform-cli/issues/295/comments","events_url":"https://api.github.com/repos/zapier/zapier-platform-cli/issues/295/events","html_url":"https://github.com/zapier/zapier-platform-cli/issues/295","id":313083312,"node_id":"MDU6SXNzdWUzMTMwODMzMTI=","number":295,"title":"For hooks, provide access to bundle.subscribeData in perform function","user":{"login":"jstlaurent","id":1054140,"node_id":"MDQ6VXNlcjEwNTQxNDA=","avatar_url":"https://avatars0.githubusercontent.com/u/1054140?v=4","gravatar_id":"","url":"https://api.github.com/users/jstlaurent","html_url":"https://github.com/jstlaurent","followers_url":"https://api.github.com/users/jstlaurent/followers","following_url":"https://api.github.com/users/jstlaurent/following{/other_user}","gists_url":"https://api.github.com/users/jstlaurent/gists{/gist_id}","starred_url":"https://api.github.com/users/jstlaurent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstlaurent/subscriptions","organizations_url":"https://api.github.com/users/jstlaurent/orgs","repos_url":"https://api.github.com/users/jstlaurent/repos","events_url":"https://api.github.com/users/jstlaurent/events{/privacy}","received_events_url":"https://api.github.com/users/jstlaurent/received_events","type":"User","site_admin":false},"labels":[{"id":469576261,"node_id":"MDU6TGFiZWw0Njk1NzYyNjE=","url":"https://api.github.com/repos/zapier/zapier-platform-cli/labels/Feature%20Request","name":"Feature Request","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-10T20:47:30Z","updated_at":"2018-08-08T11:05:28Z","closed_at":null,"author_association":"NONE","body":"## What would you like to change?\r\nThe *bundle.subscribeData* object is available in the **performUnsubscribe** function defined on *hook* operations. It makes it easy to keep a reference on the hook to be deleted.\r\n\r\nIt might also be useful to have it accessible in the **perform** function. In my particular use case, my platform generates a unique token when the webhook is registered, that allows clients to validate the origin of requests. It would be stored in *bundle.subscribeData*. I would like to be able to do something like this in my **perform** function:\r\n\r\n```\r\nconst getMyThing = (z, bundle) => {\r\n    const {instance, token} = bundle.cleanedRequest;\r\n    if (token !== bundle.subscribeData.token) {\r\n        throw new Error(`Validation token '${token}' is not the expected value.`);\r\n    }\r\n    return [instance];\r\n}\r\n```\r\n\r\n## Your Environment\r\n* CLI Version (`zapier -v`): zapier-platform-cli/5.1.0, zapier-platform-core/5.1.0, node/v6.10.3\r\n* Operating System and version: MacOS 10.13.4\r\n"},"comment":{"url":"https://api.github.com/repos/zapier/zapier-platform-cli/issues/comments/411369188","html_url":"https://github.com/zapier/zapier-platform-cli/issues/295#issuecomment-411369188","issue_url":"https://api.github.com/repos/zapier/zapier-platform-cli/issues/295","id":411369188,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTM2OTE4OA==","user":{"login":"aPoCoMiLogin","id":493369,"node_id":"MDQ6VXNlcjQ5MzM2OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/493369?v=4","gravatar_id":"","url":"https://api.github.com/users/aPoCoMiLogin","html_url":"https://github.com/aPoCoMiLogin","followers_url":"https://api.github.com/users/aPoCoMiLogin/followers","following_url":"https://api.github.com/users/aPoCoMiLogin/following{/other_user}","gists_url":"https://api.github.com/users/aPoCoMiLogin/gists{/gist_id}","starred_url":"https://api.github.com/users/aPoCoMiLogin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aPoCoMiLogin/subscriptions","organizations_url":"https://api.github.com/users/aPoCoMiLogin/orgs","repos_url":"https://api.github.com/users/aPoCoMiLogin/repos","events_url":"https://api.github.com/users/aPoCoMiLogin/events{/privacy}","received_events_url":"https://api.github.com/users/aPoCoMiLogin/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T11:05:28Z","updated_at":"2018-08-08T11:05:28Z","author_association":"NONE","body":"Any news on it? Also, would be nice to have it documented."}}
{"actor":{"display_login":"aPoCoMiLogin"}}