summaryrefslogtreecommitdiff
path: root/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-06 06:57:39 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-06 06:57:39 -0500
commit420d0ca4dd6cf075204867de28c2e6d5b1b68184 (patch)
treee7723f4b0687d82300ca5b4d38e3ab0ff3fc13cf /vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php
parentcfe1e13d4a2b964c950b5e3daa8cafab207f1158 (diff)
Remove vendor again
Diffstat (limited to 'vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php')
-rw-r--r--vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php96
1 files changed, 0 insertions, 96 deletions
diff --git a/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php b/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php
deleted file mode 100644
index f6d8edfe..00000000
--- a/vendor/lusitanian/oauth/src/OAuth/OAuth1/Service/BitBucket.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
-namespace OAuth\OAuth1\Service;
-
-use OAuth\OAuth1\Signature\SignatureInterface;
-use OAuth\OAuth1\Token\StdOAuth1Token;
-use OAuth\Common\Http\Exception\TokenResponseException;
-use OAuth\Common\Http\Uri\Uri;
-use OAuth\Common\Consumer\CredentialsInterface;
-use OAuth\Common\Http\Uri\UriInterface;
-use OAuth\Common\Storage\TokenStorageInterface;
-use OAuth\Common\Http\Client\ClientInterface;
-
-class BitBucket extends AbstractService
-{
- public function __construct(
- CredentialsInterface $credentials,
- ClientInterface $httpClient,
- TokenStorageInterface $storage,
- SignatureInterface $signature,
- UriInterface $baseApiUri = null
- ) {
- parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri);
-
- if (null === $baseApiUri) {
- $this->baseApiUri = new Uri('https://bitbucket.org/api/1.0/');
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public function getRequestTokenEndpoint()
- {
- return new Uri('https://bitbucket.org/!api/1.0/oauth/request_token');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAuthorizationEndpoint()
- {
- return new Uri('https://bitbucket.org/!api/1.0/oauth/authenticate');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAccessTokenEndpoint()
- {
- return new Uri('https://bitbucket.org/!api/1.0/oauth/access_token');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function parseRequestTokenResponse($responseBody)
- {
- parse_str($responseBody, $data);
-
- if (null === $data || !is_array($data)) {
- throw new TokenResponseException('Unable to parse response.');
- } elseif (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] !== 'true') {
- throw new TokenResponseException('Error in retrieving token.');
- }
-
- return $this->parseAccessTokenResponse($responseBody);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function parseAccessTokenResponse($responseBody)
- {
- parse_str($responseBody, $data);
-
- if (null === $data || !is_array($data)) {
- throw new TokenResponseException('Unable to parse response.');
- } elseif (isset($data['error'])) {
- throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"');
- }
-
- $token = new StdOAuth1Token();
-
- $token->setRequestToken($data['oauth_token']);
- $token->setRequestTokenSecret($data['oauth_token_secret']);
- $token->setAccessToken($data['oauth_token']);
- $token->setAccessTokenSecret($data['oauth_token_secret']);
-
- $token->setEndOfLife(StdOAuth1Token::EOL_NEVER_EXPIRES);
- unset($data['oauth_token'], $data['oauth_token_secret']);
- $token->setExtraParams($data);
-
- return $token;
- }
-}