{"action":"created","comment":{"url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/comments/59523513","id":59523513,"diff_hunk":"@@ -464,43 +502,84 @@ function _M.load_jwt(self, jwt_str, secret)\n   return jwt_obj\n end\n \n---@function validate_exp_nbf - validate expiry and not valid before\n---@param jwt_obj\n-local function validate_exp_nbf(jwt_obj, is_validation_loose, leeway)\n-  if jwt_obj[str_const.reason] ~= nil then\n-    return\n-  end\n-\n+--@function validate exp nbf claims - validate expiry and not valid before\n+--@param jwt_obj, leeway, require_nbf_claim, require_exp_claim\n+local function validate_lifetime(jwt_obj, leeway, require_nbf_claim, require_exp_claim)\n   local exp = jwt_obj[str_const.payload][str_const.exp]\n   local nbf = jwt_obj[str_const.payload][str_const.nbf]\n \n+  if (leeway ~= nil and exp == nil and nbf == nil) then","path":"lib/resty/jwt.lua","position":126,"original_position":126,"commit_id":"eef699d3cb5d66a9b562a9e6e380318452bf8975","original_commit_id":"32b90408b7dd2864a252633a1c70ad1ffb0b135e","user":{"login":"fermaem","id":8686689,"avatar_url":"https://avatars.githubusercontent.com/u/8686689?v=3","gravatar_id":"","url":"https://api.github.com/users/fermaem","html_url":"https://github.com/fermaem","followers_url":"https://api.github.com/users/fermaem/followers","following_url":"https://api.github.com/users/fermaem/following{/other_user}","gists_url":"https://api.github.com/users/fermaem/gists{/gist_id}","starred_url":"https://api.github.com/users/fermaem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fermaem/subscriptions","organizations_url":"https://api.github.com/users/fermaem/orgs","repos_url":"https://api.github.com/users/fermaem/repos","events_url":"https://api.github.com/users/fermaem/events{/privacy}","received_events_url":"https://api.github.com/users/fermaem/received_events","type":"User","site_admin":false},"body":"Fixed","created_at":"2016-04-13T10:06:45Z","updated_at":"2016-04-13T10:06:45Z","html_url":"https://github.com/SkyLothar/lua-resty-jwt/pull/19#discussion_r59523513","pull_request_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/comments/59523513"},"html":{"href":"https://github.com/SkyLothar/lua-resty-jwt/pull/19#discussion_r59523513"},"pull_request":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/19","id":65794440,"html_url":"https://github.com/SkyLothar/lua-resty-jwt/pull/19","diff_url":"https://github.com/SkyLothar/lua-resty-jwt/pull/19.diff","patch_url":"https://github.com/SkyLothar/lua-resty-jwt/pull/19.patch","issue_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/issues/19","number":19,"state":"open","locked":false,"title":"Introduce validation_options","user":{"login":"fermaem","id":8686689,"avatar_url":"https://avatars.githubusercontent.com/u/8686689?v=3","gravatar_id":"","url":"https://api.github.com/users/fermaem","html_url":"https://github.com/fermaem","followers_url":"https://api.github.com/users/fermaem/followers","following_url":"https://api.github.com/users/fermaem/following{/other_user}","gists_url":"https://api.github.com/users/fermaem/gists{/gist_id}","starred_url":"https://api.github.com/users/fermaem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fermaem/subscriptions","organizations_url":"https://api.github.com/users/fermaem/orgs","repos_url":"https://api.github.com/users/fermaem/repos","events_url":"https://api.github.com/users/fermaem/events{/privacy}","received_events_url":"https://api.github.com/users/fermaem/received_events","type":"User","site_admin":false},"body":"Following https://github.com/SkyLothar/lua-resty-jwt/pull/18#issuecomment-207060867 a first spike at it.","created_at":"2016-04-08T14:28:52Z","updated_at":"2016-04-13T10:06:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b5a7e7996e074acbd4defd0fbba16bf11c595f3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/19/commits","review_comments_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/19/comments","review_comment_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/issues/19/comments","statuses_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/statuses/eef699d3cb5d66a9b562a9e6e380318452bf8975","head":{"label":"axa-assistance:em/issuer","ref":"em/issuer","sha":"eef699d3cb5d66a9b562a9e6e380318452bf8975","user":{"login":"axa-assistance","id":8945455,"avatar_url":"https://avatars.githubusercontent.com/u/8945455?v=3","gravatar_id":"","url":"https://api.github.com/users/axa-assistance","html_url":"https://github.com/axa-assistance","followers_url":"https://api.github.com/users/axa-assistance/followers","following_url":"https://api.github.com/users/axa-assistance/following{/other_user}","gists_url":"https://api.github.com/users/axa-assistance/gists{/gist_id}","starred_url":"https://api.github.com/users/axa-assistance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axa-assistance/subscriptions","organizations_url":"https://api.github.com/users/axa-assistance/orgs","repos_url":"https://api.github.com/users/axa-assistance/repos","events_url":"https://api.github.com/users/axa-assistance/events{/privacy}","received_events_url":"https://api.github.com/users/axa-assistance/received_events","type":"Organization","site_admin":false},"repo":{"id":54958666,"name":"lua-resty-jwt","full_name":"axa-assistance/lua-resty-jwt","owner":{"login":"axa-assistance","id":8945455,"avatar_url":"https://avatars.githubusercontent.com/u/8945455?v=3","gravatar_id":"","url":"https://api.github.com/users/axa-assistance","html_url":"https://github.com/axa-assistance","followers_url":"https://api.github.com/users/axa-assistance/followers","following_url":"https://api.github.com/users/axa-assistance/following{/other_user}","gists_url":"https://api.github.com/users/axa-assistance/gists{/gist_id}","starred_url":"https://api.github.com/users/axa-assistance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axa-assistance/subscriptions","organizations_url":"https://api.github.com/users/axa-assistance/orgs","repos_url":"https://api.github.com/users/axa-assistance/repos","events_url":"https://api.github.com/users/axa-assistance/events{/privacy}","received_events_url":"https://api.github.com/users/axa-assistance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/axa-assistance/lua-resty-jwt","description":"JWT For The Great Openresty","fork":true,"url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt","forks_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/forks","keys_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/teams","hooks_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/hooks","issue_events_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/issues/events{/number}","events_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/events","assignees_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/assignees{/user}","branches_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/branches{/branch}","tags_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/tags","blobs_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/git/refs{/sha}","trees_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/statuses/{sha}","languages_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/languages","stargazers_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/stargazers","contributors_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/contributors","subscribers_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/subscribers","subscription_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/subscription","commits_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/commits{/sha}","git_commits_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/git/commits{/sha}","comments_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/comments{/number}","issue_comment_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/issues/comments{/number}","contents_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/contents/{+path}","compare_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/merges","archive_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/downloads","issues_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/issues{/number}","pulls_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/pulls{/number}","milestones_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/milestones{/number}","notifications_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/labels{/name}","releases_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/releases{/id}","deployments_url":"https://api.github.com/repos/axa-assistance/lua-resty-jwt/deployments","created_at":"2016-03-29T08:24:33Z","updated_at":"2016-03-29T08:24:35Z","pushed_at":"2016-04-13T10:05:23Z","git_url":"git://github.com/axa-assistance/lua-resty-jwt.git","ssh_url":"git@github.com:axa-assistance/lua-resty-jwt.git","clone_url":"https://github.com/axa-assistance/lua-resty-jwt.git","svn_url":"https://github.com/axa-assistance/lua-resty-jwt","homepage":null,"size":119,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SkyLothar:master","ref":"master","sha":"02047da681d881dabaad48b08b98b2a3f3fac86e","user":{"login":"SkyLothar","id":1918332,"avatar_url":"https://avatars.githubusercontent.com/u/1918332?v=3","gravatar_id":"","url":"https://api.github.com/users/SkyLothar","html_url":"https://github.com/SkyLothar","followers_url":"https://api.github.com/users/SkyLothar/followers","following_url":"https://api.github.com/users/SkyLothar/following{/other_user}","gists_url":"https://api.github.com/users/SkyLothar/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyLothar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyLothar/subscriptions","organizations_url":"https://api.github.com/users/SkyLothar/orgs","repos_url":"https://api.github.com/users/SkyLothar/repos","events_url":"https://api.github.com/users/SkyLothar/events{/privacy}","received_events_url":"https://api.github.com/users/SkyLothar/received_events","type":"User","site_admin":false},"repo":{"id":27266201,"name":"lua-resty-jwt","full_name":"SkyLothar/lua-resty-jwt","owner":{"login":"SkyLothar","id":1918332,"avatar_url":"https://avatars.githubusercontent.com/u/1918332?v=3","gravatar_id":"","url":"https://api.github.com/users/SkyLothar","html_url":"https://github.com/SkyLothar","followers_url":"https://api.github.com/users/SkyLothar/followers","following_url":"https://api.github.com/users/SkyLothar/following{/other_user}","gists_url":"https://api.github.com/users/SkyLothar/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyLothar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyLothar/subscriptions","organizations_url":"https://api.github.com/users/SkyLothar/orgs","repos_url":"https://api.github.com/users/SkyLothar/repos","events_url":"https://api.github.com/users/SkyLothar/events{/privacy}","received_events_url":"https://api.github.com/users/SkyLothar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SkyLothar/lua-resty-jwt","description":"JWT For The Great Openresty","fork":false,"url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt","forks_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/forks","keys_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/teams","hooks_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/hooks","issue_events_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/issues/events{/number}","events_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/events","assignees_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/assignees{/user}","branches_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/branches{/branch}","tags_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/tags","blobs_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/git/refs{/sha}","trees_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/statuses/{sha}","languages_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/languages","stargazers_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/stargazers","contributors_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/contributors","subscribers_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/subscribers","subscription_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/subscription","commits_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/commits{/sha}","git_commits_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/git/commits{/sha}","comments_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/comments{/number}","issue_comment_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/issues/comments{/number}","contents_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/contents/{+path}","compare_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/merges","archive_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/downloads","issues_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/issues{/number}","pulls_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls{/number}","milestones_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/milestones{/number}","notifications_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/labels{/name}","releases_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/releases{/id}","deployments_url":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/deployments","created_at":"2014-11-28T12:28:56Z","updated_at":"2016-04-12T16:21:46Z","pushed_at":"2016-04-13T10:05:24Z","git_url":"git://github.com/SkyLothar/lua-resty-jwt.git","ssh_url":"git@github.com:SkyLothar/lua-resty-jwt.git","clone_url":"https://github.com/SkyLothar/lua-resty-jwt.git","svn_url":"https://github.com/SkyLothar/lua-resty-jwt","homepage":null,"size":65,"stargazers_count":56,"watchers_count":56,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":3,"forks":11,"open_issues":3,"watchers":56,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/19"},"html":{"href":"https://github.com/SkyLothar/lua-resty-jwt/pull/19"},"issue":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/issues/19"},"comments":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/SkyLothar/lua-resty-jwt/statuses/eef699d3cb5d66a9b562a9e6e380318452bf8975"}}}}