{"action":"created","issue":{"url":"https://api.github.com/repos/bitly/google_auth_proxy/issues/88","labels_url":"https://api.github.com/repos/bitly/google_auth_proxy/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/bitly/google_auth_proxy/issues/88/comments","events_url":"https://api.github.com/repos/bitly/google_auth_proxy/issues/88/events","html_url":"https://github.com/bitly/google_auth_proxy/pull/88","id":74450299,"number":88,"title":"Auto refresh auth token","user":{"login":"mbland","id":301547,"avatar_url":"https://avatars.githubusercontent.com/u/301547?v=3","gravatar_id":"","url":"https://api.github.com/users/mbland","html_url":"https://github.com/mbland","followers_url":"https://api.github.com/users/mbland/followers","following_url":"https://api.github.com/users/mbland/following{/other_user}","gists_url":"https://api.github.com/users/mbland/gists{/gist_id}","starred_url":"https://api.github.com/users/mbland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbland/subscriptions","organizations_url":"https://api.github.com/users/mbland/orgs","repos_url":"https://api.github.com/users/mbland/repos","events_url":"https://api.github.com/users/mbland/events{/privacy}","received_events_url":"https://api.github.com/users/mbland/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bitly/google_auth_proxy/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-08T18:21:53Z","updated_at":"2015-05-09T22:00:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bitly/google_auth_proxy/pulls/88","html_url":"https://github.com/bitly/google_auth_proxy/pull/88","diff_url":"https://github.com/bitly/google_auth_proxy/pull/88.diff","patch_url":"https://github.com/bitly/google_auth_proxy/pull/88.patch"},"body":"Hi @jehiah, at the prompting of a non-technical colleague at work (@lsgitter) and after being inspired by an idea from @adelevie, I've taken a stab at a new `cookie-refresh` flag. The idea is that the cookie's expiration date would automatically get updated whenever the user accesses an authenticated page within some window of time before it expires.\r\n\r\nAs you'll see, the first three commits are all refactorings; the one after that adds a test for the existing behavior; and the final commit is where the `cookie-refresh` feature is added.\r\n\r\nGood idea? Bad idea? "},"comment":{"url":"https://api.github.com/repos/bitly/google_auth_proxy/issues/comments/100552598","html_url":"https://github.com/bitly/google_auth_proxy/pull/88#issuecomment-100552598","issue_url":"https://api.github.com/repos/bitly/google_auth_proxy/issues/88","id":100552598,"user":{"login":"mbland","id":301547,"avatar_url":"https://avatars.githubusercontent.com/u/301547?v=3","gravatar_id":"","url":"https://api.github.com/users/mbland","html_url":"https://github.com/mbland","followers_url":"https://api.github.com/users/mbland/followers","following_url":"https://api.github.com/users/mbland/following{/other_user}","gists_url":"https://api.github.com/users/mbland/gists{/gist_id}","starred_url":"https://api.github.com/users/mbland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbland/subscriptions","organizations_url":"https://api.github.com/users/mbland/orgs","repos_url":"https://api.github.com/users/mbland/repos","events_url":"https://api.github.com/users/mbland/events{/privacy}","received_events_url":"https://api.github.com/users/mbland/received_events","type":"User","site_admin":false},"created_at":"2015-05-09T22:00:38Z","updated_at":"2015-05-09T22:00:38Z","body":"@jehiah Think I've got it together now. Using `cookie-refresh` now implies that the access token is stored in the cookie (requiring an AES-compatible `cookie-secret`), and the token and the email address are both validated when the refresh threshold is crossed. The default for `cookie-refresh` is now zero, to avoid surprising anyone who upgrades.\r\n\r\nI've successfully tried these changes out on our own running instance, and verified that the cookie was getting auto-refreshed successfully (using our MyUSA backend).\r\n\r\nAlso, I know you like to squash commits, but in this case, I think having at least most of them separate helps with seeing how the different pieces involved fit together. Ultimately up to you, though, of course."}}