Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

Keep credential provider chain#38

Open
MerlinDMC wants to merge 1 commit into
auth0:masterfrom
tes:keep-default-credential-provider-chain
Open

Keep credential provider chain#38
MerlinDMC wants to merge 1 commit into
auth0:masterfrom
tes:keep-default-credential-provider-chain

Conversation

@MerlinDMC

Copy link
Copy Markdown

This PR will change the way the increased timeout for the AWS.EC2MetadataCredentials is set.

Currently this library is hard overriding anything that might have been set as the credentials source by the surrounding application and/or environment.
It makes it impossible to provide credentials via a configuration file in ~/.aws or environment variables not only for the kinesis stream writer but for the whole application using the KinesisStream class.

This behaviour was introduced by removing the configuration gate params.getCredentialsFromIAMRole here

A minimal demo for the problem using environment variables:

const assert = require('assert');

process.env.AWS_ACCESS_KEY_ID = 'dummy';
process.env.AWS_SECRET_ACCESS_KEY = 'invalid';

const AWS = require('aws-sdk');

assert(AWS.config.credentials instanceof AWS.EnvironmentCredentials,
  'Unexpected provider before KinesisWritable');

const KinesisWritable = require('aws-kinesis-writable');
new KinesisWritable({ streamName: 'invalid' });

assert(AWS.config.credentials instanceof AWS.EnvironmentCredentials,
  'Unexpected provider after KinesisWritable');

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant