Ejemplo n.º 1
0
 /**
  * Check whether required secret keys are set and return OVH API credentials
  * {@inheritDoc}
  */
 public function getCredentials()
 {
     $secret = $this->getSecret();
     if (!isset($secret['username']) || !isset($secret['password'])) {
         throw new CredentialError('Unrecognized credential secret');
     }
     return parent::getCredentials();
 }
Ejemplo n.º 2
0
 /**
  * Generates Rackspace API key credentials
  * {@inheritDoc}
  */
 public function getCredentials()
 {
     $secret = $this->getSecret();
     return !empty($secret['username']) && !empty($secret['apiKey']) ? sprintf(self::CREDS_TEMPLATE, $secret['username'], $secret['apiKey']) : parent::getCredentials();
 }
Ejemplo n.º 3
0
 /**
  * @expectedException OpenCloud\Common\Exceptions\CredentialError
  */
 public function test_Credentials_Fail()
 {
     $client = new OpenStack(Rackspace::US_IDENTITY_ENDPOINT, array());
     $client->getCredentials();
 }