Skip to content

Commit b08f221

Browse files
[11.9] Add ability to authenticate with a job token (#722)
1 parent 9841383 commit b08f221

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Client.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ class Client
7272
*/
7373
public const AUTH_HTTP_TOKEN = 'http_token';
7474

75+
/**
76+
* The job token authentication method.
77+
*
78+
* @var string
79+
*/
80+
public const AUTH_HTTP_JOB_TOKEN = 'http_job_token';
81+
7582
/**
7683
* The OAuth 2 token authentication method.
7784
*

src/HttpClient/Plugin/Authentication.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ private static function buildHeaders(string $method, string $token, string $sudo
8484
case Client::AUTH_HTTP_TOKEN:
8585
$headers['PRIVATE-TOKEN'] = $token;
8686

87+
break;
88+
case Client::AUTH_HTTP_JOB_TOKEN:
89+
$headers['JOB-TOKEN'] = $token;
90+
8791
break;
8892
case Client::AUTH_OAUTH_TOKEN:
8993
$headers['Authorization'] = \sprintf('Bearer %s', $token);

0 commit comments

Comments
 (0)