{"action":"created","comment":{"url":"https://api.github.com/repos/gluster/glusterd2/pulls/comments/200259522","pull_request_review_id":134538381,"id":200259522,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDI1OTUyMg==","diff_hunk":"@@ -154,3 +162,66 @@ func (h *handler) Handle(e *api.Event) {\n func (h *handler) Events() []string {\n \treturn h.events\n }\n+\n+func getJWTToken(eventtype, secret string) string {\n+\tclaims := &jwt.StandardClaims{\n+\t\tIssuedAt:  time.Now().Unix(),\n+\t\tExpiresAt: time.Now().Add(time.Second * 10).Unix(),\n+\t\tSubject:   eventtype,\n+\t}\n+\n+\ttoken := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)\n+\tss, err := token.SignedString([]byte(secret))\n+\tif err != nil {\n+\t\treturn \"\"\n+\t}\n+\treturn ss\n+}\n+\n+//WebhookPublish sends event to registered webhooks\n+func WebhookPublish(webhook *eventsapi.Webhook, e *api.Event) error {\n+\tmessage, err := json.Marshal(e)\n+\tif err != nil {\n+\t\tlog.WithError(err).Error(\"failed to marshal event\")","path":"glusterd2/events/eventhandler.go","position":44,"original_position":44,"commit_id":"57428c99ca1df86c2f39c3aa8549c0de41cd46a5","original_commit_id":"57428c99ca1df86c2f39c3aa8549c0de41cd46a5","user":{"login":"Madhu-1","id":18114231,"node_id":"MDQ6VXNlcjE4MTE0MjMx","avatar_url":"https://avatars2.githubusercontent.com/u/18114231?v=4","gravatar_id":"","url":"https://api.github.com/users/Madhu-1","html_url":"https://github.com/Madhu-1","followers_url":"https://api.github.com/users/Madhu-1/followers","following_url":"https://api.github.com/users/Madhu-1/following{/other_user}","gists_url":"https://api.github.com/users/Madhu-1/gists{/gist_id}","starred_url":"https://api.github.com/users/Madhu-1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Madhu-1/subscriptions","organizations_url":"https://api.github.com/users/Madhu-1/orgs","repos_url":"https://api.github.com/users/Madhu-1/repos","events_url":"https://api.github.com/users/Madhu-1/events{/privacy}","received_events_url":"https://api.github.com/users/Madhu-1/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-07-05T07:48:45Z","updated_at":"2018-07-05T07:48:45Z","html_url":"https://github.com/gluster/glusterd2/pull/942#discussion_r200259522","pull_request_url":"https://api.github.com/repos/gluster/glusterd2/pulls/942","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/comments/200259522"},"html":{"href":"https://github.com/gluster/glusterd2/pull/942#discussion_r200259522"},"pull_request":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/942"}},"in_reply_to_id":200243668},"pull_request":{"url":"https://api.github.com/repos/gluster/glusterd2/pulls/942","id":198264459,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MjY0NDU5","html_url":"https://github.com/gluster/glusterd2/pull/942","diff_url":"https://github.com/gluster/glusterd2/pull/942.diff","patch_url":"https://github.com/gluster/glusterd2/pull/942.patch","issue_url":"https://api.github.com/repos/gluster/glusterd2/issues/942","number":942,"state":"open","locked":false,"title":"Events API enhancements","user":{"login":"Madhu-1","id":18114231,"node_id":"MDQ6VXNlcjE4MTE0MjMx","avatar_url":"https://avatars2.githubusercontent.com/u/18114231?v=4","gravatar_id":"","url":"https://api.github.com/users/Madhu-1","html_url":"https://github.com/Madhu-1","followers_url":"https://api.github.com/users/Madhu-1/followers","following_url":"https://api.github.com/users/Madhu-1/following{/other_user}","gists_url":"https://api.github.com/users/Madhu-1/gists{/gist_id}","starred_url":"https://api.github.com/users/Madhu-1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Madhu-1/subscriptions","organizations_url":"https://api.github.com/users/Madhu-1/orgs","repos_url":"https://api.github.com/users/Madhu-1/repos","events_url":"https://api.github.com/users/Madhu-1/events{/privacy}","received_events_url":"https://api.github.com/users/Madhu-1/received_events","type":"User","site_admin":false},"body":"Partial #921 \r\n\r\nSigned-off-by: Madhu Rajanna <mrajanna@redhat.com>","created_at":"2018-06-29T09:34:54Z","updated_at":"2018-07-05T07:48:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9041e9783970554bc27c25a2051a0a0c0366214","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gluster/glusterd2/pulls/942/commits","review_comments_url":"https://api.github.com/repos/gluster/glusterd2/pulls/942/comments","review_comment_url":"https://api.github.com/repos/gluster/glusterd2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gluster/glusterd2/issues/942/comments","statuses_url":"https://api.github.com/repos/gluster/glusterd2/statuses/71960769d0f3854dee3ce64b653c8652b8cf4715","head":{"label":"Madhu-1:issue_921","ref":"issue_921","sha":"71960769d0f3854dee3ce64b653c8652b8cf4715","user":{"login":"Madhu-1","id":18114231,"node_id":"MDQ6VXNlcjE4MTE0MjMx","avatar_url":"https://avatars2.githubusercontent.com/u/18114231?v=4","gravatar_id":"","url":"https://api.github.com/users/Madhu-1","html_url":"https://github.com/Madhu-1","followers_url":"https://api.github.com/users/Madhu-1/followers","following_url":"https://api.github.com/users/Madhu-1/following{/other_user}","gists_url":"https://api.github.com/users/Madhu-1/gists{/gist_id}","starred_url":"https://api.github.com/users/Madhu-1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Madhu-1/subscriptions","organizations_url":"https://api.github.com/users/Madhu-1/orgs","repos_url":"https://api.github.com/users/Madhu-1/repos","events_url":"https://api.github.com/users/Madhu-1/events{/privacy}","received_events_url":"https://api.github.com/users/Madhu-1/received_events","type":"User","site_admin":false},"repo":{"id":130645136,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA2NDUxMzY=","name":"glusterd2","full_name":"Madhu-1/glusterd2","owner":{"login":"Madhu-1","id":18114231,"node_id":"MDQ6VXNlcjE4MTE0MjMx","avatar_url":"https://avatars2.githubusercontent.com/u/18114231?v=4","gravatar_id":"","url":"https://api.github.com/users/Madhu-1","html_url":"https://github.com/Madhu-1","followers_url":"https://api.github.com/users/Madhu-1/followers","following_url":"https://api.github.com/users/Madhu-1/following{/other_user}","gists_url":"https://api.github.com/users/Madhu-1/gists{/gist_id}","starred_url":"https://api.github.com/users/Madhu-1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Madhu-1/subscriptions","organizations_url":"https://api.github.com/users/Madhu-1/orgs","repos_url":"https://api.github.com/users/Madhu-1/repos","events_url":"https://api.github.com/users/Madhu-1/events{/privacy}","received_events_url":"https://api.github.com/users/Madhu-1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Madhu-1/glusterd2","description":"GlusterD-2.0 is the distributed management framework to be used for GlusterFS-4.0","fork":true,"url":"https://api.github.com/repos/Madhu-1/glusterd2","forks_url":"https://api.github.com/repos/Madhu-1/glusterd2/forks","keys_url":"https://api.github.com/repos/Madhu-1/glusterd2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Madhu-1/glusterd2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Madhu-1/glusterd2/teams","hooks_url":"https://api.github.com/repos/Madhu-1/glusterd2/hooks","issue_events_url":"https://api.github.com/repos/Madhu-1/glusterd2/issues/events{/number}","events_url":"https://api.github.com/repos/Madhu-1/glusterd2/events","assignees_url":"https://api.github.com/repos/Madhu-1/glusterd2/assignees{/user}","branches_url":"https://api.github.com/repos/Madhu-1/glusterd2/branches{/branch}","tags_url":"https://api.github.com/repos/Madhu-1/glusterd2/tags","blobs_url":"https://api.github.com/repos/Madhu-1/glusterd2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Madhu-1/glusterd2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Madhu-1/glusterd2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Madhu-1/glusterd2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Madhu-1/glusterd2/statuses/{sha}","languages_url":"https://api.github.com/repos/Madhu-1/glusterd2/languages","stargazers_url":"https://api.github.com/repos/Madhu-1/glusterd2/stargazers","contributors_url":"https://api.github.com/repos/Madhu-1/glusterd2/contributors","subscribers_url":"https://api.github.com/repos/Madhu-1/glusterd2/subscribers","subscription_url":"https://api.github.com/repos/Madhu-1/glusterd2/subscription","commits_url":"https://api.github.com/repos/Madhu-1/glusterd2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Madhu-1/glusterd2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Madhu-1/glusterd2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Madhu-1/glusterd2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Madhu-1/glusterd2/contents/{+path}","compare_url":"https://api.github.com/repos/Madhu-1/glusterd2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Madhu-1/glusterd2/merges","archive_url":"https://api.github.com/repos/Madhu-1/glusterd2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Madhu-1/glusterd2/downloads","issues_url":"https://api.github.com/repos/Madhu-1/glusterd2/issues{/number}","pulls_url":"https://api.github.com/repos/Madhu-1/glusterd2/pulls{/number}","milestones_url":"https://api.github.com/repos/Madhu-1/glusterd2/milestones{/number}","notifications_url":"https://api.github.com/repos/Madhu-1/glusterd2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Madhu-1/glusterd2/labels{/name}","releases_url":"https://api.github.com/repos/Madhu-1/glusterd2/releases{/id}","deployments_url":"https://api.github.com/repos/Madhu-1/glusterd2/deployments","created_at":"2018-04-23T05:37:08Z","updated_at":"2018-04-23T05:37:10Z","pushed_at":"2018-07-05T07:48:44Z","git_url":"git://github.com/Madhu-1/glusterd2.git","ssh_url":"git@github.com:Madhu-1/glusterd2.git","clone_url":"https://github.com/Madhu-1/glusterd2.git","svn_url":"https://github.com/Madhu-1/glusterd2","homepage":"","size":12666,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gluster:master","ref":"master","sha":"859ad70fbd16eb14c1f255f59a4df5e19e16f8d7","user":{"login":"gluster","id":622644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMjY0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/622644?v=4","gravatar_id":"","url":"https://api.github.com/users/gluster","html_url":"https://github.com/gluster","followers_url":"https://api.github.com/users/gluster/followers","following_url":"https://api.github.com/users/gluster/following{/other_user}","gists_url":"https://api.github.com/users/gluster/gists{/gist_id}","starred_url":"https://api.github.com/users/gluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluster/subscriptions","organizations_url":"https://api.github.com/users/gluster/orgs","repos_url":"https://api.github.com/users/gluster/repos","events_url":"https://api.github.com/users/gluster/events{/privacy}","received_events_url":"https://api.github.com/users/gluster/received_events","type":"Organization","site_admin":false},"repo":{"id":24369600,"node_id":"MDEwOlJlcG9zaXRvcnkyNDM2OTYwMA==","name":"glusterd2","full_name":"gluster/glusterd2","owner":{"login":"gluster","id":622644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMjY0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/622644?v=4","gravatar_id":"","url":"https://api.github.com/users/gluster","html_url":"https://github.com/gluster","followers_url":"https://api.github.com/users/gluster/followers","following_url":"https://api.github.com/users/gluster/following{/other_user}","gists_url":"https://api.github.com/users/gluster/gists{/gist_id}","starred_url":"https://api.github.com/users/gluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluster/subscriptions","organizations_url":"https://api.github.com/users/gluster/orgs","repos_url":"https://api.github.com/users/gluster/repos","events_url":"https://api.github.com/users/gluster/events{/privacy}","received_events_url":"https://api.github.com/users/gluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gluster/glusterd2","description":"GlusterD-2.0 is the distributed management framework to be used for GlusterFS-4.0","fork":false,"url":"https://api.github.com/repos/gluster/glusterd2","forks_url":"https://api.github.com/repos/gluster/glusterd2/forks","keys_url":"https://api.github.com/repos/gluster/glusterd2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gluster/glusterd2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gluster/glusterd2/teams","hooks_url":"https://api.github.com/repos/gluster/glusterd2/hooks","issue_events_url":"https://api.github.com/repos/gluster/glusterd2/issues/events{/number}","events_url":"https://api.github.com/repos/gluster/glusterd2/events","assignees_url":"https://api.github.com/repos/gluster/glusterd2/assignees{/user}","branches_url":"https://api.github.com/repos/gluster/glusterd2/branches{/branch}","tags_url":"https://api.github.com/repos/gluster/glusterd2/tags","blobs_url":"https://api.github.com/repos/gluster/glusterd2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gluster/glusterd2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gluster/glusterd2/git/refs{/sha}","trees_url":"https://api.github.com/repos/gluster/glusterd2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gluster/glusterd2/statuses/{sha}","languages_url":"https://api.github.com/repos/gluster/glusterd2/languages","stargazers_url":"https://api.github.com/repos/gluster/glusterd2/stargazers","contributors_url":"https://api.github.com/repos/gluster/glusterd2/contributors","subscribers_url":"https://api.github.com/repos/gluster/glusterd2/subscribers","subscription_url":"https://api.github.com/repos/gluster/glusterd2/subscription","commits_url":"https://api.github.com/repos/gluster/glusterd2/commits{/sha}","git_commits_url":"https://api.github.com/repos/gluster/glusterd2/git/commits{/sha}","comments_url":"https://api.github.com/repos/gluster/glusterd2/comments{/number}","issue_comment_url":"https://api.github.com/repos/gluster/glusterd2/issues/comments{/number}","contents_url":"https://api.github.com/repos/gluster/glusterd2/contents/{+path}","compare_url":"https://api.github.com/repos/gluster/glusterd2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gluster/glusterd2/merges","archive_url":"https://api.github.com/repos/gluster/glusterd2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gluster/glusterd2/downloads","issues_url":"https://api.github.com/repos/gluster/glusterd2/issues{/number}","pulls_url":"https://api.github.com/repos/gluster/glusterd2/pulls{/number}","milestones_url":"https://api.github.com/repos/gluster/glusterd2/milestones{/number}","notifications_url":"https://api.github.com/repos/gluster/glusterd2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gluster/glusterd2/labels{/name}","releases_url":"https://api.github.com/repos/gluster/glusterd2/releases{/id}","deployments_url":"https://api.github.com/repos/gluster/glusterd2/deployments","created_at":"2014-09-23T12:02:13Z","updated_at":"2018-07-04T07:21:25Z","pushed_at":"2018-07-05T07:28:13Z","git_url":"git://github.com/gluster/glusterd2.git","ssh_url":"git@github.com:gluster/glusterd2.git","clone_url":"https://github.com/gluster/glusterd2.git","svn_url":"https://github.com/gluster/glusterd2","homepage":"","size":12673,"stargazers_count":93,"watchers_count":93,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":58,"mirror_url":null,"archived":false,"open_issues_count":155,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":58,"open_issues":155,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/942"},"html":{"href":"https://github.com/gluster/glusterd2/pull/942"},"issue":{"href":"https://api.github.com/repos/gluster/glusterd2/issues/942"},"comments":{"href":"https://api.github.com/repos/gluster/glusterd2/issues/942/comments"},"review_comments":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/942/comments"},"review_comment":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/942/commits"},"statuses":{"href":"https://api.github.com/repos/gluster/glusterd2/statuses/71960769d0f3854dee3ce64b653c8652b8cf4715"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Madhu-1"}}