{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/chronicle/issues/86","labels_url":"https://api.github.com/repos/mozilla/chronicle/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/chronicle/issues/86/comments","events_url":"https://api.github.com/repos/mozilla/chronicle/issues/86/events","html_url":"https://github.com/mozilla/chronicle/pull/86","id":53823918,"number":86,"title":"Fixup auth","user":{"login":"6a68","id":96396,"avatar_url":"https://avatars.githubusercontent.com/u/96396?v=3","gravatar_id":"","url":"https://api.github.com/users/6a68","html_url":"https://github.com/6a68","followers_url":"https://api.github.com/users/6a68/followers","following_url":"https://api.github.com/users/6a68/following{/other_user}","gists_url":"https://api.github.com/users/6a68/gists{/gist_id}","starred_url":"https://api.github.com/users/6a68/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6a68/subscriptions","organizations_url":"https://api.github.com/users/6a68/orgs","repos_url":"https://api.github.com/users/6a68/repos","events_url":"https://api.github.com/users/6a68/events{/privacy}","received_events_url":"https://api.github.com/users/6a68/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-09T01:31:20Z","updated_at":"2015-01-09T02:21:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/chronicle/pulls/86","html_url":"https://github.com/mozilla/chronicle/pull/86","diff_url":"https://github.com/mozilla/chronicle/pull/86.diff","patch_url":"https://github.com/mozilla/chronicle/pull/86.patch"},"body":"I tried to be a bit more descriptive in the commit messages, as it was a little late to make this stuff a set of atomic commits, but I still wanted to capture some extra detail. I'll just paste those in as a PR description.\r\n\r\nWhen doing local development with the test user, this patch lets you simply surf to /auth/login and a session cookie will be set, skipping the oauth flow completely. All other funky special casing code is gone. Dang, that's nice. (Normally, hitting /auth/login redirects to another endpoint, which redirects to the fxa oauth flow, which eventually ends with a cookie being set, if the oauth stuff worked out successfully.)\r\n\r\nComments welcome!\r\n\r\n-----\r\n\r\n chore(server): fixup auth\r\n\r\nCorrectly use Bell to handle the OAuth nonce. Correctly set and validate\r\ncookies (both that the fxaId exists, and that any TTL hasn't expired).\r\nFixes #45.\r\n\r\nReplace log.trace with log.verbose everywhere, since we never really\r\nwant a trace of the function calls.\r\n\r\nEnable cookie-based sessions for the visits API, and modify the cookie\r\nvalidation function to always allow access if the `testUser` config\r\noption is set. Fixes #76.\r\n\r\nAdd crude placeholder API docs for auth endpoints.\r\n\r\n-----\r\n\r\n chore(api): simplify handling of test user\r\n\r\nWith this patch, we handle the test user by simply setting a cookie as soon as\r\nthe user hits the /auth/login endpoint. This is the only bit of special case\r\ncode that we need; the cookie is otherwise normal, is validated normally, and\r\nnone of the affected routes need any special case code. w00t!\r\n"},"comment":{"url":"https://api.github.com/repos/mozilla/chronicle/issues/comments/69284370","html_url":"https://github.com/mozilla/chronicle/pull/86#issuecomment-69284370","issue_url":"https://api.github.com/repos/mozilla/chronicle/issues/86","id":69284370,"user":{"login":"pdehaan","id":557895,"avatar_url":"https://avatars.githubusercontent.com/u/557895?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehaan","html_url":"https://github.com/pdehaan","followers_url":"https://api.github.com/users/pdehaan/followers","following_url":"https://api.github.com/users/pdehaan/following{/other_user}","gists_url":"https://api.github.com/users/pdehaan/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehaan/subscriptions","organizations_url":"https://api.github.com/users/pdehaan/orgs","repos_url":"https://api.github.com/users/pdehaan/repos","events_url":"https://api.github.com/users/pdehaan/events{/privacy}","received_events_url":"https://api.github.com/users/pdehaan/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T02:21:20Z","updated_at":"2015-01-09T02:21:20Z","body":"/summon resident oauth/hapi expert @seanmonstar.\r\n\r\nSeanmonstar, can you take a look at this PR?"}}