You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
908 B
54 lines
908 B
1 year ago
|
<?php
|
||
|
|
||
|
namespace AlibabaCloud\Credentials;
|
||
|
|
||
|
use AlibabaCloud\Credentials\Signature\BearerTokenSignature;
|
||
|
|
||
|
/**
|
||
|
* Class BearerTokenCredential
|
||
|
*/
|
||
|
class BearerTokenCredential implements CredentialsInterface
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
private $bearerToken;
|
||
|
|
||
|
/**
|
||
|
* BearerTokenCredential constructor.
|
||
|
*
|
||
|
* @param $bearerToken
|
||
|
*/
|
||
|
public function __construct($bearerToken)
|
||
|
{
|
||
|
Filter::bearerToken($bearerToken);
|
||
|
|
||
|
$this->bearerToken = $bearerToken;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getBearerToken()
|
||
|
{
|
||
|
return $this->bearerToken;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return string
|
||
|
*/
|
||
|
public function __toString()
|
||
|
{
|
||
|
return "bearerToken#$this->bearerToken";
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return BearerTokenSignature
|
||
|
*/
|
||
|
public function getSignature()
|
||
|
{
|
||
|
return new BearerTokenSignature();
|
||
|
}
|
||
|
}
|