{"action":"created","comment":{"url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/comments/108789990","pull_request_review_id":29846059,"id":108789990,"diff_hunk":"@@ -0,0 +1,191 @@\n+import json\n+\n+from rest_framework import status\n+from rest_framework.response import Response\n+from django.http import Http404\n+from rest_framework.views import APIView\n+from django.http import JsonResponse, HttpResponse\n+\n+from threepio import logger\n+\n+from atmosphere import settings\n+from atmosphere.settings.local import AUTHENTICATION as auth_settings\n+from atmosphere.settings.local import TEST as test_settings\n+\n+\n+class MockKeystoneView(APIView):\n+    \"\"\"\n+    This is just a simple view to catch any url we are not handling\n+    \"\"\"\n+\n+    def get(self, request):\n+        logger.info(\" MockKeystoneView:get called\")\n+        for header in request.META:\n+            logger.info(\"   header: %s   value %s\" % (header, request.META[header]))\n+        return JsonResponse({'text': 'get response'})\n+\n+    def post(self, request):\n+        logger.info(\"MockKeystoneView:post called\")\n+        logger.info(request.body)\n+        return JsonResponse({'text': 'get response'})\n+\n+\n+class MockKeystoneUsersProjects(APIView):\n+    \"\"\"\n+    This is just a simple view to catch any url we are not handling\n+    \"\"\"\n+\n+    def get(self, request, user_id):\n+        logger.info(\" MockKeystoneUserProjects:get called (user id: %s) \" % (user_id))\n+        # for header in request.META:\n+        #    logger.info(\"   header: %s   value %s\" % (header, request.META[header]) )\n+        token = request.META.get('HTTP_X_AUTH_TOKEN')\n+        logger.info(\"  token: %s\" % token)\n+        logger.info(\"         gAAAAABY2WAKlR6yxvn1mvkPcW0i4fB36y68N0mg2u1CUjPg7OJ-alV2CPPg207_zOTm8s3p3hHJWYVCw5Jh3PBYECkdplVgdzH7UgviSftNM8AJboFNXbypNNaELqgSztpGh5TnBbXI5RlzAc4IIBWd8wPL-RZuOA\")\n+        logger.info(\"  user:  %s\" % user_id)\n+        logger.info(\"         6705630a653f4300baf486a8df6072de\")\n+        if token == 'gAAAAABY2WAKlR6yxvn1mvkPcW0i4fB36y68N0mg2u1CUjPg7OJ-alV2CPPg207_zOTm8s3p3hHJWYVCw5Jh3PBYECkdplVgdzH7UgviSftNM8AJboFNXbypNNaELqgSztpGh5TnBbXI5RlzAc4IIBWd8wPL-RZuOA'\\\n+                and user_id == \"6705630a653f4300baf486a8df6072de\":\n+            json_text = '{\"links\": {\"self\": \"http://localhost:8082/api/test/keystone/v3/users/6705630a653f4300baf486a8df6072de/projects\", \"previous\": null, \"next\": null}, \"projects\":'\\\n+                        ' [{\"is_domain\": false, \"description\": \"a test\", \"links\": {\"self\": \"http://localhost:8082/api/test/kestone/v3/projects/190ce9f5a454493e9eaae608d54fe2d1\"},'\\\n+                        ' \"enabled\": true, \"id\": \"190ce9f5a454493e9eaae608d54fe2d1\", \"parent_id\": \"default\", \"domain_id\": \"default\", \"name\": \"MockeyMock\"}]}'\n+            response = HttpResponse(json_text, status=status.HTTP_200_OK, content_type=\"application/json\")\n+            response['x-openstack-request-id'] = \"req-6a536bef-af21-46a9-94e3-31f47998644f\"\n+        elif token == 'gAAAAABY2WAKlR6yxvn1mvkPcW0i4fB36y68N0mg2u1CUjPg7OJ-alV2CPPg207_zOTm8s3p3hHJWYVCw5Jh3PBYECkdplVgdzH7UgviSftNM8AJboFNXbypNNaELqgSztpGh5TnBbXI5RlzAc4IIBWd8wPL-RZuOA':","path":"api/test/views/mock_keystone.py","position":54,"original_position":54,"commit_id":"cb55be1152571b0abec9e2319d095e202f602cc3","original_commit_id":"cb55be1152571b0abec9e2319d095e202f602cc3","user":{"login":"knikolla","id":4123322,"avatar_url":"https://avatars3.githubusercontent.com/u/4123322?v=3","gravatar_id":"","url":"https://api.github.com/users/knikolla","html_url":"https://github.com/knikolla","followers_url":"https://api.github.com/users/knikolla/followers","following_url":"https://api.github.com/users/knikolla/following{/other_user}","gists_url":"https://api.github.com/users/knikolla/gists{/gist_id}","starred_url":"https://api.github.com/users/knikolla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knikolla/subscriptions","organizations_url":"https://api.github.com/users/knikolla/orgs","repos_url":"https://api.github.com/users/knikolla/repos","events_url":"https://api.github.com/users/knikolla/events{/privacy}","received_events_url":"https://api.github.com/users/knikolla/received_events","type":"User","site_admin":false},"body":"@xuhang57 This is not a uuid. But anyway, this is the token we are returning from mock keystone, therefore it IS the token that atmosphere will use for all communications.","created_at":"2017-03-29T21:18:47Z","updated_at":"2017-03-29T21:18:47Z","html_url":"https://github.com/CCI-MOC/GUI-Backend/pull/34#discussion_r108789990","pull_request_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/comments/108789990"},"html":{"href":"https://github.com/CCI-MOC/GUI-Backend/pull/34#discussion_r108789990"},"pull_request":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/34","id":113269599,"html_url":"https://github.com/CCI-MOC/GUI-Backend/pull/34","diff_url":"https://github.com/CCI-MOC/GUI-Backend/pull/34.diff","patch_url":"https://github.com/CCI-MOC/GUI-Backend/pull/34.patch","issue_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues/34","number":34,"state":"open","locked":false,"title":"Moc openstack login","user":{"login":"robbaronbu","id":23174942,"avatar_url":"https://avatars1.githubusercontent.com/u/23174942?v=3","gravatar_id":"","url":"https://api.github.com/users/robbaronbu","html_url":"https://github.com/robbaronbu","followers_url":"https://api.github.com/users/robbaronbu/followers","following_url":"https://api.github.com/users/robbaronbu/following{/other_user}","gists_url":"https://api.github.com/users/robbaronbu/gists{/gist_id}","starred_url":"https://api.github.com/users/robbaronbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbaronbu/subscriptions","organizations_url":"https://api.github.com/users/robbaronbu/orgs","repos_url":"https://api.github.com/users/robbaronbu/repos","events_url":"https://api.github.com/users/robbaronbu/events{/privacy}","received_events_url":"https://api.github.com/users/robbaronbu/received_events","type":"User","site_admin":false},"body":"I have moved the changes for the open stack login here.  The unit tests work on my system, need to adjust travis ci file.","created_at":"2017-03-29T18:57:04Z","updated_at":"2017-03-29T21:18:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97e04be0cd4e63f3dd9d74494253e7b08f17e5a7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/34/commits","review_comments_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/34/comments","review_comment_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues/34/comments","statuses_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/statuses/cb55be1152571b0abec9e2319d095e202f602cc3","head":{"label":"CCI-MOC:MOC_Openstack_Login","ref":"MOC_Openstack_Login","sha":"cb55be1152571b0abec9e2319d095e202f602cc3","user":{"login":"CCI-MOC","id":3578683,"avatar_url":"https://avatars2.githubusercontent.com/u/3578683?v=3","gravatar_id":"","url":"https://api.github.com/users/CCI-MOC","html_url":"https://github.com/CCI-MOC","followers_url":"https://api.github.com/users/CCI-MOC/followers","following_url":"https://api.github.com/users/CCI-MOC/following{/other_user}","gists_url":"https://api.github.com/users/CCI-MOC/gists{/gist_id}","starred_url":"https://api.github.com/users/CCI-MOC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CCI-MOC/subscriptions","organizations_url":"https://api.github.com/users/CCI-MOC/orgs","repos_url":"https://api.github.com/users/CCI-MOC/repos","events_url":"https://api.github.com/users/CCI-MOC/events{/privacy}","received_events_url":"https://api.github.com/users/CCI-MOC/received_events","type":"Organization","site_admin":false},"repo":{"id":78563774,"name":"GUI-Backend","full_name":"CCI-MOC/GUI-Backend","owner":{"login":"CCI-MOC","id":3578683,"avatar_url":"https://avatars2.githubusercontent.com/u/3578683?v=3","gravatar_id":"","url":"https://api.github.com/users/CCI-MOC","html_url":"https://github.com/CCI-MOC","followers_url":"https://api.github.com/users/CCI-MOC/followers","following_url":"https://api.github.com/users/CCI-MOC/following{/other_user}","gists_url":"https://api.github.com/users/CCI-MOC/gists{/gist_id}","starred_url":"https://api.github.com/users/CCI-MOC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CCI-MOC/subscriptions","organizations_url":"https://api.github.com/users/CCI-MOC/orgs","repos_url":"https://api.github.com/users/CCI-MOC/repos","events_url":"https://api.github.com/users/CCI-MOC/events{/privacy}","received_events_url":"https://api.github.com/users/CCI-MOC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CCI-MOC/GUI-Backend","description":"MOC simple GUI built on top of Atmosphere ","fork":false,"url":"https://api.github.com/repos/CCI-MOC/GUI-Backend","forks_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/forks","keys_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/teams","hooks_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/hooks","issue_events_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues/events{/number}","events_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/events","assignees_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/assignees{/user}","branches_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/branches{/branch}","tags_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/tags","blobs_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/statuses/{sha}","languages_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/languages","stargazers_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/stargazers","contributors_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/contributors","subscribers_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/subscribers","subscription_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/subscription","commits_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/contents/{+path}","compare_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/merges","archive_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/downloads","issues_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues{/number}","pulls_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls{/number}","milestones_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/milestones{/number}","notifications_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/labels{/name}","releases_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/releases{/id}","deployments_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/deployments","created_at":"2017-01-10T18:56:17Z","updated_at":"2017-01-12T21:16:26Z","pushed_at":"2017-03-29T20:10:05Z","git_url":"git://github.com/CCI-MOC/GUI-Backend.git","ssh_url":"git@github.com:CCI-MOC/GUI-Backend.git","clone_url":"https://github.com/CCI-MOC/GUI-Backend.git","svn_url":"https://github.com/CCI-MOC/GUI-Backend","homepage":"","size":178493,"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":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":0,"default_branch":"master"}},"base":{"label":"CCI-MOC:master","ref":"master","sha":"71eb5de80fa089ff7f35d681ba407d3ed223b821","user":{"login":"CCI-MOC","id":3578683,"avatar_url":"https://avatars2.githubusercontent.com/u/3578683?v=3","gravatar_id":"","url":"https://api.github.com/users/CCI-MOC","html_url":"https://github.com/CCI-MOC","followers_url":"https://api.github.com/users/CCI-MOC/followers","following_url":"https://api.github.com/users/CCI-MOC/following{/other_user}","gists_url":"https://api.github.com/users/CCI-MOC/gists{/gist_id}","starred_url":"https://api.github.com/users/CCI-MOC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CCI-MOC/subscriptions","organizations_url":"https://api.github.com/users/CCI-MOC/orgs","repos_url":"https://api.github.com/users/CCI-MOC/repos","events_url":"https://api.github.com/users/CCI-MOC/events{/privacy}","received_events_url":"https://api.github.com/users/CCI-MOC/received_events","type":"Organization","site_admin":false},"repo":{"id":78563774,"name":"GUI-Backend","full_name":"CCI-MOC/GUI-Backend","owner":{"login":"CCI-MOC","id":3578683,"avatar_url":"https://avatars2.githubusercontent.com/u/3578683?v=3","gravatar_id":"","url":"https://api.github.com/users/CCI-MOC","html_url":"https://github.com/CCI-MOC","followers_url":"https://api.github.com/users/CCI-MOC/followers","following_url":"https://api.github.com/users/CCI-MOC/following{/other_user}","gists_url":"https://api.github.com/users/CCI-MOC/gists{/gist_id}","starred_url":"https://api.github.com/users/CCI-MOC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CCI-MOC/subscriptions","organizations_url":"https://api.github.com/users/CCI-MOC/orgs","repos_url":"https://api.github.com/users/CCI-MOC/repos","events_url":"https://api.github.com/users/CCI-MOC/events{/privacy}","received_events_url":"https://api.github.com/users/CCI-MOC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CCI-MOC/GUI-Backend","description":"MOC simple GUI built on top of Atmosphere ","fork":false,"url":"https://api.github.com/repos/CCI-MOC/GUI-Backend","forks_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/forks","keys_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/teams","hooks_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/hooks","issue_events_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues/events{/number}","events_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/events","assignees_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/assignees{/user}","branches_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/branches{/branch}","tags_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/tags","blobs_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/statuses/{sha}","languages_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/languages","stargazers_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/stargazers","contributors_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/contributors","subscribers_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/subscribers","subscription_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/subscription","commits_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/contents/{+path}","compare_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/merges","archive_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/downloads","issues_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues{/number}","pulls_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls{/number}","milestones_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/milestones{/number}","notifications_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/labels{/name}","releases_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/releases{/id}","deployments_url":"https://api.github.com/repos/CCI-MOC/GUI-Backend/deployments","created_at":"2017-01-10T18:56:17Z","updated_at":"2017-01-12T21:16:26Z","pushed_at":"2017-03-29T20:10:05Z","git_url":"git://github.com/CCI-MOC/GUI-Backend.git","ssh_url":"git@github.com:CCI-MOC/GUI-Backend.git","clone_url":"https://github.com/CCI-MOC/GUI-Backend.git","svn_url":"https://github.com/CCI-MOC/GUI-Backend","homepage":"","size":178493,"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":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/34"},"html":{"href":"https://github.com/CCI-MOC/GUI-Backend/pull/34"},"issue":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues/34"},"comments":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/CCI-MOC/GUI-Backend/statuses/cb55be1152571b0abec9e2319d095e202f602cc3"}}}}
{"actor":{"display_login":"knikolla"}}