代码同步
This commit is contained in:
@@ -2,49 +2,269 @@
|
||||
|
||||
namespace AlibabaCloud\Credentials\Credential;
|
||||
|
||||
class Config
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class Config extends Model
|
||||
{
|
||||
public function validate()
|
||||
{
|
||||
}
|
||||
public function toMap()
|
||||
{
|
||||
$res = [];
|
||||
if (null !== $this->accessKeyId) {
|
||||
$res['accessKeyId'] = $this->accessKeyId;
|
||||
}
|
||||
if (null !== $this->accessKeySecret) {
|
||||
$res['accessKeySecret'] = $this->accessKeySecret;
|
||||
}
|
||||
if (null !== $this->securityToken) {
|
||||
$res['securityToken'] = $this->securityToken;
|
||||
}
|
||||
if (null !== $this->bearerToken) {
|
||||
$res['bearerToken'] = $this->bearerToken;
|
||||
}
|
||||
if (null !== $this->durationSeconds) {
|
||||
$res['durationSeconds'] = $this->durationSeconds;
|
||||
}
|
||||
if (null !== $this->roleArn) {
|
||||
$res['roleArn'] = $this->roleArn;
|
||||
}
|
||||
if (null !== $this->policy) {
|
||||
$res['policy'] = $this->policy;
|
||||
}
|
||||
if (null !== $this->roleSessionExpiration) {
|
||||
$res['roleSessionExpiration'] = $this->roleSessionExpiration;
|
||||
}
|
||||
if (null !== $this->roleSessionName) {
|
||||
$res['roleSessionName'] = $this->roleSessionName;
|
||||
}
|
||||
if (null !== $this->publicKeyId) {
|
||||
$res['publicKeyId'] = $this->publicKeyId;
|
||||
}
|
||||
if (null !== $this->privateKeyFile) {
|
||||
$res['privateKeyFile'] = $this->privateKeyFile;
|
||||
}
|
||||
if (null !== $this->roleName) {
|
||||
$res['roleName'] = $this->roleName;
|
||||
}
|
||||
if (null !== $this->credentialsURI) {
|
||||
$res['credentialsURI'] = $this->credentialsURI;
|
||||
}
|
||||
if (null !== $this->type) {
|
||||
$res['type'] = $this->type;
|
||||
}
|
||||
if (null !== $this->STSEndpoint) {
|
||||
$res['STSEndpoint'] = $this->STSEndpoint;
|
||||
}
|
||||
if (null !== $this->externalId) {
|
||||
$res['externalId'] = $this->externalId;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return Config
|
||||
*/
|
||||
public static function fromMap($map = [])
|
||||
{
|
||||
$model = new self();
|
||||
if (isset($map['accessKeyId'])) {
|
||||
$model->accessKeyId = $map['accessKeyId'];
|
||||
}
|
||||
if (isset($map['accessKeySecret'])) {
|
||||
$model->accessKeySecret = $map['accessKeySecret'];
|
||||
}
|
||||
if (isset($map['securityToken'])) {
|
||||
$model->securityToken = $map['securityToken'];
|
||||
}
|
||||
if (isset($map['bearerToken'])) {
|
||||
$model->bearerToken = $map['bearerToken'];
|
||||
}
|
||||
if (isset($map['durationSeconds'])) {
|
||||
$model->durationSeconds = $map['durationSeconds'];
|
||||
}
|
||||
if (isset($map['roleArn'])) {
|
||||
$model->roleArn = $map['roleArn'];
|
||||
}
|
||||
if (isset($map['policy'])) {
|
||||
$model->policy = $map['policy'];
|
||||
}
|
||||
if (isset($map['roleSessionExpiration'])) {
|
||||
$model->roleSessionExpiration = $map['roleSessionExpiration'];
|
||||
}
|
||||
if (isset($map['roleSessionName'])) {
|
||||
$model->roleSessionName = $map['roleSessionName'];
|
||||
}
|
||||
if (isset($map['publicKeyId'])) {
|
||||
$model->publicKeyId = $map['publicKeyId'];
|
||||
}
|
||||
if (isset($map['privateKeyFile'])) {
|
||||
$model->privateKeyFile = $map['privateKeyFile'];
|
||||
}
|
||||
if (isset($map['roleName'])) {
|
||||
$model->roleName = $map['roleName'];
|
||||
}
|
||||
if (isset($map['credentialsURI'])) {
|
||||
$model->credentialsURI = $map['credentialsURI'];
|
||||
}
|
||||
if (isset($map['type'])) {
|
||||
$model->type = $map['type'];
|
||||
}
|
||||
if (isset($map['STSEndpoint'])) {
|
||||
$model->STSEndpoint = $map['STSEndpoint'];
|
||||
}
|
||||
if (isset($map['externalId'])) {
|
||||
$model->externalId = $map['externalId'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description credential type
|
||||
* @example access_key
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'default';
|
||||
|
||||
public $accessKeyId = "";
|
||||
/**
|
||||
* @description accesskey id
|
||||
* @var string
|
||||
*/
|
||||
public $accessKeyId;
|
||||
|
||||
public $accessKeySecret = "";
|
||||
/**
|
||||
* @description accesskey secret
|
||||
* @var string
|
||||
*/
|
||||
public $accessKeySecret;
|
||||
|
||||
public $securityToken = "";
|
||||
/**
|
||||
* @description security token
|
||||
* @var string
|
||||
*/
|
||||
public $securityToken;
|
||||
|
||||
public $bearerToken = "";
|
||||
/**
|
||||
* @description bearer token
|
||||
* @var string
|
||||
*/
|
||||
public $bearerToken;
|
||||
|
||||
public $roleName = "";
|
||||
/**
|
||||
* @description role name
|
||||
* @var string
|
||||
*/
|
||||
public $roleName;
|
||||
|
||||
public $roleArn = "";
|
||||
/**
|
||||
* @description role arn
|
||||
* @var string
|
||||
*/
|
||||
public $roleArn;
|
||||
|
||||
public $roleSessionName = "";
|
||||
/**
|
||||
* @description oidc provider arn
|
||||
* @var string
|
||||
*/
|
||||
public $oidcProviderArn;
|
||||
|
||||
public $host = "";
|
||||
/**
|
||||
* @description oidc token file path
|
||||
* @var string
|
||||
*/
|
||||
public $oidcTokenFilePath;
|
||||
|
||||
public $publicKeyId = "";
|
||||
/**
|
||||
* @description role session expiration
|
||||
* @example 3600
|
||||
* @var int
|
||||
*/
|
||||
public $roleSessionExpiration;
|
||||
|
||||
public $privateKeyFile = "";
|
||||
/**
|
||||
* @description role session name
|
||||
* @var string
|
||||
*/
|
||||
public $roleSessionName;
|
||||
|
||||
public $readTimeout = 0;
|
||||
/**
|
||||
* @description role arn policy
|
||||
* @var string
|
||||
*/
|
||||
public $policy;
|
||||
|
||||
public $connectTimeout = 0;
|
||||
/**
|
||||
* @description external id for ram role arn
|
||||
* @var string
|
||||
*/
|
||||
public $externalId;
|
||||
|
||||
/**
|
||||
* @description sts endpoint
|
||||
* @var string
|
||||
*/
|
||||
public $STSEndpoint;
|
||||
|
||||
public $publicKeyId;
|
||||
|
||||
public $privateKeyFile;
|
||||
|
||||
/**
|
||||
* @description read timeout
|
||||
* @var int
|
||||
*/
|
||||
public $readTimeout;
|
||||
|
||||
/**
|
||||
* @description connection timeout
|
||||
* @var int
|
||||
*/
|
||||
public $connectTimeout;
|
||||
|
||||
/**
|
||||
* @description disable IMDS v1
|
||||
* @var bool
|
||||
*/
|
||||
public $disableIMDSv1;
|
||||
|
||||
/**
|
||||
* @description credentials URI
|
||||
* @var string
|
||||
*/
|
||||
public $credentialsURI;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public $metadataTokenDuration;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public $durationSeconds;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public $host;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public $expiration;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public $certFile = "";
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public $certPassword = "";
|
||||
|
||||
public $proxy = "";
|
||||
|
||||
public $expiration = 0;
|
||||
|
||||
public function __construct($config)
|
||||
{
|
||||
foreach ($config as $k => $v) {
|
||||
$this->{$k} = $v;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public $proxy;
|
||||
}
|
||||
|
||||
143
Server/vendor/alibabacloud/credentials/src/Credential/CredentialModel.php
vendored
Normal file
143
Server/vendor/alibabacloud/credentials/src/Credential/CredentialModel.php
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
// This file is auto-generated, don't edit it. Thanks.
|
||||
namespace AlibabaCloud\Credentials\Credential;
|
||||
|
||||
use AlibabaCloud\Tea\Model;
|
||||
|
||||
class CredentialModel extends Model
|
||||
{
|
||||
public function validate()
|
||||
{
|
||||
}
|
||||
public function toMap()
|
||||
{
|
||||
$res = [];
|
||||
if (null !== $this->accessKeyId) {
|
||||
$res['accessKeyId'] = $this->accessKeyId;
|
||||
}
|
||||
if (null !== $this->accessKeySecret) {
|
||||
$res['accessKeySecret'] = $this->accessKeySecret;
|
||||
}
|
||||
if (null !== $this->securityToken) {
|
||||
$res['securityToken'] = $this->securityToken;
|
||||
}
|
||||
if (null !== $this->bearerToken) {
|
||||
$res['bearerToken'] = $this->bearerToken;
|
||||
}
|
||||
if (null !== $this->type) {
|
||||
$res['type'] = $this->type;
|
||||
}
|
||||
if (null !== $this->providerName) {
|
||||
$res['providerName'] = $this->providerName;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return CredentialModel
|
||||
*/
|
||||
public static function fromMap($map = [])
|
||||
{
|
||||
$model = new self();
|
||||
if (isset($map['accessKeyId'])) {
|
||||
$model->accessKeyId = $map['accessKeyId'];
|
||||
}
|
||||
if (isset($map['accessKeySecret'])) {
|
||||
$model->accessKeySecret = $map['accessKeySecret'];
|
||||
}
|
||||
if (isset($map['securityToken'])) {
|
||||
$model->securityToken = $map['securityToken'];
|
||||
}
|
||||
if (isset($map['bearerToken'])) {
|
||||
$model->bearerToken = $map['bearerToken'];
|
||||
}
|
||||
if (isset($map['type'])) {
|
||||
$model->type = $map['type'];
|
||||
}
|
||||
if(isset($map['providerName'])){
|
||||
$model->providerName = $map['providerName'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description accesskey id
|
||||
* @var string
|
||||
*/
|
||||
public $accessKeyId;
|
||||
|
||||
/**
|
||||
* @description accesskey secret
|
||||
* @var string
|
||||
*/
|
||||
public $accessKeySecret;
|
||||
|
||||
/**
|
||||
* @description security token
|
||||
* @var string
|
||||
*/
|
||||
public $securityToken;
|
||||
|
||||
/**
|
||||
* @description bearer token
|
||||
* @var string
|
||||
*/
|
||||
public $bearerToken;
|
||||
|
||||
/**
|
||||
* @description type
|
||||
* @example access_key
|
||||
* @var string
|
||||
*/
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @description provider name
|
||||
* @example cli_profile/static_ak
|
||||
* @var string
|
||||
*/
|
||||
public $providerName;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAccessKeyId()
|
||||
{
|
||||
return $this->accessKeyId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAccessKeySecret()
|
||||
{
|
||||
return $this->accessKeySecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSecurityToken()
|
||||
{
|
||||
return $this->securityToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getBearerToken()
|
||||
{
|
||||
return $this->bearerToken;
|
||||
}
|
||||
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function getProviderName()
|
||||
{
|
||||
return $this->providerName;
|
||||
}
|
||||
|
||||
}
|
||||
99
Server/vendor/alibabacloud/credentials/src/Credential/RefreshResult.php
vendored
Normal file
99
Server/vendor/alibabacloud/credentials/src/Credential/RefreshResult.php
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace AlibabaCloud\Credentials\Credential;
|
||||
|
||||
use AlibabaCloud\Credentials\Providers\Credentials;
|
||||
|
||||
use function PHPUnit\Framework\isNull;
|
||||
|
||||
class RefreshResult
|
||||
{
|
||||
|
||||
/**
|
||||
* RefreshResult constructor.
|
||||
* @param Credentials $params
|
||||
* @param int $staleTime
|
||||
* @param int $prefetchTime
|
||||
*/
|
||||
public function __construct($credentials = null, $staleTime = PHP_INT_MAX, $prefetchTime = PHP_INT_MAX)
|
||||
{
|
||||
$this->credentials = $credentials;
|
||||
$this->staleTime = $staleTime;
|
||||
$this->prefetchTime = $prefetchTime;
|
||||
}
|
||||
public function validate() {}
|
||||
public function toMap()
|
||||
{
|
||||
$res = [];
|
||||
if (null !== $this->staleTime) {
|
||||
$res['staleTime'] = $this->staleTime;
|
||||
}
|
||||
if (null !== $this->prefetchTime) {
|
||||
$res['prefetchTime'] = $this->prefetchTime;
|
||||
}
|
||||
if (null !== $this->credentials) {
|
||||
$res['credentials'] = $this->credentials;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param array $map
|
||||
* @return RefreshResult
|
||||
*/
|
||||
public static function fromMap($map = [])
|
||||
{
|
||||
$model = new self();
|
||||
if (isset($map['staleTime'])) {
|
||||
$model->staleTime = $map['staleTime'];
|
||||
}
|
||||
if (isset($map['prefetchTime'])) {
|
||||
$model->staleTime = $map['prefetchTime'];
|
||||
}
|
||||
if (isset($map['credentials'])) {
|
||||
$model->staleTime = $map['credentials'];
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
/**
|
||||
* @description staleTime
|
||||
* @var int
|
||||
*/
|
||||
public $staleTime;
|
||||
|
||||
/**
|
||||
* @description prefetchTime
|
||||
* @var int
|
||||
*/
|
||||
public $prefetchTime;
|
||||
|
||||
/**
|
||||
* @description credentials
|
||||
* @var Credentials
|
||||
*/
|
||||
public $credentials;
|
||||
|
||||
|
||||
/**
|
||||
* @return Credentials
|
||||
*/
|
||||
public function credentials()
|
||||
{
|
||||
return $this->credentials;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public function staleTime()
|
||||
{
|
||||
return $this->staleTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public function prefetchTime()
|
||||
{
|
||||
return $this->prefetchTime;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user