You are here

public function LockrAdmin::createClientToken in Lockr 7.3

Parameters

string $keyring_id:

string $env:

string $label:

Return value

string

File

vendor/lockr/lockr/src/LockrAdmin.php, line 106

Class

LockrAdmin

Namespace

Lockr

Code

public function createClientToken($keyring_id, $env, $label) {
  $query = <<<'EOQ'
mutation CreateClientToken($input: CreateClientToken!) {
  createClientToken(input: $input) {
    token
  }
}
EOQ;
  $data = $this->client
    ->query([
    'query' => $query,
    'variables' => [
      'input' => [
        'keyringId' => $keyring_id,
        'clientLabel' => $label,
        'clientEnv' => $env,
      ],
    ],
  ]);
  return $data['createClientToken']['token'];
}