| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/OptionProvider.tar |
PostAuthOptionProvider.php 0000666 00000003041 15112661665 0011743 0 ustar 00 <?php
/**
* This file is part of the league/oauth2-client library
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright Copyright (c) Alex Bilbie <hello@alexbilbie.com>
* @license http://opensource.org/licenses/MIT MIT
* @link http://thephpleague.com/oauth2-client/ Documentation
* @link https://packagist.org/packages/league/oauth2-client Packagist
* @link https://github.com/thephpleague/oauth2-client GitHub
*/
namespace YoastSEO_Vendor\League\OAuth2\Client\OptionProvider;
use YoastSEO_Vendor\League\OAuth2\Client\Provider\AbstractProvider;
use YoastSEO_Vendor\League\OAuth2\Client\Tool\QueryBuilderTrait;
/**
* Provide options for access token
*/
class PostAuthOptionProvider implements \YoastSEO_Vendor\League\OAuth2\Client\OptionProvider\OptionProviderInterface
{
use QueryBuilderTrait;
/**
* @inheritdoc
*/
public function getAccessTokenOptions($method, array $params)
{
$options = ['headers' => ['content-type' => 'application/x-www-form-urlencoded']];
if ($method === \YoastSEO_Vendor\League\OAuth2\Client\Provider\AbstractProvider::METHOD_POST) {
$options['body'] = $this->getAccessTokenBody($params);
}
return $options;
}
/**
* Returns the request body for requesting an access token.
*
* @param array $params
* @return string
*/
protected function getAccessTokenBody(array $params)
{
return $this->buildQueryString($params);
}
}
HttpBasicAuthOptionProvider.php 0000666 00000002752 15112661665 0012707 0 ustar 00 <?php
/**
* This file is part of the league/oauth2-client library
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright Copyright (c) Alex Bilbie <hello@alexbilbie.com>
* @license http://opensource.org/licenses/MIT MIT
* @link http://thephpleague.com/oauth2-client/ Documentation
* @link https://packagist.org/packages/league/oauth2-client Packagist
* @link https://github.com/thephpleague/oauth2-client GitHub
*/
namespace YoastSEO_Vendor\League\OAuth2\Client\OptionProvider;
use InvalidArgumentException;
/**
* Add http basic auth into access token request options
* @link https://tools.ietf.org/html/rfc6749#section-2.3.1
*/
class HttpBasicAuthOptionProvider extends \YoastSEO_Vendor\League\OAuth2\Client\OptionProvider\PostAuthOptionProvider
{
/**
* @inheritdoc
*/
public function getAccessTokenOptions($method, array $params)
{
if (empty($params['client_id']) || empty($params['client_secret'])) {
throw new \InvalidArgumentException('clientId and clientSecret are required for http basic auth');
}
$encodedCredentials = \base64_encode(\sprintf('%s:%s', $params['client_id'], $params['client_secret']));
unset($params['client_id'], $params['client_secret']);
$options = parent::getAccessTokenOptions($method, $params);
$options['headers']['Authorization'] = 'Basic ' . $encodedCredentials;
return $options;
}
}
OptionProviderInterface.php 0000666 00000001613 15112661665 0012077 0 ustar 00 <?php
/**
* This file is part of the league/oauth2-client library
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright Copyright (c) Alex Bilbie <hello@alexbilbie.com>
* @license http://opensource.org/licenses/MIT MIT
* @link http://thephpleague.com/oauth2-client/ Documentation
* @link https://packagist.org/packages/league/oauth2-client Packagist
* @link https://github.com/thephpleague/oauth2-client GitHub
*/
namespace YoastSEO_Vendor\League\OAuth2\Client\OptionProvider;
/**
* Interface for access token options provider
*/
interface OptionProviderInterface
{
/**
* Builds request options used for requesting an access token.
*
* @param string $method
* @param array $params
* @return array
*/
public function getAccessTokenOptions($method, array $params);
}
.htaccess 0000666 00000000424 15114231222 0006337 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
Deny from all
</FilesMatch>
</IfModule>