21 lines
No EOL
598 B
PHP
21 lines
No EOL
598 B
PHP
<?php
|
|
|
|
namespace DigiComp\HetznerDnsApi\Authentication;
|
|
|
|
class AuthAPITokenAuthentication implements \Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin
|
|
{
|
|
private $apiKey;
|
|
public function __construct(string $apiKey)
|
|
{
|
|
$this->{'apiKey'} = $apiKey;
|
|
}
|
|
public function authentication(\Psr\Http\Message\RequestInterface $request) : \Psr\Http\Message\RequestInterface
|
|
{
|
|
$request = $request->withHeader('Auth-API-Token', $this->{'apiKey'});
|
|
return $request;
|
|
}
|
|
public function getScope() : string
|
|
{
|
|
return 'Auth-API-Token';
|
|
}
|
|
} |