Skip to content

Commit

Permalink
Allow the service configuration credentials to be nulled (#1367)
Browse files Browse the repository at this point in the history
This enables the service to use a supplied credential provider chain and
to ignore those resolved by the global configuration.
  • Loading branch information
RLovelett authored and chrisradek committed Feb 21, 2017
1 parent 2ebc99b commit 8e15313
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-TypeScript-b03c57a6.json
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "TypeScript",
"description": "Enable the configuration credentials to be nulled so that the global config is not used."
}
2 changes: 1 addition & 1 deletion lib/config.d.ts
Expand Up @@ -171,7 +171,7 @@ export abstract class ConfigurationOptions {
/**
* The AWS credentials to sign requests with.
*/
credentials?: Credentials|CredentialsOptions
credentials?: Credentials|CredentialsOptions|null
/**
* The provider chain used to resolve credentials if no static credentials property is set.
*/
Expand Down
5 changes: 5 additions & 0 deletions ts/s3.ts
Expand Up @@ -5,6 +5,11 @@ import {Endpoint} from '../lib/endpoint';
// Instantiate S3 without options
var s3 = new S3();

// Instantiate S3 without using the global credentials
new S3({
credentials: null
});

// Instantiate S3 with config
var s3Config: S3.Types.ClientConfiguration = {
apiVersion: '2006-03-01',
Expand Down

0 comments on commit 8e15313

Please sign in to comment.