You are here

public function LockrKeyProvider::getLockrSecretName in Lockr 8.4

Same name and namespace in other branches
  1. 4.x src/Plugin/KeyProvider/LockrKeyProvider.php \Drupal\lockr\Plugin\KeyProvider\LockrKeyProvider::getLockrSecretName()

Gets the lockr secret name for the given key ID.

2 calls to LockrKeyProvider::getLockrSecretName()
LockrKeyProvider::getKeyValue in src/Plugin/KeyProvider/LockrKeyProvider.php
Returns the value of a key.
LockrKeyProvider::setKeyValue in src/Plugin/KeyProvider/LockrKeyProvider.php
Sets the value of a key.

File

src/Plugin/KeyProvider/LockrKeyProvider.php, line 233
Contains Drupal\lockr\Plugin\KeyProvider\LockrKeyProvider.

Class

LockrKeyProvider
Adds a key provider that allows a key to be stored in Lockr.

Namespace

Drupal\lockr\Plugin\KeyProvider

Code

public function getLockrSecretName($key_id) {
  $secrets = $this->secretStorage
    ->loadByProperties([
    'key_id' => $key_id,
  ]);
  if (!$secrets) {
    return $key_id;
  }
  return reset($secrets)
    ->id();
}