Allow passing in AWS credentials instead of only using environment variables #1766
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
Yes, the current implementation of the library only allows for AWS credentials to be passed via environment variables or metadata endpoint. This can be limiting in scenarios where the user wants to pass credentials dynamically or when they want to use different credentials for different services.
Describe the solution you'd like
I would like the library to be updated to allow AWS credentials to be passed in as parameters to the relevant functions or methods. This would provide more flexibility and control to the user over which credentials to use.
Describe alternatives you've considered
An alternative could be to allow the user to set the credentials in a configuration file that the library can read from. However, this might not be as flexible as passing the credentials directly to the functions or methods.
Additional context
This feature would be particularly useful in multi-account AWS setups, where different services might be running under different accounts. Being able to specify the credentials at the function or method level would make it easier to manage such setups.
Here's a rough idea of what I'm suggesting:
google-auth-library-nodejs/src/auth/awsclient.ts
Lines 90 to 108 in 6a6e496
and the
retrieveSubjectToken()
functionhttps://github.com/googleapis/google-auth-library-nodejs/blob/6a6e49634863f61487688724d0d20632e03f0299/src/auth/awsclient.ts#L164-#L169
The text was updated successfully, but these errors were encountered: