{"action":"created","comment":{"url":"https://api.github.com/repos/appsembler/edx-platform/pulls/comments/237123516","pull_request_review_id":179345813,"id":237123516,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzEyMzUxNg==","diff_hunk":"@@ -7,6 +7,30 @@\n %>\n % endif\n \n+% if settings.CMS_SEGMENT_KEY and settings.CMS_SEGMENT_SITE:\n+## begin Copy from edx-platform/cms/templates/widgets/segment-io.html\n+## Appsembler: begin Segment Site\n+<script>\n+!function(){\n+    var realOpen = XMLHttpRequest.prototype.open;\n+    var originalAPI = '${settings.SEGMENT_ORIGINAL_API}';\n+    var replicateAPI = '${settings.SEGMENT_REPLICATE_API}';\n+    var csrfToken = '${csrf_token}';","path":"cms/templates/widgets/segment-io.html","position":12,"original_position":12,"commit_id":"f389326f17f515dc7266cc4f34b8a83b1ba0992a","original_commit_id":"f389326f17f515dc7266cc4f34b8a83b1ba0992a","user":{"login":"OmarIthawi","id":645156,"node_id":"MDQ6VXNlcjY0NTE1Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/645156?v=4","gravatar_id":"","url":"https://api.github.com/users/OmarIthawi","html_url":"https://github.com/OmarIthawi","followers_url":"https://api.github.com/users/OmarIthawi/followers","following_url":"https://api.github.com/users/OmarIthawi/following{/other_user}","gists_url":"https://api.github.com/users/OmarIthawi/gists{/gist_id}","starred_url":"https://api.github.com/users/OmarIthawi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OmarIthawi/subscriptions","organizations_url":"https://api.github.com/users/OmarIthawi/orgs","repos_url":"https://api.github.com/users/OmarIthawi/repos","events_url":"https://api.github.com/users/OmarIthawi/events{/privacy}","received_events_url":"https://api.github.com/users/OmarIthawi/received_events","type":"User","site_admin":false},"body":"@pricco thank you for addressing the concern.\r\n\r\nPassing the CSRF token could very easily get bad. Please avoid using such pattern.\r\n\r\nI would highly recommend against using this, especially in combination with `rguments[1].substr(0, originalAPI.length) === originalAPI`, which could mean sending the CSRF token to everyone.\r\n\r\nPlease consider undoing this and reverting back to the `csrf_exempt` decorator on the view.","created_at":"2018-11-28T15:11:59Z","updated_at":"2018-11-28T15:13:49Z","html_url":"https://github.com/appsembler/edx-platform/pull/284#discussion_r237123516","pull_request_url":"https://api.github.com/repos/appsembler/edx-platform/pulls/284","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/appsembler/edx-platform/pulls/comments/237123516"},"html":{"href":"https://github.com/appsembler/edx-platform/pull/284#discussion_r237123516"},"pull_request":{"href":"https://api.github.com/repos/appsembler/edx-platform/pulls/284"}}},"pull_request":{"url":"https://api.github.com/repos/appsembler/edx-platform/pulls/284","id":232463791,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNDYzNzkx","html_url":"https://github.com/appsembler/edx-platform/pull/284","diff_url":"https://github.com/appsembler/edx-platform/pull/284.diff","patch_url":"https://github.com/appsembler/edx-platform/pull/284.patch","issue_url":"https://api.github.com/repos/appsembler/edx-platform/issues/284","number":284,"state":"open","locked":false,"title":"Add support for a site's segment account.","user":{"login":"pricco","id":164531,"node_id":"MDQ6VXNlcjE2NDUzMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/164531?v=4","gravatar_id":"","url":"https://api.github.com/users/pricco","html_url":"https://github.com/pricco","followers_url":"https://api.github.com/users/pricco/followers","following_url":"https://api.github.com/users/pricco/following{/other_user}","gists_url":"https://api.github.com/users/pricco/gists{/gist_id}","starred_url":"https://api.github.com/users/pricco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pricco/subscriptions","organizations_url":"https://api.github.com/users/pricco/orgs","repos_url":"https://api.github.com/users/pricco/repos","events_url":"https://api.github.com/users/pricco/events{/privacy}","received_events_url":"https://api.github.com/users/pricco/received_events","type":"User","site_admin":false},"body":"To enable support for the site segment account:\r\n\r\n`SEGMENT_SITE` = `true` on `/edx/app/edxapp/lms.auth.json` (full name: LMS_SEGMENT_SITE)\r\n\r\n`SEGMENT_SITE` = `true` on `/edx/app/edxapp/cms.auth.json` (full name: CMS_SEGMENT_SITE)\r\n\r\nSet `SEGMENT_KEY` on the site configuration (db).\r\n\r\nSet `GOOGLE_ANALYTICS_TRACKING_ID` on the site configuration to override the GA code before send the event to segmentio.","created_at":"2018-11-20T21:24:44Z","updated_at":"2018-11-28T15:13:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59baf6c689b3109fb61a5d508cf5d5ece996ab8a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/appsembler/edx-platform/pulls/284/commits","review_comments_url":"https://api.github.com/repos/appsembler/edx-platform/pulls/284/comments","review_comment_url":"https://api.github.com/repos/appsembler/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appsembler/edx-platform/issues/284/comments","statuses_url":"https://api.github.com/repos/appsembler/edx-platform/statuses/f389326f17f515dc7266cc4f34b8a83b1ba0992a","head":{"label":"appsembler:feature/pricco/site-segment-support","ref":"feature/pricco/site-segment-support","sha":"f389326f17f515dc7266cc4f34b8a83b1ba0992a","user":{"login":"appsembler","id":1369373,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjkzNzM=","avatar_url":"https://avatars0.githubusercontent.com/u/1369373?v=4","gravatar_id":"","url":"https://api.github.com/users/appsembler","html_url":"https://github.com/appsembler","followers_url":"https://api.github.com/users/appsembler/followers","following_url":"https://api.github.com/users/appsembler/following{/other_user}","gists_url":"https://api.github.com/users/appsembler/gists{/gist_id}","starred_url":"https://api.github.com/users/appsembler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appsembler/subscriptions","organizations_url":"https://api.github.com/users/appsembler/orgs","repos_url":"https://api.github.com/users/appsembler/repos","events_url":"https://api.github.com/users/appsembler/events{/privacy}","received_events_url":"https://api.github.com/users/appsembler/received_events","type":"Organization","site_admin":false},"repo":{"id":24888634,"node_id":"MDEwOlJlcG9zaXRvcnkyNDg4ODYzNA==","name":"edx-platform","full_name":"appsembler/edx-platform","private":false,"owner":{"login":"appsembler","id":1369373,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjkzNzM=","avatar_url":"https://avatars0.githubusercontent.com/u/1369373?v=4","gravatar_id":"","url":"https://api.github.com/users/appsembler","html_url":"https://github.com/appsembler","followers_url":"https://api.github.com/users/appsembler/followers","following_url":"https://api.github.com/users/appsembler/following{/other_user}","gists_url":"https://api.github.com/users/appsembler/gists{/gist_id}","starred_url":"https://api.github.com/users/appsembler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appsembler/subscriptions","organizations_url":"https://api.github.com/users/appsembler/orgs","repos_url":"https://api.github.com/users/appsembler/repos","events_url":"https://api.github.com/users/appsembler/events{/privacy}","received_events_url":"https://api.github.com/users/appsembler/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/appsembler/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":true,"url":"https://api.github.com/repos/appsembler/edx-platform","forks_url":"https://api.github.com/repos/appsembler/edx-platform/forks","keys_url":"https://api.github.com/repos/appsembler/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appsembler/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appsembler/edx-platform/teams","hooks_url":"https://api.github.com/repos/appsembler/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/appsembler/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/appsembler/edx-platform/events","assignees_url":"https://api.github.com/repos/appsembler/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/appsembler/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/appsembler/edx-platform/tags","blobs_url":"https://api.github.com/repos/appsembler/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appsembler/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appsembler/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/appsembler/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appsembler/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/appsembler/edx-platform/languages","stargazers_url":"https://api.github.com/repos/appsembler/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/appsembler/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/appsembler/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/appsembler/edx-platform/subscription","commits_url":"https://api.github.com/repos/appsembler/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/appsembler/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/appsembler/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/appsembler/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/appsembler/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/appsembler/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appsembler/edx-platform/merges","archive_url":"https://api.github.com/repos/appsembler/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appsembler/edx-platform/downloads","issues_url":"https://api.github.com/repos/appsembler/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/appsembler/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/appsembler/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/appsembler/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appsembler/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/appsembler/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/appsembler/edx-platform/deployments","created_at":"2014-10-07T12:09:06Z","updated_at":"2018-09-30T11:41:02Z","pushed_at":"2018-11-27T21:31:00Z","git_url":"git://github.com/appsembler/edx-platform.git","ssh_url":"git@github.com:appsembler/edx-platform.git","clone_url":"https://github.com/appsembler/edx-platform.git","svn_url":"https://github.com/appsembler/edx-platform","homepage":"http://openedx.org/","size":990360,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":18,"open_issues":6,"watchers":2,"default_branch":"master"}},"base":{"label":"appsembler:appsembler/amc/develop","ref":"appsembler/amc/develop","sha":"d9a78a4bc12131330171ea0c238c05be156528e5","user":{"login":"appsembler","id":1369373,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjkzNzM=","avatar_url":"https://avatars0.githubusercontent.com/u/1369373?v=4","gravatar_id":"","url":"https://api.github.com/users/appsembler","html_url":"https://github.com/appsembler","followers_url":"https://api.github.com/users/appsembler/followers","following_url":"https://api.github.com/users/appsembler/following{/other_user}","gists_url":"https://api.github.com/users/appsembler/gists{/gist_id}","starred_url":"https://api.github.com/users/appsembler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appsembler/subscriptions","organizations_url":"https://api.github.com/users/appsembler/orgs","repos_url":"https://api.github.com/users/appsembler/repos","events_url":"https://api.github.com/users/appsembler/events{/privacy}","received_events_url":"https://api.github.com/users/appsembler/received_events","type":"Organization","site_admin":false},"repo":{"id":24888634,"node_id":"MDEwOlJlcG9zaXRvcnkyNDg4ODYzNA==","name":"edx-platform","full_name":"appsembler/edx-platform","private":false,"owner":{"login":"appsembler","id":1369373,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjkzNzM=","avatar_url":"https://avatars0.githubusercontent.com/u/1369373?v=4","gravatar_id":"","url":"https://api.github.com/users/appsembler","html_url":"https://github.com/appsembler","followers_url":"https://api.github.com/users/appsembler/followers","following_url":"https://api.github.com/users/appsembler/following{/other_user}","gists_url":"https://api.github.com/users/appsembler/gists{/gist_id}","starred_url":"https://api.github.com/users/appsembler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appsembler/subscriptions","organizations_url":"https://api.github.com/users/appsembler/orgs","repos_url":"https://api.github.com/users/appsembler/repos","events_url":"https://api.github.com/users/appsembler/events{/privacy}","received_events_url":"https://api.github.com/users/appsembler/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/appsembler/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":true,"url":"https://api.github.com/repos/appsembler/edx-platform","forks_url":"https://api.github.com/repos/appsembler/edx-platform/forks","keys_url":"https://api.github.com/repos/appsembler/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appsembler/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appsembler/edx-platform/teams","hooks_url":"https://api.github.com/repos/appsembler/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/appsembler/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/appsembler/edx-platform/events","assignees_url":"https://api.github.com/repos/appsembler/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/appsembler/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/appsembler/edx-platform/tags","blobs_url":"https://api.github.com/repos/appsembler/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appsembler/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appsembler/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/appsembler/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appsembler/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/appsembler/edx-platform/languages","stargazers_url":"https://api.github.com/repos/appsembler/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/appsembler/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/appsembler/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/appsembler/edx-platform/subscription","commits_url":"https://api.github.com/repos/appsembler/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/appsembler/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/appsembler/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/appsembler/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/appsembler/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/appsembler/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appsembler/edx-platform/merges","archive_url":"https://api.github.com/repos/appsembler/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appsembler/edx-platform/downloads","issues_url":"https://api.github.com/repos/appsembler/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/appsembler/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/appsembler/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/appsembler/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appsembler/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/appsembler/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/appsembler/edx-platform/deployments","created_at":"2014-10-07T12:09:06Z","updated_at":"2018-09-30T11:41:02Z","pushed_at":"2018-11-27T21:31:00Z","git_url":"git://github.com/appsembler/edx-platform.git","ssh_url":"git@github.com:appsembler/edx-platform.git","clone_url":"https://github.com/appsembler/edx-platform.git","svn_url":"https://github.com/appsembler/edx-platform","homepage":"http://openedx.org/","size":990360,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":18,"open_issues":6,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appsembler/edx-platform/pulls/284"},"html":{"href":"https://github.com/appsembler/edx-platform/pull/284"},"issue":{"href":"https://api.github.com/repos/appsembler/edx-platform/issues/284"},"comments":{"href":"https://api.github.com/repos/appsembler/edx-platform/issues/284/comments"},"review_comments":{"href":"https://api.github.com/repos/appsembler/edx-platform/pulls/284/comments"},"review_comment":{"href":"https://api.github.com/repos/appsembler/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appsembler/edx-platform/pulls/284/commits"},"statuses":{"href":"https://api.github.com/repos/appsembler/edx-platform/statuses/f389326f17f515dc7266cc4f34b8a83b1ba0992a"}},"author_association":"NONE"}}
{"actor":{"display_login":"OmarIthawi"}}