-
Notifications
You must be signed in to change notification settings - Fork 605
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
feat(credential-provider-node): throw cannot load credential error from credentail chain #2408
Conversation
80b333a
to
479c375
Compare
Codecov Report
@@ Coverage Diff @@
## main #2408 +/- ##
=======================================
Coverage ? 59.55%
=======================================
Files ? 493
Lines ? 26367
Branches ? 6264
=======================================
Hits ? 15703
Misses ? 10664
Partials ? 0 Continue to review full report at Codecov.
|
bc3fa35
to
e3f341c
Compare
Co-authored-by: Trivikram Kamat <[email protected]>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Resolves: #2137
Description
Previously when credential resolve chain fails to resolve the credentials, it throws the error message from the last credential provider. As a result, the error message from the credential provider chain is not helpful, when no credentials can be resolved. For example, users see
Error: TimeoutError
when no credentials can be resolved. This is because the last provider in the credential chain is the Instance Metadata Service, and it will timeout when running on local machine. Instead, we should indicate credential error in the message.With this change, if none of the provider can resolve to a valid credential, the Node.js credential provider chain will throw
CredentialsError: Could not load credentials from any providers
just like v2.The chain would also throw directly from any credential provider if the thrown error's
tryNextLink
flag is set to false. In this case users will know this is a credential error from the error nameCredentialsError: XXX is wrong
.Testing
Unit tests
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.