{"action":"created","comment":{"url":"https://api.github.com/repos/raccoongang/askup/pulls/comments/199743181","pull_request_review_id":133918591,"id":199743181,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTc0MzE4MQ==","diff_hunk":"@@ -0,0 +1,76 @@\n+import logging\n+\n+from django.http import Http404\n+from django.shortcuts import redirect, render\n+from django.urls import reverse\n+from django.views.decorators.csrf import csrf_exempt\n+from lti import InvalidLTIRequestError\n+from lti.contrib.django import DjangoToolProvider\n+from oauthlib import oauth1\n+\n+from askup.models import Qset\n+from .models import LtiProvider, LtiUser\n+from .validator import SignatureValidator\n+\n+log = logging.getLogger(__name__)\n+\n+\n+@csrf_exempt\n+def lti_launch(request, qset_id=None):\n+    \"\"\"\n+    Endpoint for all requests to embed LMS content via the LTI protocol.\n+\n+    An LTI launch is successful if:\n+    - The launch contains all the required parameters\n+    - The launch data is correctly signed using a known client key/secret pair\n+    \"\"\"\n+    try:\n+        tool_provider = DjangoToolProvider.from_django_request(request=request)\n+        validator = SignatureValidator()\n+        ok = tool_provider.is_valid_request(validator)\n+    except (oauth1.OAuth1Error, InvalidLTIRequestError, ValueError) as err:\n+        ok = False\n+        log.error('Error happened while LTI request: {}'.format(err.__str__()))\n+    if not ok:\n+        raise Http404('LTI request is not valid')\n+\n+    anononcement_page = render(\n+        request,\n+        template_name=\"askup_lti/announcement.html\",\n+        context={\n+            'title': 'announcement',\n+            'message': 'coming soon!',\n+            'tip': 'this adaptivity sequence is about to start.',","path":"askup_lti/provider.py","position":43,"original_position":43,"commit_id":"5e51c39cf5c2a6bc5ce6d1b3fd9d6cdb45b00b45","original_commit_id":"5e51c39cf5c2a6bc5ce6d1b3fd9d6cdb45b00b45","user":{"login":"KhaimovMR","id":2059742,"node_id":"MDQ6VXNlcjIwNTk3NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/2059742?v=4","gravatar_id":"","url":"https://api.github.com/users/KhaimovMR","html_url":"https://github.com/KhaimovMR","followers_url":"https://api.github.com/users/KhaimovMR/followers","following_url":"https://api.github.com/users/KhaimovMR/following{/other_user}","gists_url":"https://api.github.com/users/KhaimovMR/gists{/gist_id}","starred_url":"https://api.github.com/users/KhaimovMR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhaimovMR/subscriptions","organizations_url":"https://api.github.com/users/KhaimovMR/orgs","repos_url":"https://api.github.com/users/KhaimovMR/repos","events_url":"https://api.github.com/users/KhaimovMR/events{/privacy}","received_events_url":"https://api.github.com/users/KhaimovMR/received_events","type":"User","site_admin":false},"body":"Yes. It's going to be used everywhere where launch url isn't available. 'tip' text was taken from another project and could be improved. Thanks for pointing out!","created_at":"2018-07-03T09:32:05Z","updated_at":"2018-07-03T09:32:06Z","html_url":"https://github.com/raccoongang/askup/pull/60#discussion_r199743181","pull_request_url":"https://api.github.com/repos/raccoongang/askup/pulls/60","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/raccoongang/askup/pulls/comments/199743181"},"html":{"href":"https://github.com/raccoongang/askup/pull/60#discussion_r199743181"},"pull_request":{"href":"https://api.github.com/repos/raccoongang/askup/pulls/60"}},"in_reply_to_id":199553263},"pull_request":{"url":"https://api.github.com/repos/raccoongang/askup/pulls/60","id":198680327,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4NjgwMzI3","html_url":"https://github.com/raccoongang/askup/pull/60","diff_url":"https://github.com/raccoongang/askup/pull/60.diff","patch_url":"https://github.com/raccoongang/askup/pull/60.patch","issue_url":"https://api.github.com/repos/raccoongang/askup/issues/60","number":60,"state":"closed","locked":false,"title":"Add LTI Provider to the AskUp project (#59)","user":{"login":"KhaimovMR","id":2059742,"node_id":"MDQ6VXNlcjIwNTk3NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/2059742?v=4","gravatar_id":"","url":"https://api.github.com/users/KhaimovMR","html_url":"https://github.com/KhaimovMR","followers_url":"https://api.github.com/users/KhaimovMR/followers","following_url":"https://api.github.com/users/KhaimovMR/following{/other_user}","gists_url":"https://api.github.com/users/KhaimovMR/gists{/gist_id}","starred_url":"https://api.github.com/users/KhaimovMR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhaimovMR/subscriptions","organizations_url":"https://api.github.com/users/KhaimovMR/orgs","repos_url":"https://api.github.com/users/KhaimovMR/repos","events_url":"https://api.github.com/users/KhaimovMR/events{/privacy}","received_events_url":"https://api.github.com/users/KhaimovMR/received_events","type":"User","site_admin":false},"body":"Add simple LTI Provider","created_at":"2018-07-02T13:30:00Z","updated_at":"2018-07-03T09:32:06Z","closed_at":"2018-07-02T16:00:10Z","merged_at":"2018-07-02T16:00:10Z","merge_commit_sha":"cc23c2068135fba4c97b5d13c3172fc7209ad481","assignee":{"login":"KhaimovMR","id":2059742,"node_id":"MDQ6VXNlcjIwNTk3NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/2059742?v=4","gravatar_id":"","url":"https://api.github.com/users/KhaimovMR","html_url":"https://github.com/KhaimovMR","followers_url":"https://api.github.com/users/KhaimovMR/followers","following_url":"https://api.github.com/users/KhaimovMR/following{/other_user}","gists_url":"https://api.github.com/users/KhaimovMR/gists{/gist_id}","starred_url":"https://api.github.com/users/KhaimovMR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhaimovMR/subscriptions","organizations_url":"https://api.github.com/users/KhaimovMR/orgs","repos_url":"https://api.github.com/users/KhaimovMR/repos","events_url":"https://api.github.com/users/KhaimovMR/events{/privacy}","received_events_url":"https://api.github.com/users/KhaimovMR/received_events","type":"User","site_admin":false},"assignees":[{"login":"KhaimovMR","id":2059742,"node_id":"MDQ6VXNlcjIwNTk3NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/2059742?v=4","gravatar_id":"","url":"https://api.github.com/users/KhaimovMR","html_url":"https://github.com/KhaimovMR","followers_url":"https://api.github.com/users/KhaimovMR/followers","following_url":"https://api.github.com/users/KhaimovMR/following{/other_user}","gists_url":"https://api.github.com/users/KhaimovMR/gists{/gist_id}","starred_url":"https://api.github.com/users/KhaimovMR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhaimovMR/subscriptions","organizations_url":"https://api.github.com/users/KhaimovMR/orgs","repos_url":"https://api.github.com/users/KhaimovMR/repos","events_url":"https://api.github.com/users/KhaimovMR/events{/privacy}","received_events_url":"https://api.github.com/users/KhaimovMR/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/raccoongang/askup/pulls/60/commits","review_comments_url":"https://api.github.com/repos/raccoongang/askup/pulls/60/comments","review_comment_url":"https://api.github.com/repos/raccoongang/askup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/raccoongang/askup/issues/60/comments","statuses_url":"https://api.github.com/repos/raccoongang/askup/statuses/5e51c39cf5c2a6bc5ce6d1b3fd9d6cdb45b00b45","head":{"label":"raccoongang:development","ref":"development","sha":"5e51c39cf5c2a6bc5ce6d1b3fd9d6cdb45b00b45","user":{"login":"raccoongang","id":11388447,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMzg4NDQ3","avatar_url":"https://avatars0.githubusercontent.com/u/11388447?v=4","gravatar_id":"","url":"https://api.github.com/users/raccoongang","html_url":"https://github.com/raccoongang","followers_url":"https://api.github.com/users/raccoongang/followers","following_url":"https://api.github.com/users/raccoongang/following{/other_user}","gists_url":"https://api.github.com/users/raccoongang/gists{/gist_id}","starred_url":"https://api.github.com/users/raccoongang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raccoongang/subscriptions","organizations_url":"https://api.github.com/users/raccoongang/orgs","repos_url":"https://api.github.com/users/raccoongang/repos","events_url":"https://api.github.com/users/raccoongang/events{/privacy}","received_events_url":"https://api.github.com/users/raccoongang/received_events","type":"Organization","site_admin":false},"repo":{"id":114992882,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ5OTI4ODI=","name":"askup","full_name":"raccoongang/askup","owner":{"login":"raccoongang","id":11388447,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMzg4NDQ3","avatar_url":"https://avatars0.githubusercontent.com/u/11388447?v=4","gravatar_id":"","url":"https://api.github.com/users/raccoongang","html_url":"https://github.com/raccoongang","followers_url":"https://api.github.com/users/raccoongang/followers","following_url":"https://api.github.com/users/raccoongang/following{/other_user}","gists_url":"https://api.github.com/users/raccoongang/gists{/gist_id}","starred_url":"https://api.github.com/users/raccoongang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raccoongang/subscriptions","organizations_url":"https://api.github.com/users/raccoongang/orgs","repos_url":"https://api.github.com/users/raccoongang/repos","events_url":"https://api.github.com/users/raccoongang/events{/privacy}","received_events_url":"https://api.github.com/users/raccoongang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raccoongang/askup","description":null,"fork":false,"url":"https://api.github.com/repos/raccoongang/askup","forks_url":"https://api.github.com/repos/raccoongang/askup/forks","keys_url":"https://api.github.com/repos/raccoongang/askup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raccoongang/askup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raccoongang/askup/teams","hooks_url":"https://api.github.com/repos/raccoongang/askup/hooks","issue_events_url":"https://api.github.com/repos/raccoongang/askup/issues/events{/number}","events_url":"https://api.github.com/repos/raccoongang/askup/events","assignees_url":"https://api.github.com/repos/raccoongang/askup/assignees{/user}","branches_url":"https://api.github.com/repos/raccoongang/askup/branches{/branch}","tags_url":"https://api.github.com/repos/raccoongang/askup/tags","blobs_url":"https://api.github.com/repos/raccoongang/askup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raccoongang/askup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raccoongang/askup/git/refs{/sha}","trees_url":"https://api.github.com/repos/raccoongang/askup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raccoongang/askup/statuses/{sha}","languages_url":"https://api.github.com/repos/raccoongang/askup/languages","stargazers_url":"https://api.github.com/repos/raccoongang/askup/stargazers","contributors_url":"https://api.github.com/repos/raccoongang/askup/contributors","subscribers_url":"https://api.github.com/repos/raccoongang/askup/subscribers","subscription_url":"https://api.github.com/repos/raccoongang/askup/subscription","commits_url":"https://api.github.com/repos/raccoongang/askup/commits{/sha}","git_commits_url":"https://api.github.com/repos/raccoongang/askup/git/commits{/sha}","comments_url":"https://api.github.com/repos/raccoongang/askup/comments{/number}","issue_comment_url":"https://api.github.com/repos/raccoongang/askup/issues/comments{/number}","contents_url":"https://api.github.com/repos/raccoongang/askup/contents/{+path}","compare_url":"https://api.github.com/repos/raccoongang/askup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raccoongang/askup/merges","archive_url":"https://api.github.com/repos/raccoongang/askup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raccoongang/askup/downloads","issues_url":"https://api.github.com/repos/raccoongang/askup/issues{/number}","pulls_url":"https://api.github.com/repos/raccoongang/askup/pulls{/number}","milestones_url":"https://api.github.com/repos/raccoongang/askup/milestones{/number}","notifications_url":"https://api.github.com/repos/raccoongang/askup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raccoongang/askup/labels{/name}","releases_url":"https://api.github.com/repos/raccoongang/askup/releases{/id}","deployments_url":"https://api.github.com/repos/raccoongang/askup/deployments","created_at":"2017-12-21T10:20:17Z","updated_at":"2018-04-19T10:52:48Z","pushed_at":"2018-07-03T09:22:10Z","git_url":"git://github.com/raccoongang/askup.git","ssh_url":"git@github.com:raccoongang/askup.git","clone_url":"https://github.com/raccoongang/askup.git","svn_url":"https://github.com/raccoongang/askup","homepage":null,"size":1552,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"development"}},"base":{"label":"raccoongang:master","ref":"master","sha":"f875a7ceb832ed86d29d9eaf22cae8b6b4662866","user":{"login":"raccoongang","id":11388447,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMzg4NDQ3","avatar_url":"https://avatars0.githubusercontent.com/u/11388447?v=4","gravatar_id":"","url":"https://api.github.com/users/raccoongang","html_url":"https://github.com/raccoongang","followers_url":"https://api.github.com/users/raccoongang/followers","following_url":"https://api.github.com/users/raccoongang/following{/other_user}","gists_url":"https://api.github.com/users/raccoongang/gists{/gist_id}","starred_url":"https://api.github.com/users/raccoongang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raccoongang/subscriptions","organizations_url":"https://api.github.com/users/raccoongang/orgs","repos_url":"https://api.github.com/users/raccoongang/repos","events_url":"https://api.github.com/users/raccoongang/events{/privacy}","received_events_url":"https://api.github.com/users/raccoongang/received_events","type":"Organization","site_admin":false},"repo":{"id":114992882,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ5OTI4ODI=","name":"askup","full_name":"raccoongang/askup","owner":{"login":"raccoongang","id":11388447,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMzg4NDQ3","avatar_url":"https://avatars0.githubusercontent.com/u/11388447?v=4","gravatar_id":"","url":"https://api.github.com/users/raccoongang","html_url":"https://github.com/raccoongang","followers_url":"https://api.github.com/users/raccoongang/followers","following_url":"https://api.github.com/users/raccoongang/following{/other_user}","gists_url":"https://api.github.com/users/raccoongang/gists{/gist_id}","starred_url":"https://api.github.com/users/raccoongang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raccoongang/subscriptions","organizations_url":"https://api.github.com/users/raccoongang/orgs","repos_url":"https://api.github.com/users/raccoongang/repos","events_url":"https://api.github.com/users/raccoongang/events{/privacy}","received_events_url":"https://api.github.com/users/raccoongang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raccoongang/askup","description":null,"fork":false,"url":"https://api.github.com/repos/raccoongang/askup","forks_url":"https://api.github.com/repos/raccoongang/askup/forks","keys_url":"https://api.github.com/repos/raccoongang/askup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raccoongang/askup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raccoongang/askup/teams","hooks_url":"https://api.github.com/repos/raccoongang/askup/hooks","issue_events_url":"https://api.github.com/repos/raccoongang/askup/issues/events{/number}","events_url":"https://api.github.com/repos/raccoongang/askup/events","assignees_url":"https://api.github.com/repos/raccoongang/askup/assignees{/user}","branches_url":"https://api.github.com/repos/raccoongang/askup/branches{/branch}","tags_url":"https://api.github.com/repos/raccoongang/askup/tags","blobs_url":"https://api.github.com/repos/raccoongang/askup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raccoongang/askup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raccoongang/askup/git/refs{/sha}","trees_url":"https://api.github.com/repos/raccoongang/askup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raccoongang/askup/statuses/{sha}","languages_url":"https://api.github.com/repos/raccoongang/askup/languages","stargazers_url":"https://api.github.com/repos/raccoongang/askup/stargazers","contributors_url":"https://api.github.com/repos/raccoongang/askup/contributors","subscribers_url":"https://api.github.com/repos/raccoongang/askup/subscribers","subscription_url":"https://api.github.com/repos/raccoongang/askup/subscription","commits_url":"https://api.github.com/repos/raccoongang/askup/commits{/sha}","git_commits_url":"https://api.github.com/repos/raccoongang/askup/git/commits{/sha}","comments_url":"https://api.github.com/repos/raccoongang/askup/comments{/number}","issue_comment_url":"https://api.github.com/repos/raccoongang/askup/issues/comments{/number}","contents_url":"https://api.github.com/repos/raccoongang/askup/contents/{+path}","compare_url":"https://api.github.com/repos/raccoongang/askup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raccoongang/askup/merges","archive_url":"https://api.github.com/repos/raccoongang/askup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raccoongang/askup/downloads","issues_url":"https://api.github.com/repos/raccoongang/askup/issues{/number}","pulls_url":"https://api.github.com/repos/raccoongang/askup/pulls{/number}","milestones_url":"https://api.github.com/repos/raccoongang/askup/milestones{/number}","notifications_url":"https://api.github.com/repos/raccoongang/askup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raccoongang/askup/labels{/name}","releases_url":"https://api.github.com/repos/raccoongang/askup/releases{/id}","deployments_url":"https://api.github.com/repos/raccoongang/askup/deployments","created_at":"2017-12-21T10:20:17Z","updated_at":"2018-04-19T10:52:48Z","pushed_at":"2018-07-03T09:22:10Z","git_url":"git://github.com/raccoongang/askup.git","ssh_url":"git@github.com:raccoongang/askup.git","clone_url":"https://github.com/raccoongang/askup.git","svn_url":"https://github.com/raccoongang/askup","homepage":null,"size":1552,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/raccoongang/askup/pulls/60"},"html":{"href":"https://github.com/raccoongang/askup/pull/60"},"issue":{"href":"https://api.github.com/repos/raccoongang/askup/issues/60"},"comments":{"href":"https://api.github.com/repos/raccoongang/askup/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/raccoongang/askup/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/raccoongang/askup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/raccoongang/askup/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/raccoongang/askup/statuses/5e51c39cf5c2a6bc5ce6d1b3fd9d6cdb45b00b45"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"KhaimovMR"}}