Skip to content

init idpt #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!--
Thank you for reporting an issue.

This issue tracker is for bugs and issues found within Alibaba Cloud SDK for PHP.
This issue tracker is for bugs and issues for PHP.
If you require more general support please file an issue on our help
repo. https://help.aliyun.com/
repo.


Please fill in as much of the template below as you're able.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2-feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ about: Suggest an idea for this project
---

<!--
Thank you for suggesting an idea to make Alibaba Cloud SDK better.
Thank you for suggesting an idea.

Please fill in as much of the template below as you're able.
-->
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/3-help.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: "⁉️ Need help with Alibaba Cloud?"
name: "⁉️ Need help?"
about: Please submit a work order in our work order system

---

If you have a question about Alibaba Cloud that is not a bug report or feature
request, please post it in https://selfservice.console.aliyun.com/ticket/createIndex
request, please post it

Questions posted to this repository will be closed.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/6-help-cn.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: "⁉️ 需要阿里云的帮助?"
name: "⁉️ 需要帮助?"
about: 请在我们的工单系统提出工单

---

如果您对阿里云 SDK 的问题不是 Bug 或希望添加新功能,
请在我们的工单系统提出工单:https://selfservice.console.aliyun.com/ticket/createIndex
请在我们的工单系统提出工单

此类问题将被关闭。
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/aliyun/credentials-php/blob/master/CONTRIBUTING.md
-->

##### You need to complete
Expand Down
20 changes: 4 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
{
"name": "alibabacloud/credentials",
"homepage": "https://www.alibabacloud.com/",
"description": "Alibaba Cloud Credentials for PHP",
"name": "{{ipdt}}/credentials",
"keywords": [
"sdk",
"tool",
"cloud",
"client",
"aliyun",
"library",
"alibaba",
"Credentials",
"alibabacloud"
"credentials"
],
"type": "library",
"license": "Apache-2.0",
"support": {
"source": "https://github.com/aliyun/credentials-php",
"issues": "https://github.com/aliyun/credentials-php/issues"
"source": "https://github.com/{{ipdt}}/credentials-php",
"issues": "https://github.com/{{ipdt}}/credentials-php/issues"
},
"authors": [
{
"name": "Alibaba Cloud SDK",
"email": "sdk-team@alibabacloud.com",
"homepage": "http://www.alibabacloud.com"
}
],
"require": {
"php": ">=5.6",
"ext-curl": "*",
Expand Down
86 changes: 0 additions & 86 deletions src/AccessKeyCredential.php

This file was deleted.

17 changes: 17 additions & 0 deletions src/Configure/Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace AlibabaCloud\Configure;

class Config
{
const ENV_PREFIX = "ALIBABA_CLOUD_";
const KEY = "AlibabaCloud";
const STS_DEFAULT_ENDPOINT = "sts.aliyuncs.com";
const ENDPOINT_SUFFIX = "aliyuncs.com";
const CREDENTIAL_FILE_PATH = ".alibabacloud";
const CLI_CONFIG_DIR = ".aliyun";
const ECS_METADATA_HOST = "100.100.100.200";
const ECS_METADATA_HEADER_PREFIX = "X-aliyun-";
const SIGN_PREFIX = "aliyun_v4"; // cloud_v4
const SIGNATURE_TYPE_PREFIX = "ACS4-";// CLOUD4-
}
76 changes: 5 additions & 71 deletions src/Credential.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@
use InvalidArgumentException;
use RuntimeException;

/**
* Class Credential
*
* @package AlibabaCloud\Credentials
*
*/
class Credential
{

/**
* Version of the Client
*/
const VERSION = '1.1.5';
const VERSION = '1.0.0';

/**
* @var Config
Expand Down Expand Up @@ -124,7 +118,7 @@ private function getCredentials($config)
'policy' => $config->policy,
'durationSeconds' => $config->roleSessionExpiration,
'externalId' => $config->externalId,
'stsEndpoint' => $config->STSEndpoint,
'stsEndpoint' => $config->stsEndpoint,
], [
'connectTimeout' => $config->connectTimeout,
'readTimeout' => $config->readTimeout,
Expand All @@ -135,7 +129,7 @@ private function getCredentials($config)
'publicKeyId' => $config->publicKeyId,
'privateKeyFile' => $config->privateKeyFile,
'durationSeconds' => $config->roleSessionExpiration,
'stsEndpoint' => $config->STSEndpoint,
'stsEndpoint' => $config->stsEndpoint,
], [
'connectTimeout' => $config->connectTimeout,
'readTimeout' => $config->readTimeout,
Expand All @@ -158,15 +152,15 @@ private function getCredentials($config)
'roleSessionName' => $config->roleSessionName,
'policy' => $config->policy,
'durationSeconds' => $config->roleSessionExpiration,
'stsEndpoint' => $config->STSEndpoint,
'stsEndpoint' => $config->stsEndpoint,
], [
'connectTimeout' => $config->connectTimeout,
'readTimeout' => $config->readTimeout,
]);
return new CredentialsProviderWrap('oidc_role_arn', $provider);
case "credentials_uri":
$provider = new URLCredentialsProvider([
'credentialsURI' => $config->credentialsURI,
'credentialsURI' => $config->credentialsUri,
], [
'connectTimeout' => $config->connectTimeout,
'readTimeout' => $config->readTimeout,
Expand Down Expand Up @@ -195,66 +189,6 @@ public function getConfig()
return $this->config->toMap();
}

/**
* @deprecated use getCredential() instead
*
* @return string
* @throws RuntimeException
* @throws GuzzleException
*/
public function getType()
{
return $this->credential->getCredential()->getType();
}

/**
* @deprecated use getCredential() instead
*
* @return string
* @throws RuntimeException
* @throws GuzzleException
*/
public function getAccessKeyId()
{
return $this->credential->getCredential()->getAccessKeyId();
}

/**
* @deprecated use getCredential() instead
*
* @return string
* @throws RuntimeException
* @throws GuzzleException
*/
public function getAccessKeySecret()
{
return $this->credential->getCredential()->getAccessKeySecret();
}

/**
* @deprecated use getCredential() instead
*
* @return string
* @throws RuntimeException
* @throws GuzzleException
*/
public function getSecurityToken()
{
return $this->credential->getCredential()->getSecurityToken();
}

/**
* @deprecated use getCredential() instead
*
* @return string
* @throws RuntimeException
* @throws GuzzleException
*/
public function getBearerToken()
{
return $this->credential->getCredential()->getBearerToken();
}

/**
* @param string $name
* @param array $arguments
Expand Down
Loading
Loading