{"action":"created","comment":{"url":"https://api.github.com/repos/andela/ah-orcas/pulls/comments/229203134","pull_request_review_id":169644078,"id":229203134,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTIwMzEzNA==","diff_hunk":"@@ -0,0 +1,31 @@\n+import json\n+\n+from django.test import TestCase\n+from rest_framework.reverse import reverse\n+from rest_framework.test import APIClient\n+\n+\n+class UserTest(TestCase):\n+    \"\"\"\"\"\"\n+\n+    def setUp(self):\n+        self.client = APIClient()\n+        self.namespace = 'authentication'\n+\n+        self.data = {\"user\": {\"email\": \"jake@jake.jake\", \"password\": \"jskfnkjlbfsbjk4\", \"username\": \"jake\"}}\n+        self.data_empty_password = {\"user\": {\"username\": \"testuser1\", \"email\": \"test1@testuser.com\", \"password\": \"\"}}","path":"authors/apps/authentication/tests/test_user.py","position":16,"original_position":16,"commit_id":"61d4ad36535921a82a212890fabc30b352ab5507","original_commit_id":"61d4ad36535921a82a212890fabc30b352ab5507","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"line too long (117 > 79 characters)","created_at":"2018-10-30T07:51:32Z","updated_at":"2018-10-30T07:51:34Z","html_url":"https://github.com/andela/ah-orcas/pull/13#discussion_r229203134","pull_request_url":"https://api.github.com/repos/andela/ah-orcas/pulls/13","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/ah-orcas/pulls/comments/229203134"},"html":{"href":"https://github.com/andela/ah-orcas/pull/13#discussion_r229203134"},"pull_request":{"href":"https://api.github.com/repos/andela/ah-orcas/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/andela/ah-orcas/pulls/13","id":226820792,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2ODIwNzky","html_url":"https://github.com/andela/ah-orcas/pull/13","diff_url":"https://github.com/andela/ah-orcas/pull/13.diff","patch_url":"https://github.com/andela/ah-orcas/pull/13.patch","issue_url":"https://api.github.com/repos/andela/ah-orcas/issues/13","number":13,"state":"open","locked":false,"title":"#161254656 Implement JWT authentication","user":{"login":"wrotich","id":11458891,"node_id":"MDQ6VXNlcjExNDU4ODkx","avatar_url":"https://avatars0.githubusercontent.com/u/11458891?v=4","gravatar_id":"","url":"https://api.github.com/users/wrotich","html_url":"https://github.com/wrotich","followers_url":"https://api.github.com/users/wrotich/followers","following_url":"https://api.github.com/users/wrotich/following{/other_user}","gists_url":"https://api.github.com/users/wrotich/gists{/gist_id}","starred_url":"https://api.github.com/users/wrotich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wrotich/subscriptions","organizations_url":"https://api.github.com/users/wrotich/orgs","repos_url":"https://api.github.com/users/wrotich/repos","events_url":"https://api.github.com/users/wrotich/events{/privacy}","received_events_url":"https://api.github.com/users/wrotich/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nThis PR merges implementation of JWT based authentication feature branch with the develop branch\r\n#### Description of Task to be completed?\r\nImplement JWT authentication token that is sent to users upon registration/login\r\nUsers are able to use the token whenever they make calls to all endpoints\r\n#### How should this be manually tested?\r\nAfter cloning the repo, cd into it and RUN `python3 manage.py runserver`\r\n- Using Postman, test the registration endpoint and check whether the authentication token is returned\r\n#### Any background context you want to provide?\r\n- When a user successfully registers/logs in using their credentials, JWT is generated and saved in local storage. \r\n- Whenever the user wants to access other endpoints, the token is sent in the header of the request. \r\n- The server then checks for a valid JWT in the Authorisation header, and if found, the user will be allowed access.\r\n- This minimises the number of queries made by the server to the database hence more efficiency.\r\n#### What are the relevant pivotal tracker stories?\r\n[#161254656](https://www.pivotaltracker.com/story/show/161254656)\r\n\r\n","created_at":"2018-10-30T07:46:34Z","updated_at":"2018-10-30T07:51:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4df2a1c3fc97d68a4a228e0fb3f65f53c4729e95","assignee":null,"assignees":[],"requested_reviewers":[{"login":"abadojack","id":8406752,"node_id":"MDQ6VXNlcjg0MDY3NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/8406752?v=4","gravatar_id":"","url":"https://api.github.com/users/abadojack","html_url":"https://github.com/abadojack","followers_url":"https://api.github.com/users/abadojack/followers","following_url":"https://api.github.com/users/abadojack/following{/other_user}","gists_url":"https://api.github.com/users/abadojack/gists{/gist_id}","starred_url":"https://api.github.com/users/abadojack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadojack/subscriptions","organizations_url":"https://api.github.com/users/abadojack/orgs","repos_url":"https://api.github.com/users/abadojack/repos","events_url":"https://api.github.com/users/abadojack/events{/privacy}","received_events_url":"https://api.github.com/users/abadojack/received_events","type":"User","site_admin":false},{"login":"code-sleuth","id":21032089,"node_id":"MDQ6VXNlcjIxMDMyMDg5","avatar_url":"https://avatars3.githubusercontent.com/u/21032089?v=4","gravatar_id":"","url":"https://api.github.com/users/code-sleuth","html_url":"https://github.com/code-sleuth","followers_url":"https://api.github.com/users/code-sleuth/followers","following_url":"https://api.github.com/users/code-sleuth/following{/other_user}","gists_url":"https://api.github.com/users/code-sleuth/gists{/gist_id}","starred_url":"https://api.github.com/users/code-sleuth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-sleuth/subscriptions","organizations_url":"https://api.github.com/users/code-sleuth/orgs","repos_url":"https://api.github.com/users/code-sleuth/repos","events_url":"https://api.github.com/users/code-sleuth/events{/privacy}","received_events_url":"https://api.github.com/users/code-sleuth/received_events","type":"User","site_admin":false},{"login":"kipropbrian","id":33654025,"node_id":"MDQ6VXNlcjMzNjU0MDI1","avatar_url":"https://avatars0.githubusercontent.com/u/33654025?v=4","gravatar_id":"","url":"https://api.github.com/users/kipropbrian","html_url":"https://github.com/kipropbrian","followers_url":"https://api.github.com/users/kipropbrian/followers","following_url":"https://api.github.com/users/kipropbrian/following{/other_user}","gists_url":"https://api.github.com/users/kipropbrian/gists{/gist_id}","starred_url":"https://api.github.com/users/kipropbrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kipropbrian/subscriptions","organizations_url":"https://api.github.com/users/kipropbrian/orgs","repos_url":"https://api.github.com/users/kipropbrian/repos","events_url":"https://api.github.com/users/kipropbrian/events{/privacy}","received_events_url":"https://api.github.com/users/kipropbrian/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1103137653,"node_id":"MDU6TGFiZWwxMTAzMTM3NjUz","url":"https://api.github.com/repos/andela/ah-orcas/labels/Finished","name":"Finished","color":"82db59","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/andela/ah-orcas/pulls/13/commits","review_comments_url":"https://api.github.com/repos/andela/ah-orcas/pulls/13/comments","review_comment_url":"https://api.github.com/repos/andela/ah-orcas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/ah-orcas/issues/13/comments","statuses_url":"https://api.github.com/repos/andela/ah-orcas/statuses/61d4ad36535921a82a212890fabc30b352ab5507","head":{"label":"andela:ft-jwt-registration-161254656","ref":"ft-jwt-registration-161254656","sha":"61d4ad36535921a82a212890fabc30b352ab5507","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":153309142,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMzMDkxNDI=","name":"ah-orcas","full_name":"andela/ah-orcas","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/ah-orcas","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-orcas","forks_url":"https://api.github.com/repos/andela/ah-orcas/forks","keys_url":"https://api.github.com/repos/andela/ah-orcas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-orcas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-orcas/teams","hooks_url":"https://api.github.com/repos/andela/ah-orcas/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-orcas/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-orcas/events","assignees_url":"https://api.github.com/repos/andela/ah-orcas/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-orcas/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-orcas/tags","blobs_url":"https://api.github.com/repos/andela/ah-orcas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-orcas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-orcas/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-orcas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-orcas/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-orcas/languages","stargazers_url":"https://api.github.com/repos/andela/ah-orcas/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-orcas/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-orcas/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-orcas/subscription","commits_url":"https://api.github.com/repos/andela/ah-orcas/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-orcas/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-orcas/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-orcas/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-orcas/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-orcas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-orcas/merges","archive_url":"https://api.github.com/repos/andela/ah-orcas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-orcas/downloads","issues_url":"https://api.github.com/repos/andela/ah-orcas/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-orcas/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-orcas/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-orcas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-orcas/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-orcas/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-orcas/deployments","created_at":"2018-10-16T15:27:42Z","updated_at":"2018-10-26T09:44:19Z","pushed_at":"2018-10-30T07:51:22Z","git_url":"git://github.com/andela/ah-orcas.git","ssh_url":"git@github.com:andela/ah-orcas.git","clone_url":"https://github.com/andela/ah-orcas.git","svn_url":"https://github.com/andela/ah-orcas","homepage":null,"size":35,"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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"e66c41042f69bfe1794f71c366f69f17e45f98eb","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":153309142,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMzMDkxNDI=","name":"ah-orcas","full_name":"andela/ah-orcas","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/ah-orcas","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-orcas","forks_url":"https://api.github.com/repos/andela/ah-orcas/forks","keys_url":"https://api.github.com/repos/andela/ah-orcas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-orcas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-orcas/teams","hooks_url":"https://api.github.com/repos/andela/ah-orcas/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-orcas/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-orcas/events","assignees_url":"https://api.github.com/repos/andela/ah-orcas/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-orcas/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-orcas/tags","blobs_url":"https://api.github.com/repos/andela/ah-orcas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-orcas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-orcas/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-orcas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-orcas/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-orcas/languages","stargazers_url":"https://api.github.com/repos/andela/ah-orcas/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-orcas/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-orcas/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-orcas/subscription","commits_url":"https://api.github.com/repos/andela/ah-orcas/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-orcas/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-orcas/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-orcas/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-orcas/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-orcas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-orcas/merges","archive_url":"https://api.github.com/repos/andela/ah-orcas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-orcas/downloads","issues_url":"https://api.github.com/repos/andela/ah-orcas/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-orcas/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-orcas/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-orcas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-orcas/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-orcas/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-orcas/deployments","created_at":"2018-10-16T15:27:42Z","updated_at":"2018-10-26T09:44:19Z","pushed_at":"2018-10-30T07:51:22Z","git_url":"git://github.com/andela/ah-orcas.git","ssh_url":"git@github.com:andela/ah-orcas.git","clone_url":"https://github.com/andela/ah-orcas.git","svn_url":"https://github.com/andela/ah-orcas","homepage":null,"size":35,"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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/ah-orcas/pulls/13"},"html":{"href":"https://github.com/andela/ah-orcas/pull/13"},"issue":{"href":"https://api.github.com/repos/andela/ah-orcas/issues/13"},"comments":{"href":"https://api.github.com/repos/andela/ah-orcas/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/ah-orcas/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/ah-orcas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/ah-orcas/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/andela/ah-orcas/statuses/61d4ad36535921a82a212890fabc30b352ab5507"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}