engineering/vendor/alibabacloud/client/src/Credentials/BearerTokenCredential.php
shengchanzhe 5d7af114f8 init
2023-11-08 20:45:32 +08:00

67 lines
1.1 KiB
PHP

<?php
namespace AlibabaCloud\Client\Credentials;
use AlibabaCloud\Client\Filter\CredentialFilter;
use AlibabaCloud\Client\Exception\ClientException;
/**
* Class BearerTokenCredential
*
* @package AlibabaCloud\Client\Credentials
*/
class BearerTokenCredential implements CredentialsInterface
{
/**
* @var string
*/
private $bearerToken;
/**
* Class constructor.
*
* @param string $bearerToken
*
* @throws ClientException
*/
public function __construct($bearerToken)
{
CredentialFilter::bearerToken($bearerToken);
$this->bearerToken = $bearerToken;
}
/**
* @return string
*/
public function getBearerToken()
{
return $this->bearerToken;
}
/**
* @return string
*/
public function getAccessKeyId()
{
return '';
}
/**
* @return string
*/
public function getAccessKeySecret()
{
return '';
}
/**
* @return string
*/
public function __toString()
{
return "bearerToken#$this->bearerToken";
}
}