public function SecretInfo::getSecretInfo in Lockr 8.4
Same name and namespace in other branches
- 8.3 src/SecretInfo.php \Drupal\lockr\SecretInfo::getSecretInfo()
- 4.x src/SecretInfo.php \Drupal\lockr\SecretInfo::getSecretInfo()
File
- src/
SecretInfo.php, line 53
Class
- SecretInfo
- SecretInfo implements secret info for Lockr secrets.
Namespace
Drupal\lockrCode
public function getSecretInfo($name) {
/** @var \Drupal\lockr\SecretInterface */
$secret = $this->secretStorage
->load($name);
if (!is_null($secret)) {
return $secret
->getInfo();
}
$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 ?: [];
}