public function createClient(Tenant $tenant, array $config = [], $class = null)
    {
        if (null === $class) {
            $class = $this->clientClass;
        }

        $pool = new TokenPool($tenant, $this->cache, $this->logger);
        $signer = new RequestSigner($pool);

        $stack = HandlerStack::create();
        $stack->before('http_errors', Middleware::signRequest($signer), 'signer');
        $stack->before('http_errors', Middleware::reauthenticate($signer), 'reauth');

        return new $class(array_merge($config, [
            'handler' => $stack,
            'token_pool' => $pool,
        ]));
    }
public function createClient(Tenant $tenant, array $config = [], $class = null)
    {
        if (null === $class) {
            $class = $this->clientClass;
        }

        $pool = new TokenPool($tenant, $this->cache, $this->logger);
        $signer = new RequestSigner($pool);

        $stack = HandlerStack::create();
        $stack->before('http_errors', Middleware::signRequest($signer), 'signer');
        $stack->before('http_errors', Middleware::reauthenticate($signer), 'reauth');

        return new $class(array_merge($config, [
            'handler' => $stack,
            'token_pool' => $pool,
        ]));
    }
public function createClient ( Tenant $ tenant , array $ config = [ ] , $ class = null ) { if ( null === $ class ) { $ class = $ this -> clientClass ; } $ pool = new TokenPool ( $ tenant , $ this -> cache , $ this -> logger ) ; $ signer = new RequestSigner ( $ pool ) ; $ stack = HandlerStack :: create ( ) ; $ stack -> before ( 'http_errors' , Middleware :: signRequest ( $ signer ) , 'signer' ) ; $ stack -> before ( 'http_errors' , Middleware :: reauthenticate ( $ signer ) , 'reauth' ) ; return new $ class ( array_merge ( $ config , [ 'handler' => $ stack , 'token_pool' => $ pool , ] ) ) ; }
Creates a Guzzle client for communicating with a Keystone service.

@param Tenant $tenant The keystone tenant to authenticate with
@param array  $config The client configuration
@param string $class  Optionally override the Guzzle client class

@throws RequestException When a new token could not be requested.

@return ClientInterface
Creates a Guzzle client for communicating with a Keystone service .