File ManagerCurrent Directory: wp-content/plugins/wp-mail-smtp/vendor_prefixed/google/apiclient/src/AuthHandlerLinux appserver-0d5e4f1e-php-cc8da225320a42ba9b7d66cba40b1f03 6.6.123+ #1 SMP PREEMPT_DYNAMIC Wed Mar 11 09:04:28 UTC 2026 x86_64Edit File: Guzzle5AuthHandler.php <?php namespace WPMailSMTP\Vendor\Google\AuthHandler; use WPMailSMTP\Vendor\Google\Auth\CredentialsLoader; use WPMailSMTP\Vendor\Google\Auth\FetchAuthTokenCache; use WPMailSMTP\Vendor\Google\Auth\HttpHandler\HttpHandlerFactory; use WPMailSMTP\Vendor\Google\Auth\Subscriber\AuthTokenSubscriber; use WPMailSMTP\Vendor\Google\Auth\Subscriber\ScopedAccessTokenSubscriber; use WPMailSMTP\Vendor\Google\Auth\Subscriber\SimpleSubscriber; use WPMailSMTP\Vendor\GuzzleHttp\Client; use WPMailSMTP\Vendor\GuzzleHttp\ClientInterface; use WPMailSMTP\Vendor\Psr\Cache\CacheItemPoolInterface; /** * This supports Guzzle 5 */ class Guzzle5AuthHandler { protected $cache; protected $cacheConfig; public function __construct(\WPMailSMTP\Vendor\Psr\Cache\CacheItemPoolInterface $cache = null, array $cacheConfig = []) { $this->cache = $cache; $this->cacheConfig = $cacheConfig; } public function attachCredentials(\WPMailSMTP\Vendor\GuzzleHttp\ClientInterface $http, \WPMailSMTP\Vendor\Google\Auth\CredentialsLoader $credentials, callable $tokenCallback = null) { // use the provided cache if ($this->cache) { $credentials = new \WPMailSMTP\Vendor\Google\Auth\FetchAuthTokenCache($credentials, $this->cacheConfig, $this->cache); } return $this->attachCredentialsCache($http, $credentials, $tokenCallback); } public function attachCredentialsCache(\WPMailSMTP\Vendor\GuzzleHttp\ClientInterface $http, \WPMailSMTP\Vendor\Google\Auth\FetchAuthTokenCache $credentials, callable $tokenCallback = null) { // if we end up needing to make an HTTP request to retrieve credentials, we // can use our existing one, but we need to throw exceptions so the error // bubbles up. $authHttp = $this->createAuthHttp($http); $authHttpHandler = \WPMailSMTP\Vendor\Google\Auth\HttpHandler\HttpHandlerFactory::build($authHttp); $subscriber = new \WPMailSMTP\Vendor\Google\Auth\Subscriber\AuthTokenSubscriber($credentials, $authHttpHandler, $tokenCallback); $http->setDefaultOption('auth', 'google_auth'); $http->getEmitter()->attach($subscriber); return $http; } public function attachToken(\WPMailSMTP\Vendor\GuzzleHttp\ClientInterface $http, array $token, array $scopes) { $tokenFunc = function ($scopes) use($token) { return $token['access_token']; }; $subscriber = new \WPMailSMTP\Vendor\Google\Auth\Subscriber\ScopedAccessTokenSubscriber($tokenFunc, $scopes, $this->cacheConfig, $this->cache); $http->setDefaultOption('auth', 'scoped'); $http->getEmitter()->attach($subscriber); return $http; } public function attachKey(\WPMailSMTP\Vendor\GuzzleHttp\ClientInterface $http, $key) { $subscriber = new \WPMailSMTP\Vendor\Google\Auth\Subscriber\SimpleSubscriber(['key' => $key]); $http->setDefaultOption('auth', 'simple'); $http->getEmitter()->attach($subscriber); return $http; } private function createAuthHttp(\WPMailSMTP\Vendor\GuzzleHttp\ClientInterface $http) { return new \WPMailSMTP\Vendor\GuzzleHttp\Client(['base_url' => $http->getBaseUrl(), 'defaults' => ['exceptions' => \true, 'verify' => $http->getDefaultOption('verify'), 'proxy' => $http->getDefaultOption('proxy')]]); } } Upload File Directory Listing NameTypeSizeActions.. (Parent Directory)DirAuthHandlerFactory.phpFile1.94 KB Rename | Delete | EditGuzzle5AuthHandler.phpFile3.29 KB Rename | Delete | EditGuzzle6AuthHandler.phpFile3.62 KB Rename | Delete | EditGuzzle7AuthHandler.phpFile780.00 B Rename | Delete | Edit