{"action":"created","comment":{"url":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/comments/30091182","id":30091182,"diff_hunk":"@@ -54,12 +54,14 @@ def basic_launch\n         return\n       end\n \n-      user = @account.users.where(username: tp.user_id).first ||\n+      user_id = tp.get_custom_param('masquerading_user_id') || tp.user_id\n+      is_masquerading = user_id == tp.get_custom_param('masquerading_user_id')\n+      user = @account.users.where(username: user_id).first ||\n           @account.users.create(\n-              lti_user_id: tp.user_id,\n-              name: tp.lis_person_name_full,\n-              username: tp.user_id,\n-              email: tp.lis_person_contact_email_primary,\n+              lti_user_id: user_id,\n+              name: is_masquerading ? 'masqueraded session' : tp.lis_person_name_full,\n+              username: user_id,\n+              email: is_masquerading ? 'masqueraded session' : tp.lis_person_contact_email_primary,\n           )","path":"app/controllers/skydrive/launch_controller.rb","position":17,"original_position":17,"commit_id":"667857c33e58e1121a3c67dc38f24a10d8b44d85","original_commit_id":"667857c33e58e1121a3c67dc38f24a10d8b44d85","user":{"login":"wbhumphrey","id":1652188,"avatar_url":"https://avatars.githubusercontent.com/u/1652188?v=3","gravatar_id":"","url":"https://api.github.com/users/wbhumphrey","html_url":"https://github.com/wbhumphrey","followers_url":"https://api.github.com/users/wbhumphrey/followers","following_url":"https://api.github.com/users/wbhumphrey/following{/other_user}","gists_url":"https://api.github.com/users/wbhumphrey/gists{/gist_id}","starred_url":"https://api.github.com/users/wbhumphrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbhumphrey/subscriptions","organizations_url":"https://api.github.com/users/wbhumphrey/orgs","repos_url":"https://api.github.com/users/wbhumphrey/repos","events_url":"https://api.github.com/users/wbhumphrey/events{/privacy}","received_events_url":"https://api.github.com/users/wbhumphrey/received_events","type":"User","site_admin":false},"body":"I think we should update name and email for non masquerading sessions.","created_at":"2015-05-11T23:01:32Z","updated_at":"2015-05-11T23:01:32Z","html_url":"https://github.com/instructure/lti_skydrive_engine/pull/10#discussion_r30091182","pull_request_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/comments/30091182"},"html":{"href":"https://github.com/instructure/lti_skydrive_engine/pull/10#discussion_r30091182"},"pull_request":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/10","id":35165606,"html_url":"https://github.com/instructure/lti_skydrive_engine/pull/10","diff_url":"https://github.com/instructure/lti_skydrive_engine/pull/10.diff","patch_url":"https://github.com/instructure/lti_skydrive_engine/pull/10.patch","issue_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/issues/10","number":10,"state":"open","locked":false,"title":"No more deprecated tests, more API Tests","user":{"login":"defektive","id":438084,"avatar_url":"https://avatars.githubusercontent.com/u/438084?v=3","gravatar_id":"","url":"https://api.github.com/users/defektive","html_url":"https://github.com/defektive","followers_url":"https://api.github.com/users/defektive/followers","following_url":"https://api.github.com/users/defektive/following{/other_user}","gists_url":"https://api.github.com/users/defektive/gists{/gist_id}","starred_url":"https://api.github.com/users/defektive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/defektive/subscriptions","organizations_url":"https://api.github.com/users/defektive/orgs","repos_url":"https://api.github.com/users/defektive/repos","events_url":"https://api.github.com/users/defektive/events{/privacy}","received_events_url":"https://api.github.com/users/defektive/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-11T20:25:59Z","updated_at":"2015-05-11T23:01:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdc7322695b80f3c84e1d990e75571211c2c973d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/10/commits","review_comments_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/10/comments","review_comment_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/issues/10/comments","statuses_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/statuses/667857c33e58e1121a3c67dc38f24a10d8b44d85","head":{"label":"defektive:dev/specs","ref":"dev/specs","sha":"667857c33e58e1121a3c67dc38f24a10d8b44d85","user":{"login":"defektive","id":438084,"avatar_url":"https://avatars.githubusercontent.com/u/438084?v=3","gravatar_id":"","url":"https://api.github.com/users/defektive","html_url":"https://github.com/defektive","followers_url":"https://api.github.com/users/defektive/followers","following_url":"https://api.github.com/users/defektive/following{/other_user}","gists_url":"https://api.github.com/users/defektive/gists{/gist_id}","starred_url":"https://api.github.com/users/defektive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/defektive/subscriptions","organizations_url":"https://api.github.com/users/defektive/orgs","repos_url":"https://api.github.com/users/defektive/repos","events_url":"https://api.github.com/users/defektive/events{/privacy}","received_events_url":"https://api.github.com/users/defektive/received_events","type":"User","site_admin":false},"repo":{"id":34539006,"name":"lti_skydrive_engine","full_name":"defektive/lti_skydrive_engine","owner":{"login":"defektive","id":438084,"avatar_url":"https://avatars.githubusercontent.com/u/438084?v=3","gravatar_id":"","url":"https://api.github.com/users/defektive","html_url":"https://github.com/defektive","followers_url":"https://api.github.com/users/defektive/followers","following_url":"https://api.github.com/users/defektive/following{/other_user}","gists_url":"https://api.github.com/users/defektive/gists{/gist_id}","starred_url":"https://api.github.com/users/defektive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/defektive/subscriptions","organizations_url":"https://api.github.com/users/defektive/orgs","repos_url":"https://api.github.com/users/defektive/repos","events_url":"https://api.github.com/users/defektive/events{/privacy}","received_events_url":"https://api.github.com/users/defektive/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/defektive/lti_skydrive_engine","description":"OneDrive Pro LTI Tool","fork":true,"url":"https://api.github.com/repos/defektive/lti_skydrive_engine","forks_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/forks","keys_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/teams","hooks_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/hooks","issue_events_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/issues/events{/number}","events_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/events","assignees_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/assignees{/user}","branches_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/branches{/branch}","tags_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/tags","blobs_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/languages","stargazers_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/stargazers","contributors_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/contributors","subscribers_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/subscribers","subscription_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/subscription","commits_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/contents/{+path}","compare_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/merges","archive_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/downloads","issues_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/issues{/number}","pulls_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/labels{/name}","releases_url":"https://api.github.com/repos/defektive/lti_skydrive_engine/releases{/id}","created_at":"2015-04-24T20:01:27Z","updated_at":"2015-04-27T17:43:05Z","pushed_at":"2015-05-11T22:06:38Z","git_url":"git://github.com/defektive/lti_skydrive_engine.git","ssh_url":"git@github.com:defektive/lti_skydrive_engine.git","clone_url":"https://github.com/defektive/lti_skydrive_engine.git","svn_url":"https://github.com/defektive/lti_skydrive_engine","homepage":"","size":23469,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"instructure:master","ref":"master","sha":"fc29f0c32f0b1b0033e32f46595ef228f855e0ce","user":{"login":"instructure","id":515326,"avatar_url":"https://avatars.githubusercontent.com/u/515326?v=3","gravatar_id":"","url":"https://api.github.com/users/instructure","html_url":"https://github.com/instructure","followers_url":"https://api.github.com/users/instructure/followers","following_url":"https://api.github.com/users/instructure/following{/other_user}","gists_url":"https://api.github.com/users/instructure/gists{/gist_id}","starred_url":"https://api.github.com/users/instructure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instructure/subscriptions","organizations_url":"https://api.github.com/users/instructure/orgs","repos_url":"https://api.github.com/users/instructure/repos","events_url":"https://api.github.com/users/instructure/events{/privacy}","received_events_url":"https://api.github.com/users/instructure/received_events","type":"Organization","site_admin":false},"repo":{"id":15711386,"name":"lti_skydrive_engine","full_name":"instructure/lti_skydrive_engine","owner":{"login":"instructure","id":515326,"avatar_url":"https://avatars.githubusercontent.com/u/515326?v=3","gravatar_id":"","url":"https://api.github.com/users/instructure","html_url":"https://github.com/instructure","followers_url":"https://api.github.com/users/instructure/followers","following_url":"https://api.github.com/users/instructure/following{/other_user}","gists_url":"https://api.github.com/users/instructure/gists{/gist_id}","starred_url":"https://api.github.com/users/instructure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instructure/subscriptions","organizations_url":"https://api.github.com/users/instructure/orgs","repos_url":"https://api.github.com/users/instructure/repos","events_url":"https://api.github.com/users/instructure/events{/privacy}","received_events_url":"https://api.github.com/users/instructure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/instructure/lti_skydrive_engine","description":"OneDrive Pro LTI Tool","fork":false,"url":"https://api.github.com/repos/instructure/lti_skydrive_engine","forks_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/forks","keys_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/teams","hooks_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/hooks","issue_events_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/issues/events{/number}","events_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/events","assignees_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/assignees{/user}","branches_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/branches{/branch}","tags_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/tags","blobs_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/languages","stargazers_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/stargazers","contributors_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/contributors","subscribers_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/subscribers","subscription_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/subscription","commits_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/contents/{+path}","compare_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/merges","archive_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/downloads","issues_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/issues{/number}","pulls_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/labels{/name}","releases_url":"https://api.github.com/repos/instructure/lti_skydrive_engine/releases{/id}","created_at":"2014-01-07T17:30:23Z","updated_at":"2015-05-04T16:55:14Z","pushed_at":"2015-05-11T22:06:38Z","git_url":"git://github.com/instructure/lti_skydrive_engine.git","ssh_url":"git@github.com:instructure/lti_skydrive_engine.git","clone_url":"https://github.com/instructure/lti_skydrive_engine.git","svn_url":"https://github.com/instructure/lti_skydrive_engine","homepage":"","size":23802,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/10"},"html":{"href":"https://github.com/instructure/lti_skydrive_engine/pull/10"},"issue":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/issues/10"},"comments":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/instructure/lti_skydrive_engine/statuses/667857c33e58e1121a3c67dc38f24a10d8b44d85"}}}}