/** * 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(); }
/** * 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(); }
/** * @expectedException OpenCloud\Common\Exceptions\CredentialError */ public function test_Credentials_Fail() { $client = new OpenStack(Rackspace::US_IDENTITY_ENDPOINT, array()); $client->getCredentials(); }