{"action":"created","comment":{"url":"https://api.github.com/repos/datawire/ambassador/pulls/comments/197007705","pull_request_review_id":130663302,"id":197007705,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzAwNzcwNQ==","diff_hunk":"@@ -122,6 +122,46 @@ def get(self, key, *args):\n         else:\n             return self.attrs.get(key)\n \n+    @staticmethod\n+    def add_to_dict_if_key_exists(key1, dict1, key2, dict2):\n+        \"\"\"If dict1[key1] exists, and\n+        - is a list, e.g. [\"1\",\"2\",\"3\"], then dict2[key2] is set as \"1, 2, 3\"\n+        - is something else, then set as dict2[key2]\n+\n+        :param key1: key to exist in dict1\n+        :param dict1: dict which should contain key1\n+        :param key2: key in dict2 to be set\n+        :param dict2: dict which should container key2\n+        \"\"\"\n+        if dict1.get(key1) is not None:\n+            if type(dict1.get(key1)) is list:\n+                dict2[key2] = \", \".join(dict1.get(key1))\n+            else:\n+                dict2[key2] = dict1.get(key1)\n+\n+    def generate_route_cors(self, cors, route_cors):\n+        \"\"\"Generates envoy's cors configuration from ambassador's cors configuration\n+\n+        :param cors: dict that contains ambassador's representation of cors\n+        :param route_cors: envoy's route's cors configuration dict","path":"ambassador/ambassador/mapping.py","position":25,"original_position":25,"commit_id":"f5ed515c325ccbf1fbb30d772369f9c7102f9710","original_commit_id":"f5ed515c325ccbf1fbb30d772369f9c7102f9710","user":{"login":"kflynn","id":1126180,"node_id":"MDQ6VXNlcjExMjYxODA=","avatar_url":"https://avatars1.githubusercontent.com/u/1126180?v=4","gravatar_id":"","url":"https://api.github.com/users/kflynn","html_url":"https://github.com/kflynn","followers_url":"https://api.github.com/users/kflynn/followers","following_url":"https://api.github.com/users/kflynn/following{/other_user}","gists_url":"https://api.github.com/users/kflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/kflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kflynn/subscriptions","organizations_url":"https://api.github.com/users/kflynn/orgs","repos_url":"https://api.github.com/users/kflynn/repos","events_url":"https://api.github.com/users/kflynn/events{/privacy}","received_events_url":"https://api.github.com/users/kflynn/received_events","type":"User","site_admin":false},"body":"Same here -- that's just `self.cors`, no?\r\n","created_at":"2018-06-21T04:28:51Z","updated_at":"2018-06-21T04:28:52Z","html_url":"https://github.com/datawire/ambassador/pull/529#discussion_r197007705","pull_request_url":"https://api.github.com/repos/datawire/ambassador/pulls/529","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/datawire/ambassador/pulls/comments/197007705"},"html":{"href":"https://github.com/datawire/ambassador/pull/529#discussion_r197007705"},"pull_request":{"href":"https://api.github.com/repos/datawire/ambassador/pulls/529"}}},"pull_request":{"url":"https://api.github.com/repos/datawire/ambassador/pulls/529","id":195155448,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MTU1NDQ4","html_url":"https://github.com/datawire/ambassador/pull/529","diff_url":"https://github.com/datawire/ambassador/pull/529.diff","patch_url":"https://github.com/datawire/ambassador/pull/529.patch","issue_url":"https://api.github.com/repos/datawire/ambassador/issues/529","number":529,"state":"open","locked":false,"title":"Move YAML strings to YAML arrays for CORS configuration","user":{"login":"containscafeine","id":9133660,"node_id":"MDQ6VXNlcjkxMzM2NjA=","avatar_url":"https://avatars1.githubusercontent.com/u/9133660?v=4","gravatar_id":"","url":"https://api.github.com/users/containscafeine","html_url":"https://github.com/containscafeine","followers_url":"https://api.github.com/users/containscafeine/followers","following_url":"https://api.github.com/users/containscafeine/following{/other_user}","gists_url":"https://api.github.com/users/containscafeine/gists{/gist_id}","starred_url":"https://api.github.com/users/containscafeine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containscafeine/subscriptions","organizations_url":"https://api.github.com/users/containscafeine/orgs","repos_url":"https://api.github.com/users/containscafeine/repos","events_url":"https://api.github.com/users/containscafeine/events{/privacy}","received_events_url":"https://api.github.com/users/containscafeine/received_events","type":"User","site_admin":false},"body":"This commit makes defining CORS configuration in ambassador more\nreadable by moving comma separated strings, which envoy supports,\nto YAML arrays.\n\nThe previous format looks like -\n```yaml\ncors:\n  origins: http://foo.example,http://bar.example\n  methods: POST, GET, OPTIONS\n  headers: Content-Type,Accept,Authorization\n  credentials: true\n  exposed_headers: X-Custom-Header\n  max_age: \"86400\"\n```\n\nThe new format looks like -\n```yaml\ncors:\n  origins:\n  - http://foo.example\n  - http://bar.example\n  methods:\n  - POST\n  - GET\n  - OPTIONS\n  headers:\n  - Content-Type\n  - Accept\n  - Authorization\n  credentials: true\n  exposed_headers:\n  - X-Custom-Header\n  max_age: \"86400\"\n```\n\nFix #466","created_at":"2018-06-15T12:07:19Z","updated_at":"2018-06-21T04:28:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd695240aaaa75ee1871f83089ad29eca93b3267","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/datawire/ambassador/pulls/529/commits","review_comments_url":"https://api.github.com/repos/datawire/ambassador/pulls/529/comments","review_comment_url":"https://api.github.com/repos/datawire/ambassador/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datawire/ambassador/issues/529/comments","statuses_url":"https://api.github.com/repos/datawire/ambassador/statuses/f5ed515c325ccbf1fbb30d772369f9c7102f9710","head":{"label":"datawire:concaf/fix/cors-yaml-array","ref":"concaf/fix/cors-yaml-array","sha":"f5ed515c325ccbf1fbb30d772369f9c7102f9710","user":{"login":"datawire","id":9270257,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkyNzAyNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/9270257?v=4","gravatar_id":"","url":"https://api.github.com/users/datawire","html_url":"https://github.com/datawire","followers_url":"https://api.github.com/users/datawire/followers","following_url":"https://api.github.com/users/datawire/following{/other_user}","gists_url":"https://api.github.com/users/datawire/gists{/gist_id}","starred_url":"https://api.github.com/users/datawire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datawire/subscriptions","organizations_url":"https://api.github.com/users/datawire/orgs","repos_url":"https://api.github.com/users/datawire/repos","events_url":"https://api.github.com/users/datawire/events{/privacy}","received_events_url":"https://api.github.com/users/datawire/received_events","type":"Organization","site_admin":false},"repo":{"id":86740149,"node_id":"MDEwOlJlcG9zaXRvcnk4Njc0MDE0OQ==","name":"ambassador","full_name":"datawire/ambassador","owner":{"login":"datawire","id":9270257,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkyNzAyNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/9270257?v=4","gravatar_id":"","url":"https://api.github.com/users/datawire","html_url":"https://github.com/datawire","followers_url":"https://api.github.com/users/datawire/followers","following_url":"https://api.github.com/users/datawire/following{/other_user}","gists_url":"https://api.github.com/users/datawire/gists{/gist_id}","starred_url":"https://api.github.com/users/datawire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datawire/subscriptions","organizations_url":"https://api.github.com/users/datawire/orgs","repos_url":"https://api.github.com/users/datawire/repos","events_url":"https://api.github.com/users/datawire/events{/privacy}","received_events_url":"https://api.github.com/users/datawire/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datawire/ambassador","description":"open source Kubernetes-native API gateway for microservices built on the Envoy Proxy","fork":false,"url":"https://api.github.com/repos/datawire/ambassador","forks_url":"https://api.github.com/repos/datawire/ambassador/forks","keys_url":"https://api.github.com/repos/datawire/ambassador/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datawire/ambassador/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datawire/ambassador/teams","hooks_url":"https://api.github.com/repos/datawire/ambassador/hooks","issue_events_url":"https://api.github.com/repos/datawire/ambassador/issues/events{/number}","events_url":"https://api.github.com/repos/datawire/ambassador/events","assignees_url":"https://api.github.com/repos/datawire/ambassador/assignees{/user}","branches_url":"https://api.github.com/repos/datawire/ambassador/branches{/branch}","tags_url":"https://api.github.com/repos/datawire/ambassador/tags","blobs_url":"https://api.github.com/repos/datawire/ambassador/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datawire/ambassador/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datawire/ambassador/git/refs{/sha}","trees_url":"https://api.github.com/repos/datawire/ambassador/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datawire/ambassador/statuses/{sha}","languages_url":"https://api.github.com/repos/datawire/ambassador/languages","stargazers_url":"https://api.github.com/repos/datawire/ambassador/stargazers","contributors_url":"https://api.github.com/repos/datawire/ambassador/contributors","subscribers_url":"https://api.github.com/repos/datawire/ambassador/subscribers","subscription_url":"https://api.github.com/repos/datawire/ambassador/subscription","commits_url":"https://api.github.com/repos/datawire/ambassador/commits{/sha}","git_commits_url":"https://api.github.com/repos/datawire/ambassador/git/commits{/sha}","comments_url":"https://api.github.com/repos/datawire/ambassador/comments{/number}","issue_comment_url":"https://api.github.com/repos/datawire/ambassador/issues/comments{/number}","contents_url":"https://api.github.com/repos/datawire/ambassador/contents/{+path}","compare_url":"https://api.github.com/repos/datawire/ambassador/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datawire/ambassador/merges","archive_url":"https://api.github.com/repos/datawire/ambassador/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datawire/ambassador/downloads","issues_url":"https://api.github.com/repos/datawire/ambassador/issues{/number}","pulls_url":"https://api.github.com/repos/datawire/ambassador/pulls{/number}","milestones_url":"https://api.github.com/repos/datawire/ambassador/milestones{/number}","notifications_url":"https://api.github.com/repos/datawire/ambassador/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datawire/ambassador/labels{/name}","releases_url":"https://api.github.com/repos/datawire/ambassador/releases{/id}","deployments_url":"https://api.github.com/repos/datawire/ambassador/deployments","created_at":"2017-03-30T19:22:52Z","updated_at":"2018-06-21T02:58:13Z","pushed_at":"2018-06-20T18:57:14Z","git_url":"git://github.com/datawire/ambassador.git","ssh_url":"git@github.com:datawire/ambassador.git","clone_url":"https://github.com/datawire/ambassador.git","svn_url":"https://github.com/datawire/ambassador","homepage":"https://www.getambassador.io","size":3777,"stargazers_count":754,"watchers_count":754,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"archived":false,"open_issues_count":95,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":79,"open_issues":95,"watchers":754,"default_branch":"master"}},"base":{"label":"datawire:master","ref":"master","sha":"cf84b318a85d737f5d0aef1ade4f4f940fdedbd3","user":{"login":"datawire","id":9270257,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkyNzAyNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/9270257?v=4","gravatar_id":"","url":"https://api.github.com/users/datawire","html_url":"https://github.com/datawire","followers_url":"https://api.github.com/users/datawire/followers","following_url":"https://api.github.com/users/datawire/following{/other_user}","gists_url":"https://api.github.com/users/datawire/gists{/gist_id}","starred_url":"https://api.github.com/users/datawire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datawire/subscriptions","organizations_url":"https://api.github.com/users/datawire/orgs","repos_url":"https://api.github.com/users/datawire/repos","events_url":"https://api.github.com/users/datawire/events{/privacy}","received_events_url":"https://api.github.com/users/datawire/received_events","type":"Organization","site_admin":false},"repo":{"id":86740149,"node_id":"MDEwOlJlcG9zaXRvcnk4Njc0MDE0OQ==","name":"ambassador","full_name":"datawire/ambassador","owner":{"login":"datawire","id":9270257,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkyNzAyNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/9270257?v=4","gravatar_id":"","url":"https://api.github.com/users/datawire","html_url":"https://github.com/datawire","followers_url":"https://api.github.com/users/datawire/followers","following_url":"https://api.github.com/users/datawire/following{/other_user}","gists_url":"https://api.github.com/users/datawire/gists{/gist_id}","starred_url":"https://api.github.com/users/datawire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datawire/subscriptions","organizations_url":"https://api.github.com/users/datawire/orgs","repos_url":"https://api.github.com/users/datawire/repos","events_url":"https://api.github.com/users/datawire/events{/privacy}","received_events_url":"https://api.github.com/users/datawire/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datawire/ambassador","description":"open source Kubernetes-native API gateway for microservices built on the Envoy Proxy","fork":false,"url":"https://api.github.com/repos/datawire/ambassador","forks_url":"https://api.github.com/repos/datawire/ambassador/forks","keys_url":"https://api.github.com/repos/datawire/ambassador/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datawire/ambassador/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datawire/ambassador/teams","hooks_url":"https://api.github.com/repos/datawire/ambassador/hooks","issue_events_url":"https://api.github.com/repos/datawire/ambassador/issues/events{/number}","events_url":"https://api.github.com/repos/datawire/ambassador/events","assignees_url":"https://api.github.com/repos/datawire/ambassador/assignees{/user}","branches_url":"https://api.github.com/repos/datawire/ambassador/branches{/branch}","tags_url":"https://api.github.com/repos/datawire/ambassador/tags","blobs_url":"https://api.github.com/repos/datawire/ambassador/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datawire/ambassador/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datawire/ambassador/git/refs{/sha}","trees_url":"https://api.github.com/repos/datawire/ambassador/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datawire/ambassador/statuses/{sha}","languages_url":"https://api.github.com/repos/datawire/ambassador/languages","stargazers_url":"https://api.github.com/repos/datawire/ambassador/stargazers","contributors_url":"https://api.github.com/repos/datawire/ambassador/contributors","subscribers_url":"https://api.github.com/repos/datawire/ambassador/subscribers","subscription_url":"https://api.github.com/repos/datawire/ambassador/subscription","commits_url":"https://api.github.com/repos/datawire/ambassador/commits{/sha}","git_commits_url":"https://api.github.com/repos/datawire/ambassador/git/commits{/sha}","comments_url":"https://api.github.com/repos/datawire/ambassador/comments{/number}","issue_comment_url":"https://api.github.com/repos/datawire/ambassador/issues/comments{/number}","contents_url":"https://api.github.com/repos/datawire/ambassador/contents/{+path}","compare_url":"https://api.github.com/repos/datawire/ambassador/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datawire/ambassador/merges","archive_url":"https://api.github.com/repos/datawire/ambassador/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datawire/ambassador/downloads","issues_url":"https://api.github.com/repos/datawire/ambassador/issues{/number}","pulls_url":"https://api.github.com/repos/datawire/ambassador/pulls{/number}","milestones_url":"https://api.github.com/repos/datawire/ambassador/milestones{/number}","notifications_url":"https://api.github.com/repos/datawire/ambassador/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datawire/ambassador/labels{/name}","releases_url":"https://api.github.com/repos/datawire/ambassador/releases{/id}","deployments_url":"https://api.github.com/repos/datawire/ambassador/deployments","created_at":"2017-03-30T19:22:52Z","updated_at":"2018-06-21T02:58:13Z","pushed_at":"2018-06-20T18:57:14Z","git_url":"git://github.com/datawire/ambassador.git","ssh_url":"git@github.com:datawire/ambassador.git","clone_url":"https://github.com/datawire/ambassador.git","svn_url":"https://github.com/datawire/ambassador","homepage":"https://www.getambassador.io","size":3777,"stargazers_count":754,"watchers_count":754,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"archived":false,"open_issues_count":95,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":79,"open_issues":95,"watchers":754,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datawire/ambassador/pulls/529"},"html":{"href":"https://github.com/datawire/ambassador/pull/529"},"issue":{"href":"https://api.github.com/repos/datawire/ambassador/issues/529"},"comments":{"href":"https://api.github.com/repos/datawire/ambassador/issues/529/comments"},"review_comments":{"href":"https://api.github.com/repos/datawire/ambassador/pulls/529/comments"},"review_comment":{"href":"https://api.github.com/repos/datawire/ambassador/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datawire/ambassador/pulls/529/commits"},"statuses":{"href":"https://api.github.com/repos/datawire/ambassador/statuses/f5ed515c325ccbf1fbb30d772369f9c7102f9710"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kflynn"}}