Skip to content

Commit

Permalink
fix(service): use service signatureVersion as default
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Nov 25, 2022
1 parent 282e61d commit f1fd3e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/region_config.js
Expand Up @@ -63,7 +63,9 @@ function configureEndpoint(service) {
}

// signature version
if (!config.signatureVersion) config.signatureVersion = 'v4';
if (!config.signatureVersion) {
config.signatureVersion = service.signatureVersion || 'v4';
}

// merge config
applyConfig(service, config);
Expand Down
4 changes: 4 additions & 0 deletions lib/service.js
Expand Up @@ -70,6 +70,10 @@ AWS.Service = inherit({

this.validateService();
if (!this.config.endpoint) regionConfig.configureEndpoint(this);
if (this.api.signatureVersion === 'bearer') {
// bearer from API declaration may not be overridden by config.
this.config.signatureVersion = 'bearer';
}

this.config.endpoint = this.endpointFromTemplate(this.config.endpoint);
this.setEndpoint(this.config.endpoint);
Expand Down

0 comments on commit f1fd3e9

Please sign in to comment.