You are here

public function SecretInfo::getSecretInfo in Lockr 8.3

Same name and namespace in other branches
  1. 8.4 src/SecretInfo.php \Drupal\lockr\SecretInfo::getSecretInfo()
  2. 4.x src/SecretInfo.php \Drupal\lockr\SecretInfo::getSecretInfo()

File

src/SecretInfo.php, line 47

Class

SecretInfo
SecretInfo implements secret info for Lockr secrets.

Namespace

Drupal\lockr

Code

public function getSecretInfo($name) {
  $config = $this->configFactory
    ->get('lockr.secret_info');
  $info = $config
    ->get($name);
  if (!$info) {
    $key = $this->keyRepository
      ->getKey($name);
    if ($key) {
      $provider = $key
        ->getKeyProvider();
      $config = $provider
        ->getConfiguration();
      if (isset($config['encoded'])) {
        return [
          'wrapping_key' => $config['encoded'],
        ];
      }
    }
  }
  return $info ?: [];
}