Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
yndu13 committed Oct 17, 2024
1 parent 42c0e44 commit a2579d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
14 changes: 7 additions & 7 deletions README-zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $credential->getSecurityToken();
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

// Access Key
$config = new Config([
Expand All @@ -83,7 +83,7 @@ $credential->getAccessKeySecret();
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'sts',
Expand All @@ -107,7 +107,7 @@ $credential->getSecurityToken();
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'ram_role_arn',
Expand Down Expand Up @@ -138,7 +138,7 @@ Credentials工具会自动获取ECS实例绑定的RAM角色,调用ECS的元数
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'ecs_ram_role',
Expand All @@ -161,7 +161,7 @@ $credential->getSecurityToken();
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'oidc_role_arn',
Expand Down Expand Up @@ -194,7 +194,7 @@ $credential->getSecurityToken();
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'credentials_uri',
Expand All @@ -215,7 +215,7 @@ $credential->getBearerToken();
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'bearer',
Expand Down
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Setup access_key credential through [User Information Management][ak], it have f
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

// Access Key
$config = new Config([
Expand All @@ -85,7 +85,7 @@ Create a temporary security credential by applying Temporary Security Credential
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'sts',
Expand All @@ -109,7 +109,7 @@ By specifying [RAM Role][RAM Role], the credential will be able to automatically
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'ram_role_arn',
Expand Down Expand Up @@ -140,7 +140,7 @@ The Credentials tool automatically obtains the RAM role attached to an ECS insta
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'ecs_ram_role',
Expand All @@ -163,7 +163,7 @@ After you attach a RAM role to a worker node in an Container Service for Kuberne
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'oidc_role_arn',
Expand Down Expand Up @@ -196,7 +196,7 @@ By specifying the url, the credential will be able to automatically request main
<?php

use AlibabaCloud\Credentials\Credential;
namespace AlibabaCloud\Credentials\Credential\Config;
use AlibabaCloud\Credentials\Credential\Config;

$config = new Config([
'type' => 'credentials_uri',
Expand All @@ -217,12 +217,16 @@ If credential is required by the Cloud Call Centre (CCC), please apply for Beare
<?php

use AlibabaCloud\Credentials\Credential;
use AlibabaCloud\Credentials\Credential\Config;

$bearerToken = new Credential([
'type' => 'bearer',
'bearer_token' => '<bearer_token>',
$config = new Config([
'type' => 'bearer',
'bearerToken' => '<bearer_token>',
]);
$bearerToken->getBearerToken();
$client = new Credential($config);

$credential = $client->getCredential();
$credential->getBearerToken();
```

## Default credential provider chain
Expand Down

0 comments on commit a2579d9

Please sign in to comment.