We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8989e3e + 7fa4ceb commit 653bd79Copy full SHA for 653bd79
lib/Gitlab/Client.php
@@ -44,6 +44,12 @@ class Client
44
*/
45
const AUTH_HTTP_TOKEN = 'http_token';
46
47
+ /**
48
+ * Constant for authentication method. Indicates the OAuth method with a key
49
+ * obtain using Gitlab's OAuth provider.
50
+ */
51
+ const AUTH_OAUTH_TOKEN = 'oauth_token';
52
+
53
/**
54
* @var array
55
lib/Gitlab/HttpClient/Listener/AuthListener.php
@@ -76,6 +76,13 @@ public function preSend(RequestInterface $request)
76
77
$request->fromUrl(new Url($url));
78
break;
79
80
+ case Client::AUTH_OAUTH_TOKEN:
81
+ $request->addHeader('Authorization: Bearer '.$this->token);
82
+ if (!is_null($this->sudo)) {
83
+ $request->addHeader('SUDO: '.$this->sudo);
84
+ }
85
+ break;
86
}
87
88
0 commit comments