-
Notifications
You must be signed in to change notification settings - Fork 98
fix(NODE-5053): enforce empty map for kmsProvider auto credentials #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
); | ||
} | ||
|
||
let awsCredentialProviders = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, it is so nice that this package does dependency injection for the driver package – It might even be worth adapting that to this dependency as well … :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come you think this is a beneficial pattern? The DI for the driver is something I've wanted to remove for a while
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, from a very practical point, it’s just a necessity in cases where the driver is bundled into something but this package isn’t (which would be common in bundling scenarios given that this package is a native addon package).
But also just philosophically (and I’m pretty sure you already know this), I think DI is a great design pattern that solves more issues than it creates 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, this thought is not directly related to the changes in this PR and should absolutely not block it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider this though, using it for testing too could be 🔥
For GCP we don't plan to use an SDK (and likely not for azure either) so this would only be for AWS but still, valid use case even for one dep.
Description
What is changing?
We strictly check for an existing object but with zero keys for a kmsProviders credentials before attempting auto fetching.
Is there new documentation needed for these changes?
Yes, this could be surprising to existing AWS users that were able to leave kmsProviders empty. They need to provide an 'aws' key set to
{}
What is the motivation for this change?
The kmsProviders settings needs to have a key that exists but is set to an empty object in order to enable auto obtaining credentials. Otherwise future credential providers will both be obtained without actually requesting it.
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript