We have detected an error in your notification set-up
(Event-ID dab39dc24f564ec7bd4628d1305fd03c).
Currently, we cannot inform you about inspection progress.
Please check that the user
557058:bca11929-8c2d-43f2-8a82-c5416880d395
still has access to your repository or
update the API account.
1 | <?php |
||
24 | class OAuthPlugin implements Plugin |
||
25 | { |
||
26 | use Plugin\VersionBridgePlugin; |
||
27 | |||
28 | const ENDPOINT_REQUEST_TOKEN = 'oauth/request_token'; |
||
29 | const ENDPOINT_ACCESS_TOKEN = 'oauth/access_token'; |
||
30 | const ENDPOINT_AUTHORIZE = 'oauth/authenticate'; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $config = array( |
||
36 | 'oauth_consumer_key' => 'anon', |
||
37 | 'oauth_consumer_secret' => 'anon', |
||
38 | 'oauth_token' => '', |
||
39 | 'oauth_token_secret' => '', |
||
40 | 'oauth_signature_method' => 'HMAC-SHA1', |
||
41 | 'oauth_callback' => '', |
||
42 | 'oauth_verifier' => '', |
||
43 | 'oauth_version' => '1.0', |
||
44 | ); |
||
45 | |||
46 | /** |
||
47 | * @var SignatureMethodInterface |
||
48 | */ |
||
49 | protected $signature; |
||
50 | |||
51 | /** |
||
52 | * @var TokenInterface |
||
53 | */ |
||
54 | protected $token; |
||
55 | |||
56 | /** |
||
57 | * @var ConsumerInterface |
||
58 | */ |
||
59 | protected $consumer; |
||
60 | |||
61 | public function __construct( |
||
72 | |||
73 | protected function doHandleRequest(RequestInterface $request, callable $next, callable $first) |
||
90 | |||
91 | /** |
||
92 | * Include OAuth and request body parameters |
||
93 | * |
||
94 | * @access protected |
||
95 | * @param RequestInterface $request |
||
96 | * @return array |
||
97 | * |
||
98 | * @see http://oauth.net/core/1.0/#sig_norm_param |
||
99 | */ |
||
100 | protected function getParametersToSign(RequestInterface $request) |
||
110 | |||
111 | /** |
||
112 | * Include/exclude optional parameters |
||
113 | * |
||
114 | * The exclusion/inclusion is based on current request resource |
||
115 | * |
||
116 | * @access protected |
||
117 | * @param RequestInterface $request |
||
118 | * @return array |
||
119 | */ |
||
120 | protected function getOAuthParameters(RequestInterface $request) |
||
132 | |||
133 | /** |
||
134 | * White list based filter |
||
135 | * |
||
136 | * @access protected |
||
137 | * @param string[] $include |
||
138 | * @return array |
||
139 | */ |
||
140 | protected function filterOAuthParameters(array $include) |
||
152 | |||
153 | /** |
||
154 | * Transform request content to associative array |
||
155 | * |
||
156 | * @access protected |
||
157 | * @param RequestInterface $request |
||
158 | * @return array |
||
159 | */ |
||
160 | protected function getContentAsParameters(RequestInterface $request) |
||
166 | |||
167 | /** |
||
168 | * Check if specified endpoint is in current request |
||
169 | * |
||
170 | * @param string $endpoint |
||
171 | * @param RequestInterface $request |
||
172 | * @return bool |
||
173 | */ |
||
174 | protected function isEndpointRequested($endpoint, RequestInterface $request) |
||
178 | |||
179 | /** |
||
180 | * Bitbucket supports only HMAC-SHA1 and PlainText signatures. |
||
181 | * |
||
182 | * For better security, HMAC-SHA1 is the default one. |
||
183 | * |
||
184 | * @return \JacobKiers\OAuth\SignatureMethod\SignatureMethodInterface |
||
185 | */ |
||
186 | protected function getSigner() |
||
198 | |||
199 | /** |
||
200 | * @access public |
||
201 | * @param TokenInterface|null $token |
||
202 | * @return TokenInterface |
||
203 | */ |
||
204 | protected function initToken($token) |
||
213 | |||
214 | /** |
||
215 | * @access public |
||
216 | * @param ConsumerInterface|null $consumer |
||
217 | * @return ConsumerInterface |
||
218 | */ |
||
219 | protected function initConsumer($consumer) |
||
229 | } |
||
230 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.