-
Notifications
You must be signed in to change notification settings - Fork 24
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
Authenticator returns Promise<void | Error>
#176
Comments
@CarstenLeue Thanks for this issue. You're right and it is not intended for an error to sent over a Promise's data channel. That will not happen and the incorrect type was an oversight. We will correct this but as it stands, it will be a breaking change and therefore will require a new major release. This interface is in place to allow users to write their own, custom authenticator implementations. If we change the interface, their authenticators will no longer be compatible with our code. I believe your issue #174 will also require a major release to resolve so for now I'll plan on doing them together at some point (hopefully, in the near future). |
The interface incorrectly defined the data channel as "void or Error" when it should only be "void", as Errors are sent in a different channel. This updates the type to be correct. It does not constitute a breaking update as we already defined authenticators with the new type in this project. Resolves #176 Signed-off-by: Dustin Popp <dpopp07@gmail.com>
🎉 This issue has been resolved in version 3.0.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
The authenticator interface has the following syntax:
https://github.com/IBM/node-sdk-core/blob/main/auth/authenticators/authenticator.ts
Normally a Promise handles errors via its exception channel and regular values via its data channel. The type parameter identifies the data channel, promises do not have a way to specify the type of the exceptional channel.
Is it indeed intended to pass an error on the data channel? If so, why?
If not, the signature should be:
The text was updated successfully, but these errors were encountered: