{"action":"created","comment":{"url":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/comments/30090845","id":30090845,"diff_hunk":"@@ -0,0 +1,47 @@\n+<?php\r\n+\r\n+namespace OAuth2\\Encryption;\r\n+\r\n+/**\r\n+ * Bridge file to use the firebase/php-jwt package for JWT encoding and decoding.\r\n+ * @author Francis Chuang <francis.chuang@gmail.com>\r\n+ */\r\n+class FirebaseJwt implements EncryptionInterface\r\n+{\r\n+    public function __construct()\r\n+    {\r\n+        if (!class_exists('\\JWT')) {\r\n+            throw new \\ErrorException('firebase/php-jwt must be installed to use this feature. You can do this by running \"composer require firebase/php-jwt\"');\r\n+        }\r\n+    }\r\n+\r\n+    public function encode($payload, $key, $alg = 'HS256', $keyId = null)\r\n+    {\r\n+        return \\JWT::encode($payload, $key, $alg, $keyId);\r\n+    }\r\n+\r\n+    public function decode($jwt, $key = null, $allowedAlgorithms = null)\r\n+    {\r\n+        try {\r\n+\r\n+            //Maintain BC: Do not verify if no algorithms are passed in.\r","path":"src/OAuth2/Encryption/FirebaseJwt.php","position":27,"original_position":27,"commit_id":"48301f14d78040f7a5e12d00802e17ad8c9c597e","original_commit_id":"48301f14d78040f7a5e12d00802e17ad8c9c597e","user":{"login":"bshaffer","id":103941,"avatar_url":"https://avatars.githubusercontent.com/u/103941?v=3","gravatar_id":"","url":"https://api.github.com/users/bshaffer","html_url":"https://github.com/bshaffer","followers_url":"https://api.github.com/users/bshaffer/followers","following_url":"https://api.github.com/users/bshaffer/following{/other_user}","gists_url":"https://api.github.com/users/bshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/bshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bshaffer/subscriptions","organizations_url":"https://api.github.com/users/bshaffer/orgs","repos_url":"https://api.github.com/users/bshaffer/repos","events_url":"https://api.github.com/users/bshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/bshaffer/received_events","type":"User","site_admin":false},"body":"hmm, I don't think you understand my point. We cannot break BC with interfaces, but we are not required to \"preserve\" BC for new classes.\r\n\r\nThis function is called [here](https://github.com/bshaffer/oauth2-server-php/blob/develop/src/OAuth2/GrantType/JwtBearer.php#L89) and [here])https://github.com/bshaffer/oauth2-server-php/blob/develop/src/OAuth2/GrantType/JwtBearer.php#L188), and neither instance requires this \"BC\" logic.\r\n\r\n\r\n\r\nSo, This ","created_at":"2015-05-11T22:56:05Z","updated_at":"2015-05-11T22:56:05Z","html_url":"https://github.com/bshaffer/oauth2-server-php/pull/585#discussion_r30090845","pull_request_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/585","_links":{"self":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/comments/30090845"},"html":{"href":"https://github.com/bshaffer/oauth2-server-php/pull/585#discussion_r30090845"},"pull_request":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/585"}}},"pull_request":{"url":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/585","id":35076057,"html_url":"https://github.com/bshaffer/oauth2-server-php/pull/585","diff_url":"https://github.com/bshaffer/oauth2-server-php/pull/585.diff","patch_url":"https://github.com/bshaffer/oauth2-server-php/pull/585.patch","issue_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/issues/585","number":585,"state":"open","locked":false,"title":"Added FirebaseJwt bridge for 1.x","user":{"login":"F21","id":2263040,"avatar_url":"https://avatars.githubusercontent.com/u/2263040?v=3","gravatar_id":"","url":"https://api.github.com/users/F21","html_url":"https://github.com/F21","followers_url":"https://api.github.com/users/F21/followers","following_url":"https://api.github.com/users/F21/following{/other_user}","gists_url":"https://api.github.com/users/F21/gists{/gist_id}","starred_url":"https://api.github.com/users/F21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F21/subscriptions","organizations_url":"https://api.github.com/users/F21/orgs","repos_url":"https://api.github.com/users/F21/repos","events_url":"https://api.github.com/users/F21/events{/privacy}","received_events_url":"https://api.github.com/users/F21/received_events","type":"User","site_admin":false},"body":"Here's the PR to allow `firebase/php-jwt` to be (optionally) used with 1.x if desired.","created_at":"2015-05-10T02:02:35Z","updated_at":"2015-05-11T22:56:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c844b06b56b9343b343412fb0b558f0198620c3d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/585/commits","review_comments_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/585/comments","review_comment_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/issues/585/comments","statuses_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/statuses/48301f14d78040f7a5e12d00802e17ad8c9c597e","head":{"label":"F21:firebase-jwt-1.x","ref":"firebase-jwt-1.x","sha":"48301f14d78040f7a5e12d00802e17ad8c9c597e","user":{"login":"F21","id":2263040,"avatar_url":"https://avatars.githubusercontent.com/u/2263040?v=3","gravatar_id":"","url":"https://api.github.com/users/F21","html_url":"https://github.com/F21","followers_url":"https://api.github.com/users/F21/followers","following_url":"https://api.github.com/users/F21/following{/other_user}","gists_url":"https://api.github.com/users/F21/gists{/gist_id}","starred_url":"https://api.github.com/users/F21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F21/subscriptions","organizations_url":"https://api.github.com/users/F21/orgs","repos_url":"https://api.github.com/users/F21/repos","events_url":"https://api.github.com/users/F21/events{/privacy}","received_events_url":"https://api.github.com/users/F21/received_events","type":"User","site_admin":false},"repo":{"id":7635649,"name":"oauth2-server-php","full_name":"F21/oauth2-server-php","owner":{"login":"F21","id":2263040,"avatar_url":"https://avatars.githubusercontent.com/u/2263040?v=3","gravatar_id":"","url":"https://api.github.com/users/F21","html_url":"https://github.com/F21","followers_url":"https://api.github.com/users/F21/followers","following_url":"https://api.github.com/users/F21/following{/other_user}","gists_url":"https://api.github.com/users/F21/gists{/gist_id}","starred_url":"https://api.github.com/users/F21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F21/subscriptions","organizations_url":"https://api.github.com/users/F21/orgs","repos_url":"https://api.github.com/users/F21/repos","events_url":"https://api.github.com/users/F21/events{/privacy}","received_events_url":"https://api.github.com/users/F21/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/F21/oauth2-server-php","description":"A library for implementing an OAuth2 Server in php","fork":true,"url":"https://api.github.com/repos/F21/oauth2-server-php","forks_url":"https://api.github.com/repos/F21/oauth2-server-php/forks","keys_url":"https://api.github.com/repos/F21/oauth2-server-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/F21/oauth2-server-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/F21/oauth2-server-php/teams","hooks_url":"https://api.github.com/repos/F21/oauth2-server-php/hooks","issue_events_url":"https://api.github.com/repos/F21/oauth2-server-php/issues/events{/number}","events_url":"https://api.github.com/repos/F21/oauth2-server-php/events","assignees_url":"https://api.github.com/repos/F21/oauth2-server-php/assignees{/user}","branches_url":"https://api.github.com/repos/F21/oauth2-server-php/branches{/branch}","tags_url":"https://api.github.com/repos/F21/oauth2-server-php/tags","blobs_url":"https://api.github.com/repos/F21/oauth2-server-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/F21/oauth2-server-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/F21/oauth2-server-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/F21/oauth2-server-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/F21/oauth2-server-php/statuses/{sha}","languages_url":"https://api.github.com/repos/F21/oauth2-server-php/languages","stargazers_url":"https://api.github.com/repos/F21/oauth2-server-php/stargazers","contributors_url":"https://api.github.com/repos/F21/oauth2-server-php/contributors","subscribers_url":"https://api.github.com/repos/F21/oauth2-server-php/subscribers","subscription_url":"https://api.github.com/repos/F21/oauth2-server-php/subscription","commits_url":"https://api.github.com/repos/F21/oauth2-server-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/F21/oauth2-server-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/F21/oauth2-server-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/F21/oauth2-server-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/F21/oauth2-server-php/contents/{+path}","compare_url":"https://api.github.com/repos/F21/oauth2-server-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/F21/oauth2-server-php/merges","archive_url":"https://api.github.com/repos/F21/oauth2-server-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/F21/oauth2-server-php/downloads","issues_url":"https://api.github.com/repos/F21/oauth2-server-php/issues{/number}","pulls_url":"https://api.github.com/repos/F21/oauth2-server-php/pulls{/number}","milestones_url":"https://api.github.com/repos/F21/oauth2-server-php/milestones{/number}","notifications_url":"https://api.github.com/repos/F21/oauth2-server-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/F21/oauth2-server-php/labels{/name}","releases_url":"https://api.github.com/repos/F21/oauth2-server-php/releases{/id}","created_at":"2013-01-15T23:48:54Z","updated_at":"2015-05-07T09:48:01Z","pushed_at":"2015-05-10T02:21:39Z","git_url":"git://github.com/F21/oauth2-server-php.git","ssh_url":"git@github.com:F21/oauth2-server-php.git","clone_url":"https://github.com/F21/oauth2-server-php.git","svn_url":"https://github.com/F21/oauth2-server-php","homepage":null,"size":1489,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"develop"}},"base":{"label":"bshaffer:develop","ref":"develop","sha":"1c72c6910c91d1a49eeda5e4599ad2178ca61b46","user":{"login":"bshaffer","id":103941,"avatar_url":"https://avatars.githubusercontent.com/u/103941?v=3","gravatar_id":"","url":"https://api.github.com/users/bshaffer","html_url":"https://github.com/bshaffer","followers_url":"https://api.github.com/users/bshaffer/followers","following_url":"https://api.github.com/users/bshaffer/following{/other_user}","gists_url":"https://api.github.com/users/bshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/bshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bshaffer/subscriptions","organizations_url":"https://api.github.com/users/bshaffer/orgs","repos_url":"https://api.github.com/users/bshaffer/repos","events_url":"https://api.github.com/users/bshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/bshaffer/received_events","type":"User","site_admin":false},"repo":{"id":5893828,"name":"oauth2-server-php","full_name":"bshaffer/oauth2-server-php","owner":{"login":"bshaffer","id":103941,"avatar_url":"https://avatars.githubusercontent.com/u/103941?v=3","gravatar_id":"","url":"https://api.github.com/users/bshaffer","html_url":"https://github.com/bshaffer","followers_url":"https://api.github.com/users/bshaffer/followers","following_url":"https://api.github.com/users/bshaffer/following{/other_user}","gists_url":"https://api.github.com/users/bshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/bshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bshaffer/subscriptions","organizations_url":"https://api.github.com/users/bshaffer/orgs","repos_url":"https://api.github.com/users/bshaffer/repos","events_url":"https://api.github.com/users/bshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/bshaffer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bshaffer/oauth2-server-php","description":"A library for implementing an OAuth2 Server in php","fork":false,"url":"https://api.github.com/repos/bshaffer/oauth2-server-php","forks_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/forks","keys_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/teams","hooks_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/hooks","issue_events_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/issues/events{/number}","events_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/events","assignees_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/assignees{/user}","branches_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/branches{/branch}","tags_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/tags","blobs_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/statuses/{sha}","languages_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/languages","stargazers_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/stargazers","contributors_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/contributors","subscribers_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/subscribers","subscription_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/subscription","commits_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/contents/{+path}","compare_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/merges","archive_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/downloads","issues_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/issues{/number}","pulls_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls{/number}","milestones_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/milestones{/number}","notifications_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/labels{/name}","releases_url":"https://api.github.com/repos/bshaffer/oauth2-server-php/releases{/id}","created_at":"2012-09-20T22:22:53Z","updated_at":"2015-05-11T20:10:45Z","pushed_at":"2015-05-11T21:08:12Z","git_url":"git://github.com/bshaffer/oauth2-server-php.git","ssh_url":"git@github.com:bshaffer/oauth2-server-php.git","clone_url":"https://github.com/bshaffer/oauth2-server-php.git","svn_url":"https://github.com/bshaffer/oauth2-server-php","homepage":"http://bshaffer.github.io/oauth2-server-php-docs","size":4423,"stargazers_count":1197,"watchers_count":1197,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":383,"mirror_url":null,"open_issues_count":85,"forks":383,"open_issues":85,"watchers":1197,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/585"},"html":{"href":"https://github.com/bshaffer/oauth2-server-php/pull/585"},"issue":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/issues/585"},"comments":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/issues/585/comments"},"review_comments":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/585/comments"},"review_comment":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/pulls/585/commits"},"statuses":{"href":"https://api.github.com/repos/bshaffer/oauth2-server-php/statuses/48301f14d78040f7a5e12d00802e17ad8c9c597e"}}}}