{"action":"created","comment":{"url":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/comments/183106400","pull_request_review_id":114046884,"id":183106400,"diff_hunk":"@@ -63,7 +58,54 @@ def options(self):\n \n     @property\n     def region_name(self):\n-        return self.options.get('region')\n+        return self.options.get('region', 'us-west-2')\n+\n+    def get_data(self):\n+        return sanitize(self.get_raw_data())\n+\n+class SMSource(AWSSource):\n+    def get_sm_response(self):\n+        key = \"{}{}\".format(self.url.netloc, self.url.path)\n+        session = boto3.session.Session()\n+        endpoint_url = \"https://secretsmanager.{}.amazonaws.com\".format(self.region_name)\n+        client = session.client(\n+            service_name='secretsmanager',\n+            region_name=self.region_name,\n+            endpoint_url=endpoint_url\n+        )\n+\n+        try:\n+            return client.get_secret_value( SecretId=key )\n+        except botocore.exceptions.ClientError as e:\n+            if e.response['Error']['Code'] == 'ResourceNotFoundException':\n+                logger.debug(\"The requested secret \" + key + \" was not found\")\n+            elif e.response['Error']['Code'] == 'InvalidRequestException':\n+                logger.error(\"The request was invalid due to:\", e)\n+            elif e.response['Error']['Code'] == 'InvalidParameterException':\n+                logger.error(\"The request had invalid params:\", e)\n+            return {}\n+\n+    def get_raw_data(self):","path":"snagsby/sources.py","position":72,"original_position":73,"commit_id":"94e08c613b604deda5cda2b0a1fc7d190a35e5f7","original_commit_id":"d8c96cda83f4ac76b935a54c59c7994d5b971b7f","user":{"login":"robsweet","id":117203,"avatar_url":"https://avatars2.githubusercontent.com/u/117203?v=4","gravatar_id":"","url":"https://api.github.com/users/robsweet","html_url":"https://github.com/robsweet","followers_url":"https://api.github.com/users/robsweet/followers","following_url":"https://api.github.com/users/robsweet/following{/other_user}","gists_url":"https://api.github.com/users/robsweet/gists{/gist_id}","starred_url":"https://api.github.com/users/robsweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robsweet/subscriptions","organizations_url":"https://api.github.com/users/robsweet/orgs","repos_url":"https://api.github.com/users/robsweet/repos","events_url":"https://api.github.com/users/robsweet/events{/privacy}","received_events_url":"https://api.github.com/users/robsweet/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2018-04-20T16:37:37Z","updated_at":"2018-04-20T16:37:37Z","html_url":"https://github.com/roverdotcom/snagsby-py/pull/5#discussion_r183106400","pull_request_url":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/5","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/comments/183106400"},"html":{"href":"https://github.com/roverdotcom/snagsby-py/pull/5#discussion_r183106400"},"pull_request":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/5"}},"in_reply_to_id":182936842},"pull_request":{"url":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/5","id":182596207,"html_url":"https://github.com/roverdotcom/snagsby-py/pull/5","diff_url":"https://github.com/roverdotcom/snagsby-py/pull/5.diff","patch_url":"https://github.com/roverdotcom/snagsby-py/pull/5.patch","issue_url":"https://api.github.com/repos/roverdotcom/snagsby-py/issues/5","number":5,"state":"open","locked":false,"title":"[OPS-3129] Implementing AWS Secrets Manager as Snagsby backend","user":{"login":"robsweet","id":117203,"avatar_url":"https://avatars2.githubusercontent.com/u/117203?v=4","gravatar_id":"","url":"https://api.github.com/users/robsweet","html_url":"https://github.com/robsweet","followers_url":"https://api.github.com/users/robsweet/followers","following_url":"https://api.github.com/users/robsweet/following{/other_user}","gists_url":"https://api.github.com/users/robsweet/gists{/gist_id}","starred_url":"https://api.github.com/users/robsweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robsweet/subscriptions","organizations_url":"https://api.github.com/users/robsweet/orgs","repos_url":"https://api.github.com/users/robsweet/repos","events_url":"https://api.github.com/users/robsweet/events{/privacy}","received_events_url":"https://api.github.com/users/robsweet/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-18T20:38:16Z","updated_at":"2018-04-20T16:37:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b593018165959c6165b8b50043cb763d788f550","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/5/commits","review_comments_url":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/5/comments","review_comment_url":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/comments{/number}","comments_url":"https://api.github.com/repos/roverdotcom/snagsby-py/issues/5/comments","statuses_url":"https://api.github.com/repos/roverdotcom/snagsby-py/statuses/94e08c613b604deda5cda2b0a1fc7d190a35e5f7","head":{"label":"roverdotcom:OPS-3129","ref":"OPS-3129","sha":"94e08c613b604deda5cda2b0a1fc7d190a35e5f7","user":{"login":"roverdotcom","id":1463288,"avatar_url":"https://avatars1.githubusercontent.com/u/1463288?v=4","gravatar_id":"","url":"https://api.github.com/users/roverdotcom","html_url":"https://github.com/roverdotcom","followers_url":"https://api.github.com/users/roverdotcom/followers","following_url":"https://api.github.com/users/roverdotcom/following{/other_user}","gists_url":"https://api.github.com/users/roverdotcom/gists{/gist_id}","starred_url":"https://api.github.com/users/roverdotcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roverdotcom/subscriptions","organizations_url":"https://api.github.com/users/roverdotcom/orgs","repos_url":"https://api.github.com/users/roverdotcom/repos","events_url":"https://api.github.com/users/roverdotcom/events{/privacy}","received_events_url":"https://api.github.com/users/roverdotcom/received_events","type":"Organization","site_admin":false},"repo":{"id":71311336,"name":"snagsby-py","full_name":"roverdotcom/snagsby-py","owner":{"login":"roverdotcom","id":1463288,"avatar_url":"https://avatars1.githubusercontent.com/u/1463288?v=4","gravatar_id":"","url":"https://api.github.com/users/roverdotcom","html_url":"https://github.com/roverdotcom","followers_url":"https://api.github.com/users/roverdotcom/followers","following_url":"https://api.github.com/users/roverdotcom/following{/other_user}","gists_url":"https://api.github.com/users/roverdotcom/gists{/gist_id}","starred_url":"https://api.github.com/users/roverdotcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roverdotcom/subscriptions","organizations_url":"https://api.github.com/users/roverdotcom/orgs","repos_url":"https://api.github.com/users/roverdotcom/repos","events_url":"https://api.github.com/users/roverdotcom/events{/privacy}","received_events_url":"https://api.github.com/users/roverdotcom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/roverdotcom/snagsby-py","description":null,"fork":false,"url":"https://api.github.com/repos/roverdotcom/snagsby-py","forks_url":"https://api.github.com/repos/roverdotcom/snagsby-py/forks","keys_url":"https://api.github.com/repos/roverdotcom/snagsby-py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roverdotcom/snagsby-py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roverdotcom/snagsby-py/teams","hooks_url":"https://api.github.com/repos/roverdotcom/snagsby-py/hooks","issue_events_url":"https://api.github.com/repos/roverdotcom/snagsby-py/issues/events{/number}","events_url":"https://api.github.com/repos/roverdotcom/snagsby-py/events","assignees_url":"https://api.github.com/repos/roverdotcom/snagsby-py/assignees{/user}","branches_url":"https://api.github.com/repos/roverdotcom/snagsby-py/branches{/branch}","tags_url":"https://api.github.com/repos/roverdotcom/snagsby-py/tags","blobs_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/refs{/sha}","trees_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roverdotcom/snagsby-py/statuses/{sha}","languages_url":"https://api.github.com/repos/roverdotcom/snagsby-py/languages","stargazers_url":"https://api.github.com/repos/roverdotcom/snagsby-py/stargazers","contributors_url":"https://api.github.com/repos/roverdotcom/snagsby-py/contributors","subscribers_url":"https://api.github.com/repos/roverdotcom/snagsby-py/subscribers","subscription_url":"https://api.github.com/repos/roverdotcom/snagsby-py/subscription","commits_url":"https://api.github.com/repos/roverdotcom/snagsby-py/commits{/sha}","git_commits_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/commits{/sha}","comments_url":"https://api.github.com/repos/roverdotcom/snagsby-py/comments{/number}","issue_comment_url":"https://api.github.com/repos/roverdotcom/snagsby-py/issues/comments{/number}","contents_url":"https://api.github.com/repos/roverdotcom/snagsby-py/contents/{+path}","compare_url":"https://api.github.com/repos/roverdotcom/snagsby-py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roverdotcom/snagsby-py/merges","archive_url":"https://api.github.com/repos/roverdotcom/snagsby-py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roverdotcom/snagsby-py/downloads","issues_url":"https://api.github.com/repos/roverdotcom/snagsby-py/issues{/number}","pulls_url":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls{/number}","milestones_url":"https://api.github.com/repos/roverdotcom/snagsby-py/milestones{/number}","notifications_url":"https://api.github.com/repos/roverdotcom/snagsby-py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roverdotcom/snagsby-py/labels{/name}","releases_url":"https://api.github.com/repos/roverdotcom/snagsby-py/releases{/id}","deployments_url":"https://api.github.com/repos/roverdotcom/snagsby-py/deployments","created_at":"2016-10-19T02:34:44Z","updated_at":"2017-02-15T06:23:43Z","pushed_at":"2018-04-20T16:37:07Z","git_url":"git://github.com/roverdotcom/snagsby-py.git","ssh_url":"git@github.com:roverdotcom/snagsby-py.git","clone_url":"https://github.com/roverdotcom/snagsby-py.git","svn_url":"https://github.com/roverdotcom/snagsby-py","homepage":null,"size":15,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"roverdotcom:master","ref":"master","sha":"11bf52cd544f1b9079a1de06d0c2bfcfbeb9b409","user":{"login":"roverdotcom","id":1463288,"avatar_url":"https://avatars1.githubusercontent.com/u/1463288?v=4","gravatar_id":"","url":"https://api.github.com/users/roverdotcom","html_url":"https://github.com/roverdotcom","followers_url":"https://api.github.com/users/roverdotcom/followers","following_url":"https://api.github.com/users/roverdotcom/following{/other_user}","gists_url":"https://api.github.com/users/roverdotcom/gists{/gist_id}","starred_url":"https://api.github.com/users/roverdotcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roverdotcom/subscriptions","organizations_url":"https://api.github.com/users/roverdotcom/orgs","repos_url":"https://api.github.com/users/roverdotcom/repos","events_url":"https://api.github.com/users/roverdotcom/events{/privacy}","received_events_url":"https://api.github.com/users/roverdotcom/received_events","type":"Organization","site_admin":false},"repo":{"id":71311336,"name":"snagsby-py","full_name":"roverdotcom/snagsby-py","owner":{"login":"roverdotcom","id":1463288,"avatar_url":"https://avatars1.githubusercontent.com/u/1463288?v=4","gravatar_id":"","url":"https://api.github.com/users/roverdotcom","html_url":"https://github.com/roverdotcom","followers_url":"https://api.github.com/users/roverdotcom/followers","following_url":"https://api.github.com/users/roverdotcom/following{/other_user}","gists_url":"https://api.github.com/users/roverdotcom/gists{/gist_id}","starred_url":"https://api.github.com/users/roverdotcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roverdotcom/subscriptions","organizations_url":"https://api.github.com/users/roverdotcom/orgs","repos_url":"https://api.github.com/users/roverdotcom/repos","events_url":"https://api.github.com/users/roverdotcom/events{/privacy}","received_events_url":"https://api.github.com/users/roverdotcom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/roverdotcom/snagsby-py","description":null,"fork":false,"url":"https://api.github.com/repos/roverdotcom/snagsby-py","forks_url":"https://api.github.com/repos/roverdotcom/snagsby-py/forks","keys_url":"https://api.github.com/repos/roverdotcom/snagsby-py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roverdotcom/snagsby-py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roverdotcom/snagsby-py/teams","hooks_url":"https://api.github.com/repos/roverdotcom/snagsby-py/hooks","issue_events_url":"https://api.github.com/repos/roverdotcom/snagsby-py/issues/events{/number}","events_url":"https://api.github.com/repos/roverdotcom/snagsby-py/events","assignees_url":"https://api.github.com/repos/roverdotcom/snagsby-py/assignees{/user}","branches_url":"https://api.github.com/repos/roverdotcom/snagsby-py/branches{/branch}","tags_url":"https://api.github.com/repos/roverdotcom/snagsby-py/tags","blobs_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/refs{/sha}","trees_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roverdotcom/snagsby-py/statuses/{sha}","languages_url":"https://api.github.com/repos/roverdotcom/snagsby-py/languages","stargazers_url":"https://api.github.com/repos/roverdotcom/snagsby-py/stargazers","contributors_url":"https://api.github.com/repos/roverdotcom/snagsby-py/contributors","subscribers_url":"https://api.github.com/repos/roverdotcom/snagsby-py/subscribers","subscription_url":"https://api.github.com/repos/roverdotcom/snagsby-py/subscription","commits_url":"https://api.github.com/repos/roverdotcom/snagsby-py/commits{/sha}","git_commits_url":"https://api.github.com/repos/roverdotcom/snagsby-py/git/commits{/sha}","comments_url":"https://api.github.com/repos/roverdotcom/snagsby-py/comments{/number}","issue_comment_url":"https://api.github.com/repos/roverdotcom/snagsby-py/issues/comments{/number}","contents_url":"https://api.github.com/repos/roverdotcom/snagsby-py/contents/{+path}","compare_url":"https://api.github.com/repos/roverdotcom/snagsby-py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roverdotcom/snagsby-py/merges","archive_url":"https://api.github.com/repos/roverdotcom/snagsby-py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roverdotcom/snagsby-py/downloads","issues_url":"https://api.github.com/repos/roverdotcom/snagsby-py/issues{/number}","pulls_url":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls{/number}","milestones_url":"https://api.github.com/repos/roverdotcom/snagsby-py/milestones{/number}","notifications_url":"https://api.github.com/repos/roverdotcom/snagsby-py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roverdotcom/snagsby-py/labels{/name}","releases_url":"https://api.github.com/repos/roverdotcom/snagsby-py/releases{/id}","deployments_url":"https://api.github.com/repos/roverdotcom/snagsby-py/deployments","created_at":"2016-10-19T02:34:44Z","updated_at":"2017-02-15T06:23:43Z","pushed_at":"2018-04-20T16:37:07Z","git_url":"git://github.com/roverdotcom/snagsby-py.git","ssh_url":"git@github.com:roverdotcom/snagsby-py.git","clone_url":"https://github.com/roverdotcom/snagsby-py.git","svn_url":"https://github.com/roverdotcom/snagsby-py","homepage":null,"size":15,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/5"},"html":{"href":"https://github.com/roverdotcom/snagsby-py/pull/5"},"issue":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/issues/5"},"comments":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/roverdotcom/snagsby-py/statuses/94e08c613b604deda5cda2b0a1fc7d190a35e5f7"}},"author_association":"NONE"}}
{"actor":{"display_login":"robsweet"}}