示例#1
0
 protected function getAuthOptsV2()
 {
     $httpClient = new Client(['base_uri' => getenv('OS_AUTH_URL'), 'handler' => HandlerStack::create()]);
     $identityService = new Service($httpClient, new Api());
     return ['authUrl' => getenv('OS_AUTH_URL'), 'region' => getenv('OS_REGION_NAME'), 'username' => getenv('OS_USERNAME'), 'password' => getenv('OS_PASSWORD'), 'tenantName' => getenv('OS_TENANT_NAME'), 'identityService' => $identityService];
 }
示例#2
0
 public static function getAuthOptsV2()
 {
     $httpClient = new Client(['base_uri' => CommonUtils::normalizeUrl(getenv('OS_AUTH_URL')), 'handler' => HandlerStack::create()]);
     return ['authUrl' => getenv('OS_AUTH_URL'), 'region' => getenv('OS_REGION_NAME'), 'username' => getenv('OS_USERNAME'), 'password' => getenv('OS_PASSWORD'), 'tenantName' => getenv('OS_TENANT_NAME'), 'identityService' => new Service($httpClient, new Api())];
 }
示例#3
0
 public function test_it_is_created()
 {
     $this->assertInstanceOf(HandlerStack::class, HandlerStack::create(new MockHandler()));
 }
示例#4
0
 private function getStack(callable $authHandler, Token $token = null) : HandlerStack
 {
     $stack = HandlerStack::create();
     $stack->push(Middleware::authHandler($authHandler, $token));
     return $stack;
 }