class HybridCredentials in Apigee Edge 8
The API credentials for HybridCredentials.
Hierarchy
- class \Drupal\apigee_edge\Credentials implements CredentialsInterface
- class \Drupal\apigee_edge\Connector\HybridCredentials
Expanded class hierarchy of HybridCredentials
1 file declares its use of HybridCredentials
- SDKConnector.php in src/
SDKConnector.php
File
- src/
Connector/ HybridCredentials.php, line 30
Namespace
Drupal\apigee_edge\ConnectorView source
class HybridCredentials extends Credentials {
/**
* HybridCredentials constructor.
*
* @param \Drupal\key\KeyInterface $key
* The key entity which stores the API credentials.
*
* @throws \InvalidArgumentException
* An InvalidArgumentException is thrown if the key type
* does not implement EdgeKeyTypeInterface.
*/
public function __construct(KeyInterface $key) {
if ($key
->getKeyType() instanceof EdgeKeyTypeInterface && ($auth_type = $key
->getKeyType()
->getAuthenticationType($key)) && ($auth_type === EdgeKeyTypeInterface::EDGE_AUTH_TYPE_JWT || $auth_type === EdgeKeyTypeInterface::EDGE_AUTH_TYPE_DEFAULT_GCE_SERVICE_ACCOUNT)) {
parent::__construct($key);
}
else {
throw new InvalidArgumentException("The `{$key->id()}` key is not configured for Hybrid Authentication.");
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Credentials:: |
protected | property | The key entity which stores the API credentials. | |
Credentials:: |
protected | property | The key type of the key entity. | |
Credentials:: |
public | function |
Gets the authentication object which instantiated by the key type. Overrides CredentialsInterface:: |
1 |
Credentials:: |
public | function |
Gets the key entity which stores the API credentials. Overrides CredentialsInterface:: |
|
Credentials:: |
public | function |
Gets the key type of the key entity. Overrides CredentialsInterface:: |
|
HybridCredentials:: |
public | function |
HybridCredentials constructor. Overrides Credentials:: |