-
Notifications
You must be signed in to change notification settings - Fork 464
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
Support Asynchronous Signing in IJwtAlgorithm interface #468
Comments
Hi @AliKhalili, thanks for reaching out and proposing an improve to the library! Overall I don't mind and welcome it. Just needs some discussion first. I see two options:
Pros:
Cons:
Pros:
Cons:
What would be your take? |
Hi @abatishchev, Thank you for your response. I appreciate your openness to discussing this matter further. While it is true that the majority of scenarios may be synchronous, it is becoming increasingly common for developers to expect asynchronous interfaces, especially in scenarios where cloud services(Cloud key management, Cloud HSM) are involved. On the other hand, as you mentioned, the majority of the consumers are not expected to use the asynchronous methods, so it does not make sense to update the interface to make all methods asynchronous(in some cases it would be nearly impossible to change a legacy code base to be async and works without any problem). Therefore, I would recommend providing both synchronous and asynchronous versions of each method. This allows consumers to choose which version they want to use based on their needs. |
Hi @AliKhalili, |
Certainly, I hope you are feeling well. |
Hello Everyone. Would just like to add that I would love to see |
Currently, the
IJwtAlgorithm
interface does not support asynchronous signing, but the AWS KMS Client has implemented the Sign method in an async manner. As a result, when implementing a custom signing algorithm that uses the KMS Client as the underlying method for actual signing, the current solution involves blocking the calling thread using theGetResult()
method. This approach may lead to resource starvation and deadlock if the workload is high.To enable non-blocking signing using AWS KMS Client, we need to add support for asynchronous signing in the
IJwtAlgorithm
interface.any thoughts or comments, please?
The text was updated successfully, but these errors were encountered: