{"action":"created","comment":{"url":"https://api.github.com/repos/scality/S3/pulls/comments/91640924","pull_request_review_id":12151816,"id":91640924,"diff_hunk":"@@ -0,0 +1,60 @@\n+import { errors } from 'arsenal';\n+import async from 'async';\n+\n+import services from '../services';\n+import { parseWebsiteConfigXml } from './apiUtils/bucket/bucketWebsite';\n+import metadata from '../metadata/wrapper';\n+\n+/**\n+ * Bucket Put Website - Create bucket website configuration\n+ * @param {AuthInfo} authInfo - Instance of AuthInfo class with requester's info\n+ * @param {object} request - http request object\n+ * @param {object} log - Werelogs logger\n+ * @param {function} callback - callback to server\n+ * @return {undefined}\n+ */\n+export default function bucketPutWebsite(authInfo, request, log, callback) {\n+    log.debug('processing request', { method: 'bucketPutWebsite' });\n+    const bucketName = request.bucketName;\n+    const metadataValParams = {\n+        authInfo,\n+        bucketName,\n+        requestType: 'bucketPutWebsite',\n+        log,\n+    };\n+    return async.waterfall([\n+        function parseXmlBody(next) {\n+            if (request.post) {\n+                log.trace('parsing website configuration from request body');\n+                return parseWebsiteConfigXml(request.post, log,\n+                    (err, config) => next(err, config));\n+            }\n+            // If no request body at all\n+            return next(errors.MissingRequestBodyError);\n+        },\n+        function validateBucketAuthorization(config, next) {\n+            services.metadataValidateAuthorization(metadataValParams,","path":"lib/api/bucketPutWebsite.js","position":null,"original_position":36,"commit_id":"2075daafa6f537dd5a9692a9c855b08adae30d45","original_commit_id":"30a1a3deb33324dec1fcaf738fa3ce9f415c285a","user":{"login":"electrachong","id":15208707,"avatar_url":"https://avatars.githubusercontent.com/u/15208707?v=3","gravatar_id":"","url":"https://api.github.com/users/electrachong","html_url":"https://github.com/electrachong","followers_url":"https://api.github.com/users/electrachong/followers","following_url":"https://api.github.com/users/electrachong/following{/other_user}","gists_url":"https://api.github.com/users/electrachong/gists{/gist_id}","starred_url":"https://api.github.com/users/electrachong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electrachong/subscriptions","organizations_url":"https://api.github.com/users/electrachong/orgs","repos_url":"https://api.github.com/users/electrachong/repos","events_url":"https://api.github.com/users/electrachong/events{/privacy}","received_events_url":"https://api.github.com/users/electrachong/received_events","type":"User","site_admin":false},"body":":thumbsup:","created_at":"2016-12-09T00:55:46Z","updated_at":"2016-12-09T00:55:46Z","html_url":"https://github.com/scality/S3/pull/432#discussion_r91640924","pull_request_url":"https://api.github.com/repos/scality/S3/pulls/432","_links":{"self":{"href":"https://api.github.com/repos/scality/S3/pulls/comments/91640924"},"html":{"href":"https://github.com/scality/S3/pull/432#discussion_r91640924"},"pull_request":{"href":"https://api.github.com/repos/scality/S3/pulls/432"}}},"pull_request":{"url":"https://api.github.com/repos/scality/S3/pulls/432","id":95606366,"html_url":"https://github.com/scality/S3/pull/432","diff_url":"https://github.com/scality/S3/pull/432.diff","patch_url":"https://github.com/scality/S3/pull/432.patch","issue_url":"https://api.github.com/repos/scality/S3/issues/432","number":432,"state":"open","locked":false,"title":"FT: Add putBucketWebsite to API","user":{"login":"electrachong","id":15208707,"avatar_url":"https://avatars.githubusercontent.com/u/15208707?v=3","gravatar_id":"","url":"https://api.github.com/users/electrachong","html_url":"https://github.com/electrachong","followers_url":"https://api.github.com/users/electrachong/followers","following_url":"https://api.github.com/users/electrachong/following{/other_user}","gists_url":"https://api.github.com/users/electrachong/gists{/gist_id}","starred_url":"https://api.github.com/users/electrachong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electrachong/subscriptions","organizations_url":"https://api.github.com/users/electrachong/orgs","repos_url":"https://api.github.com/users/electrachong/repos","events_url":"https://api.github.com/users/electrachong/events{/privacy}","received_events_url":"https://api.github.com/users/electrachong/received_events","type":"User","site_admin":false},"body":"Depends on\r\nscality/Arsenal#196,\r\nscality/utapi#67, &\r\nscality/Integration#321\r\n\r\nCall action for ?website query in routePUT\r\n* Add putBucketWebsite to shielded actions\r\n* Update BucketInfo modelVersion to 4: include website configuration info\r\n* Parse and validate xml WebsiteConfiguration body\r\n* Send API metrics to utapi & deliver success or err response","created_at":"2016-11-29T00:52:16Z","updated_at":"2016-12-09T00:55:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76e80abdb992aa391d74dab26d473467172bfc57","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scality/S3/pulls/432/commits","review_comments_url":"https://api.github.com/repos/scality/S3/pulls/432/comments","review_comment_url":"https://api.github.com/repos/scality/S3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scality/S3/issues/432/comments","statuses_url":"https://api.github.com/repos/scality/S3/statuses/2075daafa6f537dd5a9692a9c855b08adae30d45","head":{"label":"scality:ft/putBucketWebsite","ref":"ft/putBucketWebsite","sha":"2075daafa6f537dd5a9692a9c855b08adae30d45","user":{"login":"scality","id":383812,"avatar_url":"https://avatars.githubusercontent.com/u/383812?v=3","gravatar_id":"","url":"https://api.github.com/users/scality","html_url":"https://github.com/scality","followers_url":"https://api.github.com/users/scality/followers","following_url":"https://api.github.com/users/scality/following{/other_user}","gists_url":"https://api.github.com/users/scality/gists{/gist_id}","starred_url":"https://api.github.com/users/scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scality/subscriptions","organizations_url":"https://api.github.com/users/scality/orgs","repos_url":"https://api.github.com/users/scality/repos","events_url":"https://api.github.com/users/scality/events{/privacy}","received_events_url":"https://api.github.com/users/scality/received_events","type":"Organization","site_admin":false},"repo":{"id":60165924,"name":"S3","full_name":"scality/S3","owner":{"login":"scality","id":383812,"avatar_url":"https://avatars.githubusercontent.com/u/383812?v=3","gravatar_id":"","url":"https://api.github.com/users/scality","html_url":"https://github.com/scality","followers_url":"https://api.github.com/users/scality/followers","following_url":"https://api.github.com/users/scality/following{/other_user}","gists_url":"https://api.github.com/users/scality/gists{/gist_id}","starred_url":"https://api.github.com/users/scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scality/subscriptions","organizations_url":"https://api.github.com/users/scality/orgs","repos_url":"https://api.github.com/users/scality/repos","events_url":"https://api.github.com/users/scality/events{/privacy}","received_events_url":"https://api.github.com/users/scality/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scality/S3","description":"An open-source Node.js implementation of a server handling the S3 protocol","fork":false,"url":"https://api.github.com/repos/scality/S3","forks_url":"https://api.github.com/repos/scality/S3/forks","keys_url":"https://api.github.com/repos/scality/S3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scality/S3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scality/S3/teams","hooks_url":"https://api.github.com/repos/scality/S3/hooks","issue_events_url":"https://api.github.com/repos/scality/S3/issues/events{/number}","events_url":"https://api.github.com/repos/scality/S3/events","assignees_url":"https://api.github.com/repos/scality/S3/assignees{/user}","branches_url":"https://api.github.com/repos/scality/S3/branches{/branch}","tags_url":"https://api.github.com/repos/scality/S3/tags","blobs_url":"https://api.github.com/repos/scality/S3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scality/S3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scality/S3/git/refs{/sha}","trees_url":"https://api.github.com/repos/scality/S3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scality/S3/statuses/{sha}","languages_url":"https://api.github.com/repos/scality/S3/languages","stargazers_url":"https://api.github.com/repos/scality/S3/stargazers","contributors_url":"https://api.github.com/repos/scality/S3/contributors","subscribers_url":"https://api.github.com/repos/scality/S3/subscribers","subscription_url":"https://api.github.com/repos/scality/S3/subscription","commits_url":"https://api.github.com/repos/scality/S3/commits{/sha}","git_commits_url":"https://api.github.com/repos/scality/S3/git/commits{/sha}","comments_url":"https://api.github.com/repos/scality/S3/comments{/number}","issue_comment_url":"https://api.github.com/repos/scality/S3/issues/comments{/number}","contents_url":"https://api.github.com/repos/scality/S3/contents/{+path}","compare_url":"https://api.github.com/repos/scality/S3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scality/S3/merges","archive_url":"https://api.github.com/repos/scality/S3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scality/S3/downloads","issues_url":"https://api.github.com/repos/scality/S3/issues{/number}","pulls_url":"https://api.github.com/repos/scality/S3/pulls{/number}","milestones_url":"https://api.github.com/repos/scality/S3/milestones{/number}","notifications_url":"https://api.github.com/repos/scality/S3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scality/S3/labels{/name}","releases_url":"https://api.github.com/repos/scality/S3/releases{/id}","deployments_url":"https://api.github.com/repos/scality/S3/deployments","created_at":"2016-06-01T09:58:56Z","updated_at":"2016-12-08T00:27:23Z","pushed_at":"2016-12-09T00:45:48Z","git_url":"git://github.com/scality/S3.git","ssh_url":"git@github.com:scality/S3.git","clone_url":"https://github.com/scality/S3.git","svn_url":"https://github.com/scality/S3","homepage":"http://s3.scality.com","size":4174,"stargazers_count":278,"watchers_count":278,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":38,"forks":38,"open_issues":38,"watchers":278,"default_branch":"master"}},"base":{"label":"scality:master","ref":"master","sha":"574286648ec030fc44796287e5a4696ac276f2f8","user":{"login":"scality","id":383812,"avatar_url":"https://avatars.githubusercontent.com/u/383812?v=3","gravatar_id":"","url":"https://api.github.com/users/scality","html_url":"https://github.com/scality","followers_url":"https://api.github.com/users/scality/followers","following_url":"https://api.github.com/users/scality/following{/other_user}","gists_url":"https://api.github.com/users/scality/gists{/gist_id}","starred_url":"https://api.github.com/users/scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scality/subscriptions","organizations_url":"https://api.github.com/users/scality/orgs","repos_url":"https://api.github.com/users/scality/repos","events_url":"https://api.github.com/users/scality/events{/privacy}","received_events_url":"https://api.github.com/users/scality/received_events","type":"Organization","site_admin":false},"repo":{"id":60165924,"name":"S3","full_name":"scality/S3","owner":{"login":"scality","id":383812,"avatar_url":"https://avatars.githubusercontent.com/u/383812?v=3","gravatar_id":"","url":"https://api.github.com/users/scality","html_url":"https://github.com/scality","followers_url":"https://api.github.com/users/scality/followers","following_url":"https://api.github.com/users/scality/following{/other_user}","gists_url":"https://api.github.com/users/scality/gists{/gist_id}","starred_url":"https://api.github.com/users/scality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scality/subscriptions","organizations_url":"https://api.github.com/users/scality/orgs","repos_url":"https://api.github.com/users/scality/repos","events_url":"https://api.github.com/users/scality/events{/privacy}","received_events_url":"https://api.github.com/users/scality/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scality/S3","description":"An open-source Node.js implementation of a server handling the S3 protocol","fork":false,"url":"https://api.github.com/repos/scality/S3","forks_url":"https://api.github.com/repos/scality/S3/forks","keys_url":"https://api.github.com/repos/scality/S3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scality/S3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scality/S3/teams","hooks_url":"https://api.github.com/repos/scality/S3/hooks","issue_events_url":"https://api.github.com/repos/scality/S3/issues/events{/number}","events_url":"https://api.github.com/repos/scality/S3/events","assignees_url":"https://api.github.com/repos/scality/S3/assignees{/user}","branches_url":"https://api.github.com/repos/scality/S3/branches{/branch}","tags_url":"https://api.github.com/repos/scality/S3/tags","blobs_url":"https://api.github.com/repos/scality/S3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scality/S3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scality/S3/git/refs{/sha}","trees_url":"https://api.github.com/repos/scality/S3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scality/S3/statuses/{sha}","languages_url":"https://api.github.com/repos/scality/S3/languages","stargazers_url":"https://api.github.com/repos/scality/S3/stargazers","contributors_url":"https://api.github.com/repos/scality/S3/contributors","subscribers_url":"https://api.github.com/repos/scality/S3/subscribers","subscription_url":"https://api.github.com/repos/scality/S3/subscription","commits_url":"https://api.github.com/repos/scality/S3/commits{/sha}","git_commits_url":"https://api.github.com/repos/scality/S3/git/commits{/sha}","comments_url":"https://api.github.com/repos/scality/S3/comments{/number}","issue_comment_url":"https://api.github.com/repos/scality/S3/issues/comments{/number}","contents_url":"https://api.github.com/repos/scality/S3/contents/{+path}","compare_url":"https://api.github.com/repos/scality/S3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scality/S3/merges","archive_url":"https://api.github.com/repos/scality/S3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scality/S3/downloads","issues_url":"https://api.github.com/repos/scality/S3/issues{/number}","pulls_url":"https://api.github.com/repos/scality/S3/pulls{/number}","milestones_url":"https://api.github.com/repos/scality/S3/milestones{/number}","notifications_url":"https://api.github.com/repos/scality/S3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scality/S3/labels{/name}","releases_url":"https://api.github.com/repos/scality/S3/releases{/id}","deployments_url":"https://api.github.com/repos/scality/S3/deployments","created_at":"2016-06-01T09:58:56Z","updated_at":"2016-12-08T00:27:23Z","pushed_at":"2016-12-09T00:45:48Z","git_url":"git://github.com/scality/S3.git","ssh_url":"git@github.com:scality/S3.git","clone_url":"https://github.com/scality/S3.git","svn_url":"https://github.com/scality/S3","homepage":"http://s3.scality.com","size":4174,"stargazers_count":278,"watchers_count":278,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":38,"forks":38,"open_issues":38,"watchers":278,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scality/S3/pulls/432"},"html":{"href":"https://github.com/scality/S3/pull/432"},"issue":{"href":"https://api.github.com/repos/scality/S3/issues/432"},"comments":{"href":"https://api.github.com/repos/scality/S3/issues/432/comments"},"review_comments":{"href":"https://api.github.com/repos/scality/S3/pulls/432/comments"},"review_comment":{"href":"https://api.github.com/repos/scality/S3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scality/S3/pulls/432/commits"},"statuses":{"href":"https://api.github.com/repos/scality/S3/statuses/2075daafa6f537dd5a9692a9c855b08adae30d45"}}}}
{"actor":{"display_login":"electrachong"}}