Skip to content

Commit 8e15313

Browse files
RLovelettchrisradek
authored andcommitted
Allow the service configuration credentials to be nulled (#1367)
This enables the service to use a supplied credential provider chain and to ignore those resolved by the global configuration.
1 parent 2ebc99b commit 8e15313

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "bugfix",
3+
"category": "TypeScript",
4+
"description": "Enable the configuration credentials to be nulled so that the global config is not used."
5+
}

lib/config.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export abstract class ConfigurationOptions {
171171
/**
172172
* The AWS credentials to sign requests with.
173173
*/
174-
credentials?: Credentials|CredentialsOptions
174+
credentials?: Credentials|CredentialsOptions|null
175175
/**
176176
* The provider chain used to resolve credentials if no static credentials property is set.
177177
*/

ts/s3.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import {Endpoint} from '../lib/endpoint';
55
// Instantiate S3 without options
66
var s3 = new S3();
77

8+
// Instantiate S3 without using the global credentials
9+
new S3({
10+
credentials: null
11+
});
12+
813
// Instantiate S3 with config
914
var s3Config: S3.Types.ClientConfiguration = {
1015
apiVersion: '2006-03-01',

0 commit comments

Comments
 (0)