{"action":"created","comment":{"url":"https://api.github.com/repos/EFForg/eff_fab/pulls/comments/179620075","pull_request_review_id":109901047,"id":179620075,"diff_hunk":"@@ -0,0 +1,25 @@\n+class Api::V1::MattermostController < Api::ApplicationController\n+  before_action :authenticate_mattermost\n+\n+  def create\n+    if params[:command]\n+      render json: Commands.run(command_params).response\n+    else\n+      head :unauthorized\n+    end\n+  end\n+\n+  private\n+\n+  def authenticate_mattermost\n+    head :unauthorized unless params[:token] &&\n+      params[:team_domain] &&\n+      ActiveSupport::SecurityUtils.secure_compare(\n+        params[:team_domain], ENV['MATTERMOST_DOMAIN']\n+      )","path":"app/controllers/api/v1/mattermost_controller.rb","position":19,"original_position":19,"commit_id":"728c6385e78beeb5fa77d15b066934496043a8d1","original_commit_id":"728c6385e78beeb5fa77d15b066934496043a8d1","user":{"login":"wioux","id":6469642,"avatar_url":"https://avatars3.githubusercontent.com/u/6469642?v=4","gravatar_id":"","url":"https://api.github.com/users/wioux","html_url":"https://github.com/wioux","followers_url":"https://api.github.com/users/wioux/followers","following_url":"https://api.github.com/users/wioux/following{/other_user}","gists_url":"https://api.github.com/users/wioux/gists{/gist_id}","starred_url":"https://api.github.com/users/wioux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wioux/subscriptions","organizations_url":"https://api.github.com/users/wioux/orgs","repos_url":"https://api.github.com/users/wioux/repos","events_url":"https://api.github.com/users/wioux/events{/privacy}","received_events_url":"https://api.github.com/users/wioux/received_events","type":"User","site_admin":false},"body":"We have to secure_compare `params[:token]` too right?","created_at":"2018-04-05T22:39:27Z","updated_at":"2018-04-05T22:39:28Z","html_url":"https://github.com/EFForg/eff_fab/pull/98#discussion_r179620075","pull_request_url":"https://api.github.com/repos/EFForg/eff_fab/pulls/98","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/EFForg/eff_fab/pulls/comments/179620075"},"html":{"href":"https://github.com/EFForg/eff_fab/pull/98#discussion_r179620075"},"pull_request":{"href":"https://api.github.com/repos/EFForg/eff_fab/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/EFForg/eff_fab/pulls/98","id":177216464,"html_url":"https://github.com/EFForg/eff_fab/pull/98","diff_url":"https://github.com/EFForg/eff_fab/pull/98.diff","patch_url":"https://github.com/EFForg/eff_fab/pull/98.patch","issue_url":"https://api.github.com/repos/EFForg/eff_fab/issues/98","number":98,"state":"open","locked":false,"title":"Create Mattermost commands /where and /where_is","user":{"login":"k-stewart","id":1065956,"avatar_url":"https://avatars1.githubusercontent.com/u/1065956?v=4","gravatar_id":"","url":"https://api.github.com/users/k-stewart","html_url":"https://github.com/k-stewart","followers_url":"https://api.github.com/users/k-stewart/followers","following_url":"https://api.github.com/users/k-stewart/following{/other_user}","gists_url":"https://api.github.com/users/k-stewart/gists{/gist_id}","starred_url":"https://api.github.com/users/k-stewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-stewart/subscriptions","organizations_url":"https://api.github.com/users/k-stewart/orgs","repos_url":"https://api.github.com/users/k-stewart/repos","events_url":"https://api.github.com/users/k-stewart/events{/privacy}","received_events_url":"https://api.github.com/users/k-stewart/received_events","type":"User","site_admin":false},"body":"https://github.com/EFForg/eff_fab/issues/90\r\n\r\n* A Mattermost user should create where messages with `/where`, for instance `/where WFLedge, it's super pretty out here`\r\n* A Mattermost user should retrieve a user's last where message with `/whereis`, for instance `/whereis peterw`\r\n","created_at":"2018-03-24T02:39:03Z","updated_at":"2018-04-05T22:39:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef6fe469ed91d99224fe47710b67d41b261c053a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/EFForg/eff_fab/pulls/98/commits","review_comments_url":"https://api.github.com/repos/EFForg/eff_fab/pulls/98/comments","review_comment_url":"https://api.github.com/repos/EFForg/eff_fab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EFForg/eff_fab/issues/98/comments","statuses_url":"https://api.github.com/repos/EFForg/eff_fab/statuses/728c6385e78beeb5fa77d15b066934496043a8d1","head":{"label":"EFForg:where-mattermost","ref":"where-mattermost","sha":"728c6385e78beeb5fa77d15b066934496043a8d1","user":{"login":"EFForg","id":2120271,"avatar_url":"https://avatars3.githubusercontent.com/u/2120271?v=4","gravatar_id":"","url":"https://api.github.com/users/EFForg","html_url":"https://github.com/EFForg","followers_url":"https://api.github.com/users/EFForg/followers","following_url":"https://api.github.com/users/EFForg/following{/other_user}","gists_url":"https://api.github.com/users/EFForg/gists{/gist_id}","starred_url":"https://api.github.com/users/EFForg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFForg/subscriptions","organizations_url":"https://api.github.com/users/EFForg/orgs","repos_url":"https://api.github.com/users/EFForg/repos","events_url":"https://api.github.com/users/EFForg/events{/privacy}","received_events_url":"https://api.github.com/users/EFForg/received_events","type":"Organization","site_admin":false},"repo":{"id":51047975,"name":"eff_fab","full_name":"EFForg/eff_fab","owner":{"login":"EFForg","id":2120271,"avatar_url":"https://avatars3.githubusercontent.com/u/2120271?v=4","gravatar_id":"","url":"https://api.github.com/users/EFForg","html_url":"https://github.com/EFForg","followers_url":"https://api.github.com/users/EFForg/followers","following_url":"https://api.github.com/users/EFForg/following{/other_user}","gists_url":"https://api.github.com/users/EFForg/gists{/gist_id}","starred_url":"https://api.github.com/users/EFForg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFForg/subscriptions","organizations_url":"https://api.github.com/users/EFForg/orgs","repos_url":"https://api.github.com/users/EFForg/repos","events_url":"https://api.github.com/users/EFForg/events{/privacy}","received_events_url":"https://api.github.com/users/EFForg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EFForg/eff_fab","description":null,"fork":false,"url":"https://api.github.com/repos/EFForg/eff_fab","forks_url":"https://api.github.com/repos/EFForg/eff_fab/forks","keys_url":"https://api.github.com/repos/EFForg/eff_fab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EFForg/eff_fab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EFForg/eff_fab/teams","hooks_url":"https://api.github.com/repos/EFForg/eff_fab/hooks","issue_events_url":"https://api.github.com/repos/EFForg/eff_fab/issues/events{/number}","events_url":"https://api.github.com/repos/EFForg/eff_fab/events","assignees_url":"https://api.github.com/repos/EFForg/eff_fab/assignees{/user}","branches_url":"https://api.github.com/repos/EFForg/eff_fab/branches{/branch}","tags_url":"https://api.github.com/repos/EFForg/eff_fab/tags","blobs_url":"https://api.github.com/repos/EFForg/eff_fab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EFForg/eff_fab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EFForg/eff_fab/git/refs{/sha}","trees_url":"https://api.github.com/repos/EFForg/eff_fab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EFForg/eff_fab/statuses/{sha}","languages_url":"https://api.github.com/repos/EFForg/eff_fab/languages","stargazers_url":"https://api.github.com/repos/EFForg/eff_fab/stargazers","contributors_url":"https://api.github.com/repos/EFForg/eff_fab/contributors","subscribers_url":"https://api.github.com/repos/EFForg/eff_fab/subscribers","subscription_url":"https://api.github.com/repos/EFForg/eff_fab/subscription","commits_url":"https://api.github.com/repos/EFForg/eff_fab/commits{/sha}","git_commits_url":"https://api.github.com/repos/EFForg/eff_fab/git/commits{/sha}","comments_url":"https://api.github.com/repos/EFForg/eff_fab/comments{/number}","issue_comment_url":"https://api.github.com/repos/EFForg/eff_fab/issues/comments{/number}","contents_url":"https://api.github.com/repos/EFForg/eff_fab/contents/{+path}","compare_url":"https://api.github.com/repos/EFForg/eff_fab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EFForg/eff_fab/merges","archive_url":"https://api.github.com/repos/EFForg/eff_fab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EFForg/eff_fab/downloads","issues_url":"https://api.github.com/repos/EFForg/eff_fab/issues{/number}","pulls_url":"https://api.github.com/repos/EFForg/eff_fab/pulls{/number}","milestones_url":"https://api.github.com/repos/EFForg/eff_fab/milestones{/number}","notifications_url":"https://api.github.com/repos/EFForg/eff_fab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EFForg/eff_fab/labels{/name}","releases_url":"https://api.github.com/repos/EFForg/eff_fab/releases{/id}","deployments_url":"https://api.github.com/repos/EFForg/eff_fab/deployments","created_at":"2016-02-04T02:55:56Z","updated_at":"2018-03-30T18:31:24Z","pushed_at":"2018-04-05T19:29:42Z","git_url":"git://github.com/EFForg/eff_fab.git","ssh_url":"git@github.com:EFForg/eff_fab.git","clone_url":"https://github.com/EFForg/eff_fab.git","svn_url":"https://github.com/EFForg/eff_fab","homepage":null,"size":6461,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":4,"open_issues":31,"watchers":1,"default_branch":"master"}},"base":{"label":"EFForg:master","ref":"master","sha":"dcf86d11451871326d76f35dcf44a1cbc6100bb8","user":{"login":"EFForg","id":2120271,"avatar_url":"https://avatars3.githubusercontent.com/u/2120271?v=4","gravatar_id":"","url":"https://api.github.com/users/EFForg","html_url":"https://github.com/EFForg","followers_url":"https://api.github.com/users/EFForg/followers","following_url":"https://api.github.com/users/EFForg/following{/other_user}","gists_url":"https://api.github.com/users/EFForg/gists{/gist_id}","starred_url":"https://api.github.com/users/EFForg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFForg/subscriptions","organizations_url":"https://api.github.com/users/EFForg/orgs","repos_url":"https://api.github.com/users/EFForg/repos","events_url":"https://api.github.com/users/EFForg/events{/privacy}","received_events_url":"https://api.github.com/users/EFForg/received_events","type":"Organization","site_admin":false},"repo":{"id":51047975,"name":"eff_fab","full_name":"EFForg/eff_fab","owner":{"login":"EFForg","id":2120271,"avatar_url":"https://avatars3.githubusercontent.com/u/2120271?v=4","gravatar_id":"","url":"https://api.github.com/users/EFForg","html_url":"https://github.com/EFForg","followers_url":"https://api.github.com/users/EFForg/followers","following_url":"https://api.github.com/users/EFForg/following{/other_user}","gists_url":"https://api.github.com/users/EFForg/gists{/gist_id}","starred_url":"https://api.github.com/users/EFForg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFForg/subscriptions","organizations_url":"https://api.github.com/users/EFForg/orgs","repos_url":"https://api.github.com/users/EFForg/repos","events_url":"https://api.github.com/users/EFForg/events{/privacy}","received_events_url":"https://api.github.com/users/EFForg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EFForg/eff_fab","description":null,"fork":false,"url":"https://api.github.com/repos/EFForg/eff_fab","forks_url":"https://api.github.com/repos/EFForg/eff_fab/forks","keys_url":"https://api.github.com/repos/EFForg/eff_fab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EFForg/eff_fab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EFForg/eff_fab/teams","hooks_url":"https://api.github.com/repos/EFForg/eff_fab/hooks","issue_events_url":"https://api.github.com/repos/EFForg/eff_fab/issues/events{/number}","events_url":"https://api.github.com/repos/EFForg/eff_fab/events","assignees_url":"https://api.github.com/repos/EFForg/eff_fab/assignees{/user}","branches_url":"https://api.github.com/repos/EFForg/eff_fab/branches{/branch}","tags_url":"https://api.github.com/repos/EFForg/eff_fab/tags","blobs_url":"https://api.github.com/repos/EFForg/eff_fab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EFForg/eff_fab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EFForg/eff_fab/git/refs{/sha}","trees_url":"https://api.github.com/repos/EFForg/eff_fab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EFForg/eff_fab/statuses/{sha}","languages_url":"https://api.github.com/repos/EFForg/eff_fab/languages","stargazers_url":"https://api.github.com/repos/EFForg/eff_fab/stargazers","contributors_url":"https://api.github.com/repos/EFForg/eff_fab/contributors","subscribers_url":"https://api.github.com/repos/EFForg/eff_fab/subscribers","subscription_url":"https://api.github.com/repos/EFForg/eff_fab/subscription","commits_url":"https://api.github.com/repos/EFForg/eff_fab/commits{/sha}","git_commits_url":"https://api.github.com/repos/EFForg/eff_fab/git/commits{/sha}","comments_url":"https://api.github.com/repos/EFForg/eff_fab/comments{/number}","issue_comment_url":"https://api.github.com/repos/EFForg/eff_fab/issues/comments{/number}","contents_url":"https://api.github.com/repos/EFForg/eff_fab/contents/{+path}","compare_url":"https://api.github.com/repos/EFForg/eff_fab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EFForg/eff_fab/merges","archive_url":"https://api.github.com/repos/EFForg/eff_fab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EFForg/eff_fab/downloads","issues_url":"https://api.github.com/repos/EFForg/eff_fab/issues{/number}","pulls_url":"https://api.github.com/repos/EFForg/eff_fab/pulls{/number}","milestones_url":"https://api.github.com/repos/EFForg/eff_fab/milestones{/number}","notifications_url":"https://api.github.com/repos/EFForg/eff_fab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EFForg/eff_fab/labels{/name}","releases_url":"https://api.github.com/repos/EFForg/eff_fab/releases{/id}","deployments_url":"https://api.github.com/repos/EFForg/eff_fab/deployments","created_at":"2016-02-04T02:55:56Z","updated_at":"2018-03-30T18:31:24Z","pushed_at":"2018-04-05T19:29:42Z","git_url":"git://github.com/EFForg/eff_fab.git","ssh_url":"git@github.com:EFForg/eff_fab.git","clone_url":"https://github.com/EFForg/eff_fab.git","svn_url":"https://github.com/EFForg/eff_fab","homepage":null,"size":6461,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":4,"open_issues":31,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EFForg/eff_fab/pulls/98"},"html":{"href":"https://github.com/EFForg/eff_fab/pull/98"},"issue":{"href":"https://api.github.com/repos/EFForg/eff_fab/issues/98"},"comments":{"href":"https://api.github.com/repos/EFForg/eff_fab/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/EFForg/eff_fab/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/EFForg/eff_fab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EFForg/eff_fab/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/EFForg/eff_fab/statuses/728c6385e78beeb5fa77d15b066934496043a8d1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"wioux"}}