File tree Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -20,25 +20,12 @@ class OpenApiClient {
20
20
} ) ;
21
21
}
22
22
else {
23
- const credentialsURI = process . env . ALIBABA_CLOUD_CREDENTIALS_URI ;
24
23
// 参考 https://help.aliyun.com/zh/sdk/developer-reference/v2-manage-node-js-access-credentials
25
- if ( credentialsURI ) {
26
- // 方式一 使用 url 获取凭证
27
- const credentialClient = new Credential . default ( {
28
- type : 'credentials_uri' ,
29
- credentialsURI,
30
- } ) ;
31
- apiConfig = new OpenApi . Config ( ) ;
32
- // 使用Credentials配置凭证。
33
- apiConfig . credential = credentialClient ;
34
- }
35
- else {
36
- // 方式二 使用默认凭证初始化Credentials Client
37
- const credentialClient = new Credential . default ( ) ;
38
- apiConfig = new OpenApi . Config ( ) ;
39
- // 使用Credentials配置凭证。
40
- apiConfig . credential = credentialClient ;
41
- }
24
+ // 使用默认凭证初始化Credentials Client,
25
+ const credentialClient = new Credential . default ( ) ;
26
+ apiConfig = new OpenApi . Config ( ) ;
27
+ // 使用Credentials配置凭证。@alicloud/credentials 2.4.2 已支持 credentialsURI
28
+ apiConfig . credential = credentialClient ;
42
29
}
43
30
// Endpoint 请参考 https://api.aliyun.com/product/dataworks-public https://api.aliyun.com/product/CloudAPI
44
31
apiConfig . endpoint = `dataworks.${ regionId ? `${ regionId } .` : '' } aliyuncs.com` ;
You can’t perform that action at this time.
0 commit comments