Skip to content

Commit 129aefd

Browse files
committed
Add JWT authentication introduced with GitHub integrations
1 parent 215cab4 commit 129aefd

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎lib/Github/Client.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ class Client
8686
*/
8787
const AUTH_HTTP_TOKEN = 'http_token';
8888

89+
/**
90+
* Constant for authentication method. Indicates JSON Web Token
91+
* authentication required for integration access to the API.
92+
*/
93+
const AUTH_JWT = 'jwt';
94+
8995
/**
9096
* @var string
9197
*/

‎lib/Github/HttpClient/Plugin/Authentication.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
7171
$request = $request->withUri($uri);
7272
break;
7373

74+
case Client::AUTH_JWT:
75+
$request = $request->withHeader('Authorization', sprintf('Bearer %s', $this->tokenOrLogin));
76+
break;
77+
7478
default:
7579
throw new RuntimeException(sprintf('%s not yet implemented', $this->method));
7680
break;

0 commit comments

Comments
 (0)