{"action":"created","comment":{"url":"https://api.github.com/repos/octanner/ios-network-stack/pulls/comments/53027806","id":53027806,"diff_hunk":"@@ -28,46 +35,58 @@ public struct OAuth2Token: JSONObjectConvertible {\n     \n     private let accessTokenKey = \"access_token\"\n     private let expiresAtKey = \"expires_at\"\n+    private let expiresInKey = \"expires_in\"\n     private let refreshTokenKey = \"refresh_token\"\n     \n     \n     // MARK: - Initializers\n     \n-    public init(accessToken: String, expiresAt: NSDate? = nil, refreshToken: String? = nil) {\n+    init(accessToken: String, expiresAt: NSDate? = nil, refreshToken: String? = nil) {\n         self.accessToken = accessToken\n-        self.expiresAt = expiresAt\n+        self.expiresAt = expiresAt ?? NSDate.distantFuture()\n         self.refreshToken = refreshToken\n     }\n     \n-    public init(json: JSONObject) throws {\n+    init(json: JSONObject) throws {\n         self.accessToken = try json <| accessTokenKey\n-        self.expiresAt = try json <| expiresAtKey\n+        let expiresIn: NSTimeInterval = try json <| expiresInKey","path":"NetworkStack/OAuth2Token.swift","position":47,"original_position":47,"commit_id":"275cc6785e97feddbd6a65b25eed2189f48d9374","original_commit_id":"275cc6785e97feddbd6a65b25eed2189f48d9374","user":{"login":"benjaminsnorris","id":3652919,"avatar_url":"https://avatars.githubusercontent.com/u/3652919?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminsnorris","html_url":"https://github.com/benjaminsnorris","followers_url":"https://api.github.com/users/benjaminsnorris/followers","following_url":"https://api.github.com/users/benjaminsnorris/following{/other_user}","gists_url":"https://api.github.com/users/benjaminsnorris/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminsnorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminsnorris/subscriptions","organizations_url":"https://api.github.com/users/benjaminsnorris/orgs","repos_url":"https://api.github.com/users/benjaminsnorris/repos","events_url":"https://api.github.com/users/benjaminsnorris/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminsnorris/received_events","type":"User","site_admin":false},"body":"What will happen here if there is no `expires_in` key in the json payload?","created_at":"2016-02-16T15:43:33Z","updated_at":"2016-02-16T15:43:33Z","html_url":"https://github.com/octanner/ios-network-stack/pull/1#discussion_r53027806","pull_request_url":"https://api.github.com/repos/octanner/ios-network-stack/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/octanner/ios-network-stack/pulls/comments/53027806"},"html":{"href":"https://github.com/octanner/ios-network-stack/pull/1#discussion_r53027806"},"pull_request":{"href":"https://api.github.com/repos/octanner/ios-network-stack/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/octanner/ios-network-stack/pulls/1","id":59497863,"html_url":"https://github.com/octanner/ios-network-stack/pull/1","diff_url":"https://github.com/octanner/ios-network-stack/pull/1.diff","patch_url":"https://github.com/octanner/ios-network-stack/pull/1.patch","issue_url":"https://api.github.com/repos/octanner/ios-network-stack/issues/1","number":1,"state":"open","locked":false,"title":"Hide token inside stack, and change app state entirely","user":{"login":"timshadel","id":2394,"avatar_url":"https://avatars.githubusercontent.com/u/2394?v=3","gravatar_id":"","url":"https://api.github.com/users/timshadel","html_url":"https://github.com/timshadel","followers_url":"https://api.github.com/users/timshadel/followers","following_url":"https://api.github.com/users/timshadel/following{/other_user}","gists_url":"https://api.github.com/users/timshadel/gists{/gist_id}","starred_url":"https://api.github.com/users/timshadel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timshadel/subscriptions","organizations_url":"https://api.github.com/users/timshadel/orgs","repos_url":"https://api.github.com/users/timshadel/repos","events_url":"https://api.github.com/users/timshadel/events{/privacy}","received_events_url":"https://api.github.com/users/timshadel/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-16T14:29:33Z","updated_at":"2016-02-16T15:43:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c500c6275b5cae3c14fcd1398c0f1e46bf1a914","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/octanner/ios-network-stack/pulls/1/commits","review_comments_url":"https://api.github.com/repos/octanner/ios-network-stack/pulls/1/comments","review_comment_url":"https://api.github.com/repos/octanner/ios-network-stack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/octanner/ios-network-stack/issues/1/comments","statuses_url":"https://api.github.com/repos/octanner/ios-network-stack/statuses/275cc6785e97feddbd6a65b25eed2189f48d9374","head":{"label":"octanner:timsUpdates","ref":"timsUpdates","sha":"275cc6785e97feddbd6a65b25eed2189f48d9374","user":{"login":"octanner","id":2523170,"avatar_url":"https://avatars.githubusercontent.com/u/2523170?v=3","gravatar_id":"","url":"https://api.github.com/users/octanner","html_url":"https://github.com/octanner","followers_url":"https://api.github.com/users/octanner/followers","following_url":"https://api.github.com/users/octanner/following{/other_user}","gists_url":"https://api.github.com/users/octanner/gists{/gist_id}","starred_url":"https://api.github.com/users/octanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octanner/subscriptions","organizations_url":"https://api.github.com/users/octanner/orgs","repos_url":"https://api.github.com/users/octanner/repos","events_url":"https://api.github.com/users/octanner/events{/privacy}","received_events_url":"https://api.github.com/users/octanner/received_events","type":"Organization","site_admin":false},"repo":{"id":51537483,"name":"ios-network-stack","full_name":"octanner/ios-network-stack","owner":{"login":"octanner","id":2523170,"avatar_url":"https://avatars.githubusercontent.com/u/2523170?v=3","gravatar_id":"","url":"https://api.github.com/users/octanner","html_url":"https://github.com/octanner","followers_url":"https://api.github.com/users/octanner/followers","following_url":"https://api.github.com/users/octanner/following{/other_user}","gists_url":"https://api.github.com/users/octanner/gists{/gist_id}","starred_url":"https://api.github.com/users/octanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octanner/subscriptions","organizations_url":"https://api.github.com/users/octanner/orgs","repos_url":"https://api.github.com/users/octanner/repos","events_url":"https://api.github.com/users/octanner/events{/privacy}","received_events_url":"https://api.github.com/users/octanner/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/octanner/ios-network-stack","description":"The base network stack for OC Tanner iOS apps","fork":false,"url":"https://api.github.com/repos/octanner/ios-network-stack","forks_url":"https://api.github.com/repos/octanner/ios-network-stack/forks","keys_url":"https://api.github.com/repos/octanner/ios-network-stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octanner/ios-network-stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octanner/ios-network-stack/teams","hooks_url":"https://api.github.com/repos/octanner/ios-network-stack/hooks","issue_events_url":"https://api.github.com/repos/octanner/ios-network-stack/issues/events{/number}","events_url":"https://api.github.com/repos/octanner/ios-network-stack/events","assignees_url":"https://api.github.com/repos/octanner/ios-network-stack/assignees{/user}","branches_url":"https://api.github.com/repos/octanner/ios-network-stack/branches{/branch}","tags_url":"https://api.github.com/repos/octanner/ios-network-stack/tags","blobs_url":"https://api.github.com/repos/octanner/ios-network-stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octanner/ios-network-stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octanner/ios-network-stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/octanner/ios-network-stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octanner/ios-network-stack/statuses/{sha}","languages_url":"https://api.github.com/repos/octanner/ios-network-stack/languages","stargazers_url":"https://api.github.com/repos/octanner/ios-network-stack/stargazers","contributors_url":"https://api.github.com/repos/octanner/ios-network-stack/contributors","subscribers_url":"https://api.github.com/repos/octanner/ios-network-stack/subscribers","subscription_url":"https://api.github.com/repos/octanner/ios-network-stack/subscription","commits_url":"https://api.github.com/repos/octanner/ios-network-stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/octanner/ios-network-stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/octanner/ios-network-stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/octanner/ios-network-stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/octanner/ios-network-stack/contents/{+path}","compare_url":"https://api.github.com/repos/octanner/ios-network-stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octanner/ios-network-stack/merges","archive_url":"https://api.github.com/repos/octanner/ios-network-stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octanner/ios-network-stack/downloads","issues_url":"https://api.github.com/repos/octanner/ios-network-stack/issues{/number}","pulls_url":"https://api.github.com/repos/octanner/ios-network-stack/pulls{/number}","milestones_url":"https://api.github.com/repos/octanner/ios-network-stack/milestones{/number}","notifications_url":"https://api.github.com/repos/octanner/ios-network-stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octanner/ios-network-stack/labels{/name}","releases_url":"https://api.github.com/repos/octanner/ios-network-stack/releases{/id}","deployments_url":"https://api.github.com/repos/octanner/ios-network-stack/deployments","created_at":"2016-02-11T18:45:39Z","updated_at":"2016-02-11T19:03:39Z","pushed_at":"2016-02-16T14:29:34Z","git_url":"git://github.com/octanner/ios-network-stack.git","ssh_url":"git@github.com:octanner/ios-network-stack.git","clone_url":"https://github.com/octanner/ios-network-stack.git","svn_url":"https://github.com/octanner/ios-network-stack","homepage":null,"size":35,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"octanner:master","ref":"master","sha":"204f852fd80fb93e85f6e60d8d9b66f3923144b2","user":{"login":"octanner","id":2523170,"avatar_url":"https://avatars.githubusercontent.com/u/2523170?v=3","gravatar_id":"","url":"https://api.github.com/users/octanner","html_url":"https://github.com/octanner","followers_url":"https://api.github.com/users/octanner/followers","following_url":"https://api.github.com/users/octanner/following{/other_user}","gists_url":"https://api.github.com/users/octanner/gists{/gist_id}","starred_url":"https://api.github.com/users/octanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octanner/subscriptions","organizations_url":"https://api.github.com/users/octanner/orgs","repos_url":"https://api.github.com/users/octanner/repos","events_url":"https://api.github.com/users/octanner/events{/privacy}","received_events_url":"https://api.github.com/users/octanner/received_events","type":"Organization","site_admin":false},"repo":{"id":51537483,"name":"ios-network-stack","full_name":"octanner/ios-network-stack","owner":{"login":"octanner","id":2523170,"avatar_url":"https://avatars.githubusercontent.com/u/2523170?v=3","gravatar_id":"","url":"https://api.github.com/users/octanner","html_url":"https://github.com/octanner","followers_url":"https://api.github.com/users/octanner/followers","following_url":"https://api.github.com/users/octanner/following{/other_user}","gists_url":"https://api.github.com/users/octanner/gists{/gist_id}","starred_url":"https://api.github.com/users/octanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octanner/subscriptions","organizations_url":"https://api.github.com/users/octanner/orgs","repos_url":"https://api.github.com/users/octanner/repos","events_url":"https://api.github.com/users/octanner/events{/privacy}","received_events_url":"https://api.github.com/users/octanner/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/octanner/ios-network-stack","description":"The base network stack for OC Tanner iOS apps","fork":false,"url":"https://api.github.com/repos/octanner/ios-network-stack","forks_url":"https://api.github.com/repos/octanner/ios-network-stack/forks","keys_url":"https://api.github.com/repos/octanner/ios-network-stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octanner/ios-network-stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octanner/ios-network-stack/teams","hooks_url":"https://api.github.com/repos/octanner/ios-network-stack/hooks","issue_events_url":"https://api.github.com/repos/octanner/ios-network-stack/issues/events{/number}","events_url":"https://api.github.com/repos/octanner/ios-network-stack/events","assignees_url":"https://api.github.com/repos/octanner/ios-network-stack/assignees{/user}","branches_url":"https://api.github.com/repos/octanner/ios-network-stack/branches{/branch}","tags_url":"https://api.github.com/repos/octanner/ios-network-stack/tags","blobs_url":"https://api.github.com/repos/octanner/ios-network-stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octanner/ios-network-stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octanner/ios-network-stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/octanner/ios-network-stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octanner/ios-network-stack/statuses/{sha}","languages_url":"https://api.github.com/repos/octanner/ios-network-stack/languages","stargazers_url":"https://api.github.com/repos/octanner/ios-network-stack/stargazers","contributors_url":"https://api.github.com/repos/octanner/ios-network-stack/contributors","subscribers_url":"https://api.github.com/repos/octanner/ios-network-stack/subscribers","subscription_url":"https://api.github.com/repos/octanner/ios-network-stack/subscription","commits_url":"https://api.github.com/repos/octanner/ios-network-stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/octanner/ios-network-stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/octanner/ios-network-stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/octanner/ios-network-stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/octanner/ios-network-stack/contents/{+path}","compare_url":"https://api.github.com/repos/octanner/ios-network-stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octanner/ios-network-stack/merges","archive_url":"https://api.github.com/repos/octanner/ios-network-stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octanner/ios-network-stack/downloads","issues_url":"https://api.github.com/repos/octanner/ios-network-stack/issues{/number}","pulls_url":"https://api.github.com/repos/octanner/ios-network-stack/pulls{/number}","milestones_url":"https://api.github.com/repos/octanner/ios-network-stack/milestones{/number}","notifications_url":"https://api.github.com/repos/octanner/ios-network-stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octanner/ios-network-stack/labels{/name}","releases_url":"https://api.github.com/repos/octanner/ios-network-stack/releases{/id}","deployments_url":"https://api.github.com/repos/octanner/ios-network-stack/deployments","created_at":"2016-02-11T18:45:39Z","updated_at":"2016-02-11T19:03:39Z","pushed_at":"2016-02-16T14:29:34Z","git_url":"git://github.com/octanner/ios-network-stack.git","ssh_url":"git@github.com:octanner/ios-network-stack.git","clone_url":"https://github.com/octanner/ios-network-stack.git","svn_url":"https://github.com/octanner/ios-network-stack","homepage":null,"size":35,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/octanner/ios-network-stack/pulls/1"},"html":{"href":"https://github.com/octanner/ios-network-stack/pull/1"},"issue":{"href":"https://api.github.com/repos/octanner/ios-network-stack/issues/1"},"comments":{"href":"https://api.github.com/repos/octanner/ios-network-stack/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/octanner/ios-network-stack/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/octanner/ios-network-stack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/octanner/ios-network-stack/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/octanner/ios-network-stack/statuses/275cc6785e97feddbd6a65b25eed2189f48d9374"}}}}