{"action":"created","comment":{"url":"https://api.github.com/repos/discourse/discourse/pulls/comments/237710477","pull_request_review_id":180079378,"id":237710477,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzcxMDQ3Nw==","diff_hunk":"@@ -78,14 +79,50 @@\n         http://test.localhost/extra-locales/\n       ])\n     end\n+  end\n \n-    it 'can be extended with more sources' do\n-      SiteSetting.content_security_policy_script_src = 'example.com|another.com'\n-      script_srcs = parse(ContentSecurityPolicy.new.build)['script-src']\n-      expect(script_srcs).to include('example.com')\n-      expect(script_srcs).to include('another.com')\n-      expect(script_srcs).to include(\"'unsafe-eval'\")\n-    end\n+  it 'can be extended by plugins' do\n+    plugin = Plugin::Instance.new(nil, \"#{Rails.root}/spec/fixtures/plugins/csp_extension/plugin.rb\")\n+\n+    plugin.activate!\n+    Discourse.plugins << plugin\n+    SiteSetting.load_settings(\"#{Rails.root}/spec/fixtures/plugins/csp_extension/config/settings.yml\")","path":"spec/lib/content_security_policy_spec.rb","position":83,"original_position":83,"commit_id":"f3edcca49e51be5eebb5d2deb90e4e5e7d93a56c","original_commit_id":"f3edcca49e51be5eebb5d2deb90e4e5e7d93a56c","user":{"login":"SamSaffron","id":5213,"node_id":"MDQ6VXNlcjUyMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/5213?v=4","gravatar_id":"","url":"https://api.github.com/users/SamSaffron","html_url":"https://github.com/SamSaffron","followers_url":"https://api.github.com/users/SamSaffron/followers","following_url":"https://api.github.com/users/SamSaffron/following{/other_user}","gists_url":"https://api.github.com/users/SamSaffron/gists{/gist_id}","starred_url":"https://api.github.com/users/SamSaffron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamSaffron/subscriptions","organizations_url":"https://api.github.com/users/SamSaffron/orgs","repos_url":"https://api.github.com/users/SamSaffron/repos","events_url":"https://api.github.com/users/SamSaffron/events{/privacy}","received_events_url":"https://api.github.com/users/SamSaffron/received_events","type":"User","site_admin":false},"body":"Are you 100% sure state is not going to get leaked here between tests? ","created_at":"2018-11-30T00:31:04Z","updated_at":"2018-11-30T00:31:05Z","html_url":"https://github.com/discourse/discourse/pull/6704#discussion_r237710477","pull_request_url":"https://api.github.com/repos/discourse/discourse/pulls/6704","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/discourse/discourse/pulls/comments/237710477"},"html":{"href":"https://github.com/discourse/discourse/pull/6704#discussion_r237710477"},"pull_request":{"href":"https://api.github.com/repos/discourse/discourse/pulls/6704"}}},"pull_request":{"url":"https://api.github.com/repos/discourse/discourse/pulls/6704","id":234679711,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0Njc5NzEx","html_url":"https://github.com/discourse/discourse/pull/6704","diff_url":"https://github.com/discourse/discourse/pull/6704.diff","patch_url":"https://github.com/discourse/discourse/pull/6704.patch","issue_url":"https://api.github.com/repos/discourse/discourse/issues/6704","number":6704,"state":"open","locked":false,"title":"FEATURE: allow plugins and themes to extend the default CSP","user":{"login":"xrav3nz","id":6376558,"node_id":"MDQ6VXNlcjYzNzY1NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6376558?v=4","gravatar_id":"","url":"https://api.github.com/users/xrav3nz","html_url":"https://github.com/xrav3nz","followers_url":"https://api.github.com/users/xrav3nz/followers","following_url":"https://api.github.com/users/xrav3nz/following{/other_user}","gists_url":"https://api.github.com/users/xrav3nz/gists{/gist_id}","starred_url":"https://api.github.com/users/xrav3nz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xrav3nz/subscriptions","organizations_url":"https://api.github.com/users/xrav3nz/orgs","repos_url":"https://api.github.com/users/xrav3nz/repos","events_url":"https://api.github.com/users/xrav3nz/events{/privacy}","received_events_url":"https://api.github.com/users/xrav3nz/received_events","type":"User","site_admin":false},"body":"For plugins:\r\n\r\n```rb\r\n# plugin.rb\r\nextend_content_security_policy(\r\n  script_src: ['https://domain.com/script.js', 'https://your-cdn.com/'],\r\n  style_src: ['https://domain.com/style.css']\r\n)\r\n```\r\n\r\nFor themes and components:\r\n\r\n```yml\r\n# settings.yml\r\nextend_content_security_policy:\r\n  type: list\r\n  default: \"script_src:https://domain.com/|style_src:https://domain.com\"\r\n```","created_at":"2018-11-29T15:28:13Z","updated_at":"2018-11-30T00:31:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6cd4a0dc1d0a8665fdded4393ac4177d40d74371","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/discourse/discourse/pulls/6704/commits","review_comments_url":"https://api.github.com/repos/discourse/discourse/pulls/6704/comments","review_comment_url":"https://api.github.com/repos/discourse/discourse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/discourse/discourse/issues/6704/comments","statuses_url":"https://api.github.com/repos/discourse/discourse/statuses/f3edcca49e51be5eebb5d2deb90e4e5e7d93a56c","head":{"label":"xrav3nz:csp/plugin-apis-take-2","ref":"csp/plugin-apis-take-2","sha":"f3edcca49e51be5eebb5d2deb90e4e5e7d93a56c","user":{"login":"xrav3nz","id":6376558,"node_id":"MDQ6VXNlcjYzNzY1NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6376558?v=4","gravatar_id":"","url":"https://api.github.com/users/xrav3nz","html_url":"https://github.com/xrav3nz","followers_url":"https://api.github.com/users/xrav3nz/followers","following_url":"https://api.github.com/users/xrav3nz/following{/other_user}","gists_url":"https://api.github.com/users/xrav3nz/gists{/gist_id}","starred_url":"https://api.github.com/users/xrav3nz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xrav3nz/subscriptions","organizations_url":"https://api.github.com/users/xrav3nz/orgs","repos_url":"https://api.github.com/users/xrav3nz/repos","events_url":"https://api.github.com/users/xrav3nz/events{/privacy}","received_events_url":"https://api.github.com/users/xrav3nz/received_events","type":"User","site_admin":false},"repo":{"id":99668064,"node_id":"MDEwOlJlcG9zaXRvcnk5OTY2ODA2NA==","name":"discourse","full_name":"xrav3nz/discourse","private":false,"owner":{"login":"xrav3nz","id":6376558,"node_id":"MDQ6VXNlcjYzNzY1NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6376558?v=4","gravatar_id":"","url":"https://api.github.com/users/xrav3nz","html_url":"https://github.com/xrav3nz","followers_url":"https://api.github.com/users/xrav3nz/followers","following_url":"https://api.github.com/users/xrav3nz/following{/other_user}","gists_url":"https://api.github.com/users/xrav3nz/gists{/gist_id}","starred_url":"https://api.github.com/users/xrav3nz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xrav3nz/subscriptions","organizations_url":"https://api.github.com/users/xrav3nz/orgs","repos_url":"https://api.github.com/users/xrav3nz/repos","events_url":"https://api.github.com/users/xrav3nz/events{/privacy}","received_events_url":"https://api.github.com/users/xrav3nz/received_events","type":"User","site_admin":false},"html_url":"https://github.com/xrav3nz/discourse","description":"A platform for community discussion. Free, open, simple.","fork":true,"url":"https://api.github.com/repos/xrav3nz/discourse","forks_url":"https://api.github.com/repos/xrav3nz/discourse/forks","keys_url":"https://api.github.com/repos/xrav3nz/discourse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xrav3nz/discourse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xrav3nz/discourse/teams","hooks_url":"https://api.github.com/repos/xrav3nz/discourse/hooks","issue_events_url":"https://api.github.com/repos/xrav3nz/discourse/issues/events{/number}","events_url":"https://api.github.com/repos/xrav3nz/discourse/events","assignees_url":"https://api.github.com/repos/xrav3nz/discourse/assignees{/user}","branches_url":"https://api.github.com/repos/xrav3nz/discourse/branches{/branch}","tags_url":"https://api.github.com/repos/xrav3nz/discourse/tags","blobs_url":"https://api.github.com/repos/xrav3nz/discourse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xrav3nz/discourse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xrav3nz/discourse/git/refs{/sha}","trees_url":"https://api.github.com/repos/xrav3nz/discourse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xrav3nz/discourse/statuses/{sha}","languages_url":"https://api.github.com/repos/xrav3nz/discourse/languages","stargazers_url":"https://api.github.com/repos/xrav3nz/discourse/stargazers","contributors_url":"https://api.github.com/repos/xrav3nz/discourse/contributors","subscribers_url":"https://api.github.com/repos/xrav3nz/discourse/subscribers","subscription_url":"https://api.github.com/repos/xrav3nz/discourse/subscription","commits_url":"https://api.github.com/repos/xrav3nz/discourse/commits{/sha}","git_commits_url":"https://api.github.com/repos/xrav3nz/discourse/git/commits{/sha}","comments_url":"https://api.github.com/repos/xrav3nz/discourse/comments{/number}","issue_comment_url":"https://api.github.com/repos/xrav3nz/discourse/issues/comments{/number}","contents_url":"https://api.github.com/repos/xrav3nz/discourse/contents/{+path}","compare_url":"https://api.github.com/repos/xrav3nz/discourse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xrav3nz/discourse/merges","archive_url":"https://api.github.com/repos/xrav3nz/discourse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xrav3nz/discourse/downloads","issues_url":"https://api.github.com/repos/xrav3nz/discourse/issues{/number}","pulls_url":"https://api.github.com/repos/xrav3nz/discourse/pulls{/number}","milestones_url":"https://api.github.com/repos/xrav3nz/discourse/milestones{/number}","notifications_url":"https://api.github.com/repos/xrav3nz/discourse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xrav3nz/discourse/labels{/name}","releases_url":"https://api.github.com/repos/xrav3nz/discourse/releases{/id}","deployments_url":"https://api.github.com/repos/xrav3nz/discourse/deployments","created_at":"2017-08-08T08:13:56Z","updated_at":"2018-10-26T14:21:05Z","pushed_at":"2018-11-29T23:49:51Z","git_url":"git://github.com/xrav3nz/discourse.git","ssh_url":"git@github.com:xrav3nz/discourse.git","clone_url":"https://github.com/xrav3nz/discourse.git","svn_url":"https://github.com/xrav3nz/discourse","homepage":"https://www.discourse.org","size":243199,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"discourse:master","ref":"master","sha":"40f10855c621a2b059c5d91191a8b4a3b29adbf2","user":{"login":"discourse","id":3220138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMjAxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3220138?v=4","gravatar_id":"","url":"https://api.github.com/users/discourse","html_url":"https://github.com/discourse","followers_url":"https://api.github.com/users/discourse/followers","following_url":"https://api.github.com/users/discourse/following{/other_user}","gists_url":"https://api.github.com/users/discourse/gists{/gist_id}","starred_url":"https://api.github.com/users/discourse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discourse/subscriptions","organizations_url":"https://api.github.com/users/discourse/orgs","repos_url":"https://api.github.com/users/discourse/repos","events_url":"https://api.github.com/users/discourse/events{/privacy}","received_events_url":"https://api.github.com/users/discourse/received_events","type":"Organization","site_admin":false},"repo":{"id":7569578,"node_id":"MDEwOlJlcG9zaXRvcnk3NTY5NTc4","name":"discourse","full_name":"discourse/discourse","private":false,"owner":{"login":"discourse","id":3220138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMjAxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3220138?v=4","gravatar_id":"","url":"https://api.github.com/users/discourse","html_url":"https://github.com/discourse","followers_url":"https://api.github.com/users/discourse/followers","following_url":"https://api.github.com/users/discourse/following{/other_user}","gists_url":"https://api.github.com/users/discourse/gists{/gist_id}","starred_url":"https://api.github.com/users/discourse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discourse/subscriptions","organizations_url":"https://api.github.com/users/discourse/orgs","repos_url":"https://api.github.com/users/discourse/repos","events_url":"https://api.github.com/users/discourse/events{/privacy}","received_events_url":"https://api.github.com/users/discourse/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/discourse/discourse","description":"A platform for community discussion. Free, open, simple.","fork":false,"url":"https://api.github.com/repos/discourse/discourse","forks_url":"https://api.github.com/repos/discourse/discourse/forks","keys_url":"https://api.github.com/repos/discourse/discourse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/discourse/discourse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/discourse/discourse/teams","hooks_url":"https://api.github.com/repos/discourse/discourse/hooks","issue_events_url":"https://api.github.com/repos/discourse/discourse/issues/events{/number}","events_url":"https://api.github.com/repos/discourse/discourse/events","assignees_url":"https://api.github.com/repos/discourse/discourse/assignees{/user}","branches_url":"https://api.github.com/repos/discourse/discourse/branches{/branch}","tags_url":"https://api.github.com/repos/discourse/discourse/tags","blobs_url":"https://api.github.com/repos/discourse/discourse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/discourse/discourse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/discourse/discourse/git/refs{/sha}","trees_url":"https://api.github.com/repos/discourse/discourse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/discourse/discourse/statuses/{sha}","languages_url":"https://api.github.com/repos/discourse/discourse/languages","stargazers_url":"https://api.github.com/repos/discourse/discourse/stargazers","contributors_url":"https://api.github.com/repos/discourse/discourse/contributors","subscribers_url":"https://api.github.com/repos/discourse/discourse/subscribers","subscription_url":"https://api.github.com/repos/discourse/discourse/subscription","commits_url":"https://api.github.com/repos/discourse/discourse/commits{/sha}","git_commits_url":"https://api.github.com/repos/discourse/discourse/git/commits{/sha}","comments_url":"https://api.github.com/repos/discourse/discourse/comments{/number}","issue_comment_url":"https://api.github.com/repos/discourse/discourse/issues/comments{/number}","contents_url":"https://api.github.com/repos/discourse/discourse/contents/{+path}","compare_url":"https://api.github.com/repos/discourse/discourse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/discourse/discourse/merges","archive_url":"https://api.github.com/repos/discourse/discourse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/discourse/discourse/downloads","issues_url":"https://api.github.com/repos/discourse/discourse/issues{/number}","pulls_url":"https://api.github.com/repos/discourse/discourse/pulls{/number}","milestones_url":"https://api.github.com/repos/discourse/discourse/milestones{/number}","notifications_url":"https://api.github.com/repos/discourse/discourse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/discourse/discourse/labels{/name}","releases_url":"https://api.github.com/repos/discourse/discourse/releases{/id}","deployments_url":"https://api.github.com/repos/discourse/discourse/deployments","created_at":"2013-01-12T00:25:55Z","updated_at":"2018-11-30T00:12:52Z","pushed_at":"2018-11-30T00:27:12Z","git_url":"git://github.com/discourse/discourse.git","ssh_url":"git@github.com:discourse/discourse.git","clone_url":"https://github.com/discourse/discourse.git","svn_url":"https://github.com/discourse/discourse","homepage":"https://www.discourse.org","size":244961,"stargazers_count":26755,"watchers_count":26755,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6280,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":6280,"open_issues":17,"watchers":26755,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/discourse/discourse/pulls/6704"},"html":{"href":"https://github.com/discourse/discourse/pull/6704"},"issue":{"href":"https://api.github.com/repos/discourse/discourse/issues/6704"},"comments":{"href":"https://api.github.com/repos/discourse/discourse/issues/6704/comments"},"review_comments":{"href":"https://api.github.com/repos/discourse/discourse/pulls/6704/comments"},"review_comment":{"href":"https://api.github.com/repos/discourse/discourse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/discourse/discourse/pulls/6704/commits"},"statuses":{"href":"https://api.github.com/repos/discourse/discourse/statuses/f3edcca49e51be5eebb5d2deb90e4e5e7d93a56c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"SamSaffron"}}