阿里短信验证
This commit is contained in:
53
vendor/alibabacloud/credentials/src/BearerTokenCredential.php
vendored
Normal file
53
vendor/alibabacloud/credentials/src/BearerTokenCredential.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace AlibabaCloud\Credentials;
|
||||
|
||||
use AlibabaCloud\Credentials\Signature\BearerTokenSignature;
|
||||
|
||||
/**
|
||||
* Class BearerTokenCredential
|
||||
*/
|
||||
class BearerTokenCredential implements CredentialsInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $bearerToken;
|
||||
|
||||
/**
|
||||
* BearerTokenCredential constructor.
|
||||
*
|
||||
* @param $bearer_token
|
||||
*/
|
||||
public function __construct($bearer_token)
|
||||
{
|
||||
Filter::bearerToken($bearer_token);
|
||||
|
||||
$this->bearerToken = $bearer_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user