{"action":"created","issue":{"url":"https://api.github.com/repos/nickel-org/nickel-auth/issues/1","labels_url":"https://api.github.com/repos/nickel-org/nickel-auth/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/nickel-org/nickel-auth/issues/1/comments","events_url":"https://api.github.com/repos/nickel-org/nickel-auth/issues/1/events","html_url":"https://github.com/nickel-org/nickel-auth/pull/1","id":91507415,"number":1,"title":"feat(auth): Add an auth middleware.","user":{"login":"SimonPersson","id":606973,"avatar_url":"https://avatars.githubusercontent.com/u/606973?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonPersson","html_url":"https://github.com/SimonPersson","followers_url":"https://api.github.com/users/SimonPersson/followers","following_url":"https://api.github.com/users/SimonPersson/following{/other_user}","gists_url":"https://api.github.com/users/SimonPersson/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonPersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonPersson/subscriptions","organizations_url":"https://api.github.com/users/SimonPersson/orgs","repos_url":"https://api.github.com/users/SimonPersson/repos","events_url":"https://api.github.com/users/SimonPersson/events{/privacy}","received_events_url":"https://api.github.com/users/SimonPersson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-06-27T20:02:18Z","updated_at":"2015-07-13T22:57:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nickel-org/nickel-auth/pulls/1","html_url":"https://github.com/nickel-org/nickel-auth/pull/1","diff_url":"https://github.com/nickel-org/nickel-auth/pull/1.diff","patch_url":"https://github.com/nickel-org/nickel-auth/pull/1.patch"},"body":"Related to nickel-org/nickel.rs#98.\r\n\r\nProvides auth middleware with an example page. Depends on nickel-org/nickel.rs#234.\r\n\r\nThere's probably some stuff that needs cleaning up, but I figured we could get the discussion polish it up once we're happy with the design.\r\n\r\nI have written some basic tests with bash and curl for the example page. I hope it's possible to get travis-ci to execute those.\r\n\r\nAs this is a matter of security, it'd be great to get as many eyes as possible on this. Ping @cburgdorf, @Ryman, @lambdaburrito, @rgs1, @ninjabear."},"comment":{"url":"https://api.github.com/repos/nickel-org/nickel-auth/issues/comments/121084373","html_url":"https://github.com/nickel-org/nickel-auth/pull/1#issuecomment-121084373","issue_url":"https://api.github.com/repos/nickel-org/nickel-auth/issues/1","id":121084373,"user":{"login":"SimonPersson","id":606973,"avatar_url":"https://avatars.githubusercontent.com/u/606973?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonPersson","html_url":"https://github.com/SimonPersson","followers_url":"https://api.github.com/users/SimonPersson/followers","following_url":"https://api.github.com/users/SimonPersson/following{/other_user}","gists_url":"https://api.github.com/users/SimonPersson/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonPersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonPersson/subscriptions","organizations_url":"https://api.github.com/users/SimonPersson/orgs","repos_url":"https://api.github.com/users/SimonPersson/repos","events_url":"https://api.github.com/users/SimonPersson/events{/privacy}","received_events_url":"https://api.github.com/users/SimonPersson/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T22:57:15Z","updated_at":"2015-07-13T22:57:15Z","body":">>\r\nWhat I missed was a provided ServerData equivalent with a new() function, it'd be nice if we didn't have to deal with the lower level detail like that in the Auth example. I was going to make one, but we need to have timeout() in SessionStore take self as a parameter so that one can store the Duration in ServerData.\r\n>\r\nI don't fully understand this, can you give more detail? Why do we need to store Duration in ServerData?\r\n\r\nYes, I'd like to be able to do `use nickel::ServerData`, but with a better name of course, and then `nickel::with_data(ServerData::new(\"SecretKey\", Duration::minutes(60)));` or something, so that the user don't have to create that struct. Just for convenience.\r\n\r\nI wonder though, if we can get ServerData to be generic. I suppose we can put a `PhantomData` in it, but I don't know exactly how that works with initialization and so on."}}