Skip to content

Commit

Permalink
Support to fast pass in bearerToken
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian authored and yndu13 committed Jun 19, 2024
1 parent 2fc1b2d commit 82d3b19
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.tea
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ model Config {
accessKeyId?: string(description='accesskey id',default=''),
accessKeySecret?: string(description='accesskey secret',default=''),
securityToken?: string(description='security token',example='a.txt',default=''),
bearerToken?: string(description='bearer token',example='the-bearer-token',default=''),
protocol?: string(description='http protocol',example='http',default='http'),
method?: string(description='http method',example='GET',default=''),
regionId?: string(description='region id',example='cn-hangzhou',default=''),
Expand Down Expand Up @@ -103,6 +104,12 @@ init(config: Config) {
};
credentialConfig.securityToken = config.securityToken;
@credential = new Credential(credentialConfig);
} else if (!Util.empty(config.bearerToken)) {
var cc = new Credential.Config{
type = 'bearer',
bearerToken = config.bearerToken
};
@credential = new Credential(cc);
} else if(!Util.isUnset(config.credential)) {
@credential = config.credential;
}
Expand Down

0 comments on commit 82d3b19

Please sign in to comment.