{"action":"created","comment":{"url":"https://api.github.com/repos/workato/connector_sdk/pulls/comments/82530383","pull_request_review_id":3432309,"id":82530383,"diff_hunk":"@@ -0,0 +1,143 @@\n+{\n+  title: 'Splunk',\n+  secure_tunnel: true,\n+\n+  connection: {\n+    fields: [\n+      {\n+        name: 'server_url',\n+        label: 'Server URL',\n+        control_type: 'text',\n+        hint: 'The URL of the Splunk management port (e.g. https://yourdomain:8089). You MUST install the <a href=\"https://splunkbase.splunk.com/apps/#/search/workato\">Workato Add-on for Splunk</a> first.'\n+      },\n+      {\n+        name: 'username',\n+        hint: 'The Splunk username (e.g. admin)'\n+      },\n+      {\n+        name: 'password',\n+        control_type: 'password',\n+        hint: 'The password for the Splunk username'\n+      }\n+    ],\n+    authorization: {\n+      type: 'basic_auth',\n+      credentials: ->(connection) {\n+        user(connection['username'])\n+        password(connection['password'])\n+      }\n+    }\n+  },\n+\n+  test: ->(connection) {\n+      get(\"#{connection['server_url']}/services/workato/version\")\n+  },\n+\n+  object_definitions: {\n+    generic_alert: {\n+      fields: ->(connection, config_fields) {\n+        config_fields['fields'].split(\",\").map { |name| {\n+          name: name.strip\n+          }}\n+      }\n+    },\n+    service_alert: {\n+      fields: ->(connection, config_fields) {\n+        [\n+          { name: \"event_id\", type: :string, optional: false },\n+          { name: \"severity\", type: :string },\n+          { name: \"title\", type: :string },\n+          { name: \"_time\", type: :integer, optional: false },\n+          { name: \"severity_label\", type: :string },\n+          { name: \"description\", type: :string },\n+        ]\n+        }\n+    },\n+  },\n+\n+  triggers: {\n+    new_generic_alert: {\n+      input_fields: ->(object_definitions) {[{\n+        name: 'search_name',\n+        label: 'Splunk alert',\n+        type: :string,\n+        control_type: :select,\n+        pick_list: 'saved_searches',\n+        optional: false,\n+        hint: \"Select one of the alerts saved in Splunk that have the Workato alert action assigned.\",\n+      }]},\n+      config_fields: [\n+        {\n+          name: 'fields',\n+          label: \"Alert fields\",\n+          type: :string,\n+          optional: false,\n+          hint: \"Comma-separated field names to be taken over from the Splunk data (e.g. host, count)\",\n+        }\n+      ],\n+      webhook_subscribe: ->(callback_url, connection, input, flow_id) {\n+        data = post(\n+          \"#{connection['server_url']}/services/workato/alerts\",{\n+          \tcallback_url: callback_url,\n+          \tsearch_name: input['search_name'],\n+            })\n+        {\n+          server_url: connection['server_url'],\n+          search_name: data['search_name'],\n+          callback_url: data['callback_url'],\n+        }\n+      },\n+      webhook_unsubscribe: ->(subscription) {\n+        delete(\"#{subscription['server_url']}/services/workato/alerts\",{\n+          search_name: subscription['search_name'],\n+          callback_url: subscription['callback_url'],\n+          })\n+      },\n+      webhook_notification: ->(input, payload) {\n+        payload\n+      },\n+      dedup: ->(event) {\n+        rand()\n+\t    },\n+      output_fields: ->(object_definitions) {\n+        object_definitions['generic_alert']\n+      },\n+  \t},\n+    new_service_alert: {\n+      webhook_subscribe: ->(callback_url, connection, input, flow_id) {\n+        data = post(\n+          \"#{connection['server_url']}/services/workato/servicealerts\",{\n+          \tcallback_url: callback_url\n+            })\n+        {\n+          server_url: connection['server_url'],\n+          search_name: data['search_name'],\n+          callback_url: data['callback_url'],\n+        }\n+      },\n+      webhook_unsubscribe: ->(subscription) {\n+        delete(\"#{subscription['server_url']}/services/workato/servicealerts\",{\n+          search_name: subscription['search_name'],\n+          callback_url: subscription['callback_url'],\n+          })\n+      },\n+      webhook_notification: ->(input, payload) {","path":"basic_auth/splunk_connector.rb","position":96,"original_position":124,"commit_id":"88d02442b7c8cb018941c430703bbd36c59a5b63","original_commit_id":"88d02442b7c8cb018941c430703bbd36c59a5b63","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Use the lambda method for multiline lambdas.<br>Unused block argument - input. If it's necessary, use _ or _input as an argument name to indicate that it won't be used.<br>Avoid using {...} for multi-line blocks.","created_at":"2016-10-09T20:08:26Z","updated_at":"2016-10-09T20:08:26Z","html_url":"https://github.com/workato/connector_sdk/pull/66#discussion_r82530383","pull_request_url":"https://api.github.com/repos/workato/connector_sdk/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/comments/82530383"},"html":{"href":"https://github.com/workato/connector_sdk/pull/66#discussion_r82530383"},"pull_request":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/workato/connector_sdk/pulls/66","id":88592742,"html_url":"https://github.com/workato/connector_sdk/pull/66","diff_url":"https://github.com/workato/connector_sdk/pull/66.diff","patch_url":"https://github.com/workato/connector_sdk/pull/66.patch","issue_url":"https://api.github.com/repos/workato/connector_sdk/issues/66","number":66,"state":"open","locked":false,"title":"Added Splunk connector","user":{"login":"hovu96","id":870504,"avatar_url":"https://avatars.githubusercontent.com/u/870504?v=3","gravatar_id":"","url":"https://api.github.com/users/hovu96","html_url":"https://github.com/hovu96","followers_url":"https://api.github.com/users/hovu96/followers","following_url":"https://api.github.com/users/hovu96/following{/other_user}","gists_url":"https://api.github.com/users/hovu96/gists{/gist_id}","starred_url":"https://api.github.com/users/hovu96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hovu96/subscriptions","organizations_url":"https://api.github.com/users/hovu96/orgs","repos_url":"https://api.github.com/users/hovu96/repos","events_url":"https://api.github.com/users/hovu96/events{/privacy}","received_events_url":"https://api.github.com/users/hovu96/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-09T20:08:14Z","updated_at":"2016-10-09T20:08:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"359a008ae567bb9001c12938986adb2f342bb3e7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/workato/connector_sdk/pulls/66/commits","review_comments_url":"https://api.github.com/repos/workato/connector_sdk/pulls/66/comments","review_comment_url":"https://api.github.com/repos/workato/connector_sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/workato/connector_sdk/issues/66/comments","statuses_url":"https://api.github.com/repos/workato/connector_sdk/statuses/88d02442b7c8cb018941c430703bbd36c59a5b63","head":{"label":"hovu96:master","ref":"master","sha":"88d02442b7c8cb018941c430703bbd36c59a5b63","user":{"login":"hovu96","id":870504,"avatar_url":"https://avatars.githubusercontent.com/u/870504?v=3","gravatar_id":"","url":"https://api.github.com/users/hovu96","html_url":"https://github.com/hovu96","followers_url":"https://api.github.com/users/hovu96/followers","following_url":"https://api.github.com/users/hovu96/following{/other_user}","gists_url":"https://api.github.com/users/hovu96/gists{/gist_id}","starred_url":"https://api.github.com/users/hovu96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hovu96/subscriptions","organizations_url":"https://api.github.com/users/hovu96/orgs","repos_url":"https://api.github.com/users/hovu96/repos","events_url":"https://api.github.com/users/hovu96/events{/privacy}","received_events_url":"https://api.github.com/users/hovu96/received_events","type":"User","site_admin":false},"repo":{"id":70426937,"name":"connector_sdk","full_name":"hovu96/connector_sdk","owner":{"login":"hovu96","id":870504,"avatar_url":"https://avatars.githubusercontent.com/u/870504?v=3","gravatar_id":"","url":"https://api.github.com/users/hovu96","html_url":"https://github.com/hovu96","followers_url":"https://api.github.com/users/hovu96/followers","following_url":"https://api.github.com/users/hovu96/following{/other_user}","gists_url":"https://api.github.com/users/hovu96/gists{/gist_id}","starred_url":"https://api.github.com/users/hovu96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hovu96/subscriptions","organizations_url":"https://api.github.com/users/hovu96/orgs","repos_url":"https://api.github.com/users/hovu96/repos","events_url":"https://api.github.com/users/hovu96/events{/privacy}","received_events_url":"https://api.github.com/users/hovu96/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hovu96/connector_sdk","description":"Connector SDK samples and documentation","fork":true,"url":"https://api.github.com/repos/hovu96/connector_sdk","forks_url":"https://api.github.com/repos/hovu96/connector_sdk/forks","keys_url":"https://api.github.com/repos/hovu96/connector_sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hovu96/connector_sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hovu96/connector_sdk/teams","hooks_url":"https://api.github.com/repos/hovu96/connector_sdk/hooks","issue_events_url":"https://api.github.com/repos/hovu96/connector_sdk/issues/events{/number}","events_url":"https://api.github.com/repos/hovu96/connector_sdk/events","assignees_url":"https://api.github.com/repos/hovu96/connector_sdk/assignees{/user}","branches_url":"https://api.github.com/repos/hovu96/connector_sdk/branches{/branch}","tags_url":"https://api.github.com/repos/hovu96/connector_sdk/tags","blobs_url":"https://api.github.com/repos/hovu96/connector_sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hovu96/connector_sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hovu96/connector_sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/hovu96/connector_sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hovu96/connector_sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/hovu96/connector_sdk/languages","stargazers_url":"https://api.github.com/repos/hovu96/connector_sdk/stargazers","contributors_url":"https://api.github.com/repos/hovu96/connector_sdk/contributors","subscribers_url":"https://api.github.com/repos/hovu96/connector_sdk/subscribers","subscription_url":"https://api.github.com/repos/hovu96/connector_sdk/subscription","commits_url":"https://api.github.com/repos/hovu96/connector_sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/hovu96/connector_sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/hovu96/connector_sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/hovu96/connector_sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/hovu96/connector_sdk/contents/{+path}","compare_url":"https://api.github.com/repos/hovu96/connector_sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hovu96/connector_sdk/merges","archive_url":"https://api.github.com/repos/hovu96/connector_sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hovu96/connector_sdk/downloads","issues_url":"https://api.github.com/repos/hovu96/connector_sdk/issues{/number}","pulls_url":"https://api.github.com/repos/hovu96/connector_sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/hovu96/connector_sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/hovu96/connector_sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hovu96/connector_sdk/labels{/name}","releases_url":"https://api.github.com/repos/hovu96/connector_sdk/releases{/id}","deployments_url":"https://api.github.com/repos/hovu96/connector_sdk/deployments","created_at":"2016-10-09T19:56:39Z","updated_at":"2016-10-09T19:56:40Z","pushed_at":"2016-10-09T20:04:01Z","git_url":"git://github.com/hovu96/connector_sdk.git","ssh_url":"git@github.com:hovu96/connector_sdk.git","clone_url":"https://github.com/hovu96/connector_sdk.git","svn_url":"https://github.com/hovu96/connector_sdk","homepage":"","size":1354,"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":"workato:master","ref":"master","sha":"b052b7626da3f5f1c4c140ab5a4366b1096c7587","user":{"login":"workato","id":5629924,"avatar_url":"https://avatars.githubusercontent.com/u/5629924?v=3","gravatar_id":"","url":"https://api.github.com/users/workato","html_url":"https://github.com/workato","followers_url":"https://api.github.com/users/workato/followers","following_url":"https://api.github.com/users/workato/following{/other_user}","gists_url":"https://api.github.com/users/workato/gists{/gist_id}","starred_url":"https://api.github.com/users/workato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workato/subscriptions","organizations_url":"https://api.github.com/users/workato/orgs","repos_url":"https://api.github.com/users/workato/repos","events_url":"https://api.github.com/users/workato/events{/privacy}","received_events_url":"https://api.github.com/users/workato/received_events","type":"Organization","site_admin":false},"repo":{"id":54221993,"name":"connector_sdk","full_name":"workato/connector_sdk","owner":{"login":"workato","id":5629924,"avatar_url":"https://avatars.githubusercontent.com/u/5629924?v=3","gravatar_id":"","url":"https://api.github.com/users/workato","html_url":"https://github.com/workato","followers_url":"https://api.github.com/users/workato/followers","following_url":"https://api.github.com/users/workato/following{/other_user}","gists_url":"https://api.github.com/users/workato/gists{/gist_id}","starred_url":"https://api.github.com/users/workato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workato/subscriptions","organizations_url":"https://api.github.com/users/workato/orgs","repos_url":"https://api.github.com/users/workato/repos","events_url":"https://api.github.com/users/workato/events{/privacy}","received_events_url":"https://api.github.com/users/workato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/workato/connector_sdk","description":"Connector SDK samples and documentation","fork":false,"url":"https://api.github.com/repos/workato/connector_sdk","forks_url":"https://api.github.com/repos/workato/connector_sdk/forks","keys_url":"https://api.github.com/repos/workato/connector_sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/workato/connector_sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/workato/connector_sdk/teams","hooks_url":"https://api.github.com/repos/workato/connector_sdk/hooks","issue_events_url":"https://api.github.com/repos/workato/connector_sdk/issues/events{/number}","events_url":"https://api.github.com/repos/workato/connector_sdk/events","assignees_url":"https://api.github.com/repos/workato/connector_sdk/assignees{/user}","branches_url":"https://api.github.com/repos/workato/connector_sdk/branches{/branch}","tags_url":"https://api.github.com/repos/workato/connector_sdk/tags","blobs_url":"https://api.github.com/repos/workato/connector_sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/workato/connector_sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/workato/connector_sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/workato/connector_sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/workato/connector_sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/workato/connector_sdk/languages","stargazers_url":"https://api.github.com/repos/workato/connector_sdk/stargazers","contributors_url":"https://api.github.com/repos/workato/connector_sdk/contributors","subscribers_url":"https://api.github.com/repos/workato/connector_sdk/subscribers","subscription_url":"https://api.github.com/repos/workato/connector_sdk/subscription","commits_url":"https://api.github.com/repos/workato/connector_sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/workato/connector_sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/workato/connector_sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/workato/connector_sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/workato/connector_sdk/contents/{+path}","compare_url":"https://api.github.com/repos/workato/connector_sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/workato/connector_sdk/merges","archive_url":"https://api.github.com/repos/workato/connector_sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/workato/connector_sdk/downloads","issues_url":"https://api.github.com/repos/workato/connector_sdk/issues{/number}","pulls_url":"https://api.github.com/repos/workato/connector_sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/workato/connector_sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/workato/connector_sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/workato/connector_sdk/labels{/name}","releases_url":"https://api.github.com/repos/workato/connector_sdk/releases{/id}","deployments_url":"https://api.github.com/repos/workato/connector_sdk/deployments","created_at":"2016-03-18T18:08:56Z","updated_at":"2016-07-26T16:17:22Z","pushed_at":"2016-10-09T20:08:15Z","git_url":"git://github.com/workato/connector_sdk.git","ssh_url":"git@github.com:workato/connector_sdk.git","clone_url":"https://github.com/workato/connector_sdk.git","svn_url":"https://github.com/workato/connector_sdk","homepage":"","size":1354,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":22,"forks":12,"open_issues":22,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/66"},"html":{"href":"https://github.com/workato/connector_sdk/pull/66"},"issue":{"href":"https://api.github.com/repos/workato/connector_sdk/issues/66"},"comments":{"href":"https://api.github.com/repos/workato/connector_sdk/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/workato/connector_sdk/statuses/88d02442b7c8cb018941c430703bbd36c59a5b63"}}}}
{"actor":{"display_login":"houndci-bot"}}