in src/providers/cli_profile.ts [167:187]
async getCredentials(): Promise<Credentials> {
if (!this.innerProvider) {
if (!this.homedir) {
throw new Error('cannot found home dir');
}
const cfgPath = path.join(this.homedir, '.aliyun/config.json');
const conf = await getConfiguration(cfgPath);
const profileName = this.profileName || conf.current;
this.innerProvider = this.getCredentialsProvider(conf, profileName)
}
const credentials = await this.innerProvider.getCredentials()
return Credentials.builder()
.withAccessKeyId(credentials.accessKeyId)
.withAccessKeySecret(credentials.accessKeySecret)
.withSecurityToken(credentials.securityToken)
.withProviderName(`${this.getProviderName()}/${this.innerProvider.getProviderName()}`)
.build();
}