Skip to content

Commit cd71960

Browse files
night556JacksonTian
authored andcommitted
Update the readme of the external program
1 parent 3d3cad9 commit cd71960

File tree

2 files changed

+132
-0
lines changed

2 files changed

+132
-0
lines changed

README-CN.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,72 @@ Saving profile[akProfile] ...Done.
8989
| RamRoleArn | 使用RAM子账号的AssumeRole方式访问 |
9090
| EcsRamRole | 在ECS实例上通过EcsRamRole实现免密验证 |
9191

92+
### 使用外部程序获取凭证
93+
94+
您可以使用 `--mode External` 指定通过外部程序获取凭证数据,CLI将会以执行该程序命令并其返回作为凭证来发起调用。
95+
96+
约定:
97+
1. 外部程序输出位置为标准输出
98+
2. 输出为json结构字符串
99+
3. 输出包含关键字段以及凭证字段
100+
101+
关键字段:
102+
- mode: 指定返回凭证类型
103+
104+
各凭证返回结构示例:
105+
- AK
106+
107+
```json
108+
{
109+
"mode": "AK",
110+
"access_key_id": "accessKeyId",
111+
"access_key_secret": "accessKeySecret"
112+
}
113+
```
114+
115+
- StsToken
116+
117+
```json
118+
{
119+
"mode": "StsToken",
120+
"access_key_id": "accessKeyId",
121+
"access_key_secret": "accessKeySecret",
122+
"sts_token": "stsToken"
123+
}
124+
```
125+
126+
- RamRoleArn
127+
128+
```json
129+
{
130+
"mode": "RamRoleArn",
131+
"access_key_id": "accessKeyId",
132+
"access_key_secret": "accessKeySecret",
133+
"ram_role_arn": "ramRoleArn",
134+
"ram_session_name": "ramSessionName"
135+
}
136+
```
137+
138+
- EcsRamRole
139+
140+
```json
141+
{
142+
"mode": "EcsRamRole",
143+
"ram_role_name": "ramRoleName"
144+
}
145+
```
146+
147+
#### Example:
148+
```shell
149+
$ aliyun configure --mode External --profile externalTest
150+
Configuring profile 'externalTest' in 'External' authenticate mode...
151+
Process Command []: <getCredential ak>
152+
Default Region Id []: cn-hangzhou
153+
Default Output Format [json]: json (Only support json)
154+
Default Language [zh|en] en:
155+
Saving profile[externalTest] ...Done.
156+
```
157+
92158
### 启用zsh/bash自动补全
93159

94160
- 使用`aliyun auto-completion`命令开启自动补全,目前支持zsh/bash

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,72 @@ The following are supported authentication methods:
8787
| RamRoleArn | Use the AssumeRole to access Alibaba Cloud services |
8888
| EcsRamRole | Use the EcsRamRole to access ECS resources |
8989

90+
### Use an external program to get credentials
91+
92+
You can use `--mode External` to specify to obtain credential data through an external program, and CLI will execute the program command and return it as a credential to initiate the call.
93+
94+
Agreement:
95+
1. The output location of the external program is standard output.
96+
2. The output format is json string.
97+
3. The output contains the key fields required by the CLI and credential fields
98+
99+
Key field:
100+
- mode: Specify the type of credentials returned
101+
102+
Example of the return of each credential type:
103+
- AK
104+
105+
```json
106+
{
107+
"mode": "AK",
108+
"access_key_id": "accessKeyId",
109+
"access_key_secret": "accessKeySecret"
110+
}
111+
```
112+
113+
- StsToken
114+
115+
```json
116+
{
117+
"mode": "StsToken",
118+
"access_key_id": "accessKeyId",
119+
"access_key_secret": "accessKeySecret",
120+
"sts_token": "stsToken"
121+
}
122+
```
123+
124+
- RamRoleArn
125+
126+
```json
127+
{
128+
"mode": "RamRoleArn",
129+
"access_key_id": "accessKeyId",
130+
"access_key_secret": "accessKeySecret",
131+
"ram_role_arn": "ramRoleArn",
132+
"ram_session_name": "ramSessionName"
133+
}
134+
```
135+
136+
- EcsRamRole
137+
138+
```json
139+
{
140+
"mode": "EcsRamRole",
141+
"ram_role_name": "ramRoleName"
142+
}
143+
```
144+
145+
#### Example:
146+
```shell
147+
$ aliyun configure --mode External --profile externalTest
148+
Configuring profile 'externalTest' in 'External' authenticate mode...
149+
Process Command []: <getCredential ak>
150+
Default Region Id []: cn-hangzhou
151+
Default Output Format [json]: json (Only support json)
152+
Default Language [zh|en] en:
153+
Saving profile[externalTest] ...Done.
154+
```
155+
90156
### Enable bash/zsh auto completion
91157

92158
- Use `aliyun auto-completion` command to enable auto completion in zsh/bash

0 commit comments

Comments
 (0)