You are here

public function EdgeKeyTypeBase::getPassword in Apigee Edge 8

Gets the API password.

Parameters

\Drupal\key\KeyInterface $key: The key entity.

Return value

string The API password.

Overrides EdgeKeyTypeInterface::getPassword

1 call to EdgeKeyTypeBase::getPassword()
ApigeeAuthKeyType::getAuthenticationMethod in src/Plugin/KeyType/ApigeeAuthKeyType.php
Gets the authentication method object.

File

src/Plugin/EdgeKeyTypeBase.php, line 133

Class

EdgeKeyTypeBase
Defines a base class for Apigee Edge Key Type plugins.

Namespace

Drupal\apigee_edge\Plugin

Code

public function getPassword(KeyInterface $key) : string {
  if (!isset($key
    ->getKeyValues()['password'])) {
    throw new AuthenticationKeyValueMalformedException('password');
  }
  return $key
    ->getKeyValues()['password'];
}