You are here

public function LockrKeyProvider::getLockrSecretName in Lockr 4.x

Same name and namespace in other branches
  1. 8.4 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
LockrKeyProvider::setKeyValue in src/Plugin/KeyProvider/LockrKeyProvider.php

File

src/Plugin/KeyProvider/LockrKeyProvider.php, line 244
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();
}