{"action":"created","comment":{"url":"https://api.github.com/repos/2600hz/kazoo/pulls/comments/87116313","pull_request_review_id":7741346,"id":87116313,"diff_hunk":"@@ -78,11 +80,24 @@ get_file_path('undefined', DbName, DocId, AName) ->\n get_file_path(Path, DbName, DocId, AName) ->\n     kz_util:to_list(list_to_binary([Path, \"/\", DbName, \"/\", DocId, \"_\", AName])).\n \n--spec get_s3_values(ne_binary()) -> {ne_binary(), ne_binary(), ne_binary(), ne_binary(), api_binary()}.\n-get_s3_values(S3) ->\n+-spec get_s3_values(ne_binary(), kz_data:connection()) ->\n+                           {ne_binary(), ne_binary(), ne_binary(), ne_binary(), api_binary()}.\n+get_s3_values(S3, 'undefined') ->\n     case binary_to_term(base64:decode(S3)) of\n         {Key, Secret, Bucket, Path} ->\n             {Key, Secret, ?AMAZON_S3_HOST, Bucket, Path};\n         {_Key, _Secret, _Host, _Bucket, _Path} = V2 ->\n             V2\n+    end;\n+get_s3_values(S3, HandlerProps) ->\n+    {_Key, _Secret, Host, Bucket, Path} = get_s3_values(S3, 'undefined'),\n+    try get_map_values(HandlerProps) of\n+        {Bucket, Key, Secret, _Path, Host} ->\n+            {Key, Secret, Host, Bucket, Path};\n+        {_Bucket, Key, Secret, _Path, _Host} ->\n+            {_Key, _Secret, Host, Bucket, Path}\n+    catch\n+        _E:_R ->\n+            lager:info(\"unable to get s3 cred value using att values (~s): ~p\", [_E, _R]),\n+            {_Key, _Secret, Host, Bucket, Path}","path":"core/kazoo_attachments/src/kz_att_s3.erl","position":null,"original_position":51,"commit_id":"1af8388af24577deebdd06c747a57fbdd037f970","original_commit_id":"7b8761cadac6e2058271d16b2309dc677c7ae9d6","user":{"login":"tsromana","id":12875008,"avatar_url":"https://avatars.githubusercontent.com/u/12875008?v=3","gravatar_id":"","url":"https://api.github.com/users/tsromana","html_url":"https://github.com/tsromana","followers_url":"https://api.github.com/users/tsromana/followers","following_url":"https://api.github.com/users/tsromana/following{/other_user}","gists_url":"https://api.github.com/users/tsromana/gists{/gist_id}","starred_url":"https://api.github.com/users/tsromana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsromana/subscriptions","organizations_url":"https://api.github.com/users/tsromana/orgs","repos_url":"https://api.github.com/users/tsromana/repos","events_url":"https://api.github.com/users/tsromana/events{/privacy}","received_events_url":"https://api.github.com/users/tsromana/received_events","type":"User","site_admin":false},"body":"@lazedo yea this looks more readable :)","created_at":"2016-11-09T00:44:27Z","updated_at":"2016-11-09T00:44:27Z","html_url":"https://github.com/2600hz/kazoo/pull/2726#discussion_r87116313","pull_request_url":"https://api.github.com/repos/2600hz/kazoo/pulls/2726","_links":{"self":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/comments/87116313"},"html":{"href":"https://github.com/2600hz/kazoo/pull/2726#discussion_r87116313"},"pull_request":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/2726"}}},"pull_request":{"url":"https://api.github.com/repos/2600hz/kazoo/pulls/2726","id":90503765,"html_url":"https://github.com/2600hz/kazoo/pull/2726","diff_url":"https://github.com/2600hz/kazoo/pull/2726.diff","patch_url":"https://github.com/2600hz/kazoo/pull/2726.patch","issue_url":"https://api.github.com/repos/2600hz/kazoo/issues/2726","number":2726,"state":"open","locked":false,"title":"Update to kzs_attachement","user":{"login":"tsromana","id":12875008,"avatar_url":"https://avatars.githubusercontent.com/u/12875008?v=3","gravatar_id":"","url":"https://api.github.com/users/tsromana","html_url":"https://github.com/tsromana","followers_url":"https://api.github.com/users/tsromana/followers","following_url":"https://api.github.com/users/tsromana/following{/other_user}","gists_url":"https://api.github.com/users/tsromana/gists{/gist_id}","starred_url":"https://api.github.com/users/tsromana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsromana/subscriptions","organizations_url":"https://api.github.com/users/tsromana/orgs","repos_url":"https://api.github.com/users/tsromana/repos","events_url":"https://api.github.com/users/tsromana/events{/privacy}","received_events_url":"https://api.github.com/users/tsromana/received_events","type":"User","site_admin":false},"body":"added use case where users att creds could be changed and at that point amazon s3 will disregard old creds and will use newer ones instead. \n\nWhile sending a request to get doc, it will check if the docs att handler and the systems att handler are same if not it will use the docs att handler creds, \nif they are same it will use the systems creds and if somehow the creds are messed up it will revert back to att's creds.\n\nTodo:\nNeeds thorough testing\n","created_at":"2016-10-23T03:32:55Z","updated_at":"2016-11-09T00:44:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"227ba191a38a14d3ade89171013ec435c7a7e77b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/2600hz/kazoo/pulls/2726/commits","review_comments_url":"https://api.github.com/repos/2600hz/kazoo/pulls/2726/comments","review_comment_url":"https://api.github.com/repos/2600hz/kazoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/2600hz/kazoo/issues/2726/comments","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/1af8388af24577deebdd06c747a57fbdd037f970","head":{"label":"tsromana:patch-6","ref":"patch-6","sha":"1af8388af24577deebdd06c747a57fbdd037f970","user":{"login":"tsromana","id":12875008,"avatar_url":"https://avatars.githubusercontent.com/u/12875008?v=3","gravatar_id":"","url":"https://api.github.com/users/tsromana","html_url":"https://github.com/tsromana","followers_url":"https://api.github.com/users/tsromana/followers","following_url":"https://api.github.com/users/tsromana/following{/other_user}","gists_url":"https://api.github.com/users/tsromana/gists{/gist_id}","starred_url":"https://api.github.com/users/tsromana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsromana/subscriptions","organizations_url":"https://api.github.com/users/tsromana/orgs","repos_url":"https://api.github.com/users/tsromana/repos","events_url":"https://api.github.com/users/tsromana/events{/privacy}","received_events_url":"https://api.github.com/users/tsromana/received_events","type":"User","site_admin":false},"repo":{"id":68856553,"name":"kazoo","full_name":"tsromana/kazoo","owner":{"login":"tsromana","id":12875008,"avatar_url":"https://avatars.githubusercontent.com/u/12875008?v=3","gravatar_id":"","url":"https://api.github.com/users/tsromana","html_url":"https://github.com/tsromana","followers_url":"https://api.github.com/users/tsromana/followers","following_url":"https://api.github.com/users/tsromana/following{/other_user}","gists_url":"https://api.github.com/users/tsromana/gists{/gist_id}","starred_url":"https://api.github.com/users/tsromana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsromana/subscriptions","organizations_url":"https://api.github.com/users/tsromana/orgs","repos_url":"https://api.github.com/users/tsromana/repos","events_url":"https://api.github.com/users/tsromana/events{/privacy}","received_events_url":"https://api.github.com/users/tsromana/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tsromana/kazoo","description":null,"fork":true,"url":"https://api.github.com/repos/tsromana/kazoo","forks_url":"https://api.github.com/repos/tsromana/kazoo/forks","keys_url":"https://api.github.com/repos/tsromana/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tsromana/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tsromana/kazoo/teams","hooks_url":"https://api.github.com/repos/tsromana/kazoo/hooks","issue_events_url":"https://api.github.com/repos/tsromana/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/tsromana/kazoo/events","assignees_url":"https://api.github.com/repos/tsromana/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/tsromana/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/tsromana/kazoo/tags","blobs_url":"https://api.github.com/repos/tsromana/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tsromana/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tsromana/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/tsromana/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tsromana/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/tsromana/kazoo/languages","stargazers_url":"https://api.github.com/repos/tsromana/kazoo/stargazers","contributors_url":"https://api.github.com/repos/tsromana/kazoo/contributors","subscribers_url":"https://api.github.com/repos/tsromana/kazoo/subscribers","subscription_url":"https://api.github.com/repos/tsromana/kazoo/subscription","commits_url":"https://api.github.com/repos/tsromana/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/tsromana/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/tsromana/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/tsromana/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/tsromana/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/tsromana/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tsromana/kazoo/merges","archive_url":"https://api.github.com/repos/tsromana/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tsromana/kazoo/downloads","issues_url":"https://api.github.com/repos/tsromana/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/tsromana/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/tsromana/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/tsromana/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tsromana/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/tsromana/kazoo/releases{/id}","deployments_url":"https://api.github.com/repos/tsromana/kazoo/deployments","created_at":"2016-09-21T20:51:40Z","updated_at":"2016-09-21T20:51:48Z","pushed_at":"2016-11-09T00:43:22Z","git_url":"git://github.com/tsromana/kazoo.git","ssh_url":"git@github.com:tsromana/kazoo.git","clone_url":"https://github.com/tsromana/kazoo.git","svn_url":"https://github.com/tsromana/kazoo","homepage":"","size":345065,"stargazers_count":0,"watchers_count":0,"language":"Erlang","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":"2600hz:master","ref":"master","sha":"b351118876dbcd806ca003935bd5eb2997d318f1","user":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"repo":{"id":2966241,"name":"kazoo","full_name":"2600hz/kazoo","owner":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2600hz/kazoo","description":"The core of an open-source, distributed, highly scalable platform designed to provide robust telecom services","fork":false,"url":"https://api.github.com/repos/2600hz/kazoo","forks_url":"https://api.github.com/repos/2600hz/kazoo/forks","keys_url":"https://api.github.com/repos/2600hz/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2600hz/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2600hz/kazoo/teams","hooks_url":"https://api.github.com/repos/2600hz/kazoo/hooks","issue_events_url":"https://api.github.com/repos/2600hz/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/2600hz/kazoo/events","assignees_url":"https://api.github.com/repos/2600hz/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/2600hz/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/2600hz/kazoo/tags","blobs_url":"https://api.github.com/repos/2600hz/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2600hz/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2600hz/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/2600hz/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/2600hz/kazoo/languages","stargazers_url":"https://api.github.com/repos/2600hz/kazoo/stargazers","contributors_url":"https://api.github.com/repos/2600hz/kazoo/contributors","subscribers_url":"https://api.github.com/repos/2600hz/kazoo/subscribers","subscription_url":"https://api.github.com/repos/2600hz/kazoo/subscription","commits_url":"https://api.github.com/repos/2600hz/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/2600hz/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/2600hz/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/2600hz/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/2600hz/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/2600hz/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2600hz/kazoo/merges","archive_url":"https://api.github.com/repos/2600hz/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2600hz/kazoo/downloads","issues_url":"https://api.github.com/repos/2600hz/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/2600hz/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/2600hz/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/2600hz/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2600hz/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/2600hz/kazoo/releases{/id}","deployments_url":"https://api.github.com/repos/2600hz/kazoo/deployments","created_at":"2011-12-12T18:08:02Z","updated_at":"2016-11-08T18:05:56Z","pushed_at":"2016-11-09T00:43:22Z","git_url":"git://github.com/2600hz/kazoo.git","ssh_url":"git@github.com:2600hz/kazoo.git","clone_url":"https://github.com/2600hz/kazoo.git","svn_url":"https://github.com/2600hz/kazoo","homepage":"http://www.2600hz.org/","size":449084,"stargazers_count":411,"watchers_count":411,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":211,"mirror_url":null,"open_issues_count":20,"forks":211,"open_issues":20,"watchers":411,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/2726"},"html":{"href":"https://github.com/2600hz/kazoo/pull/2726"},"issue":{"href":"https://api.github.com/repos/2600hz/kazoo/issues/2726"},"comments":{"href":"https://api.github.com/repos/2600hz/kazoo/issues/2726/comments"},"review_comments":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/2726/comments"},"review_comment":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/2726/commits"},"statuses":{"href":"https://api.github.com/repos/2600hz/kazoo/statuses/1af8388af24577deebdd06c747a57fbdd037f970"}}}}
{"actor":{"display_login":"tsromana"}}