-
Notifications
You must be signed in to change notification settings - Fork 151
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
Ability to create connection with string credentials instead of from a file #882
Comments
@schoetbi I can't do this because of the language level of the project. Any chance you have a greenfield project? If so I would suggest using the .NET v2.
WDYT? |
@scottf Yes, I can use .NET v2 for my project. The main priority is that I want to avoid writing the credentials to disk. The use of SecureString is optional. So your suggestion with passing the credentials as string (not filename) is fine. |
In general you should not use SecureString for new development, and even when available it does not adequately protect confidential information. https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-security-securestring |
@sixlettervariables Thanks for this interesting read. The use of SecureString might also be a little bit too much for my thread model. I only want to ensure that the credentials are not written to disk. So I will refrain from the use of SecureString. |
Adding regular string version of the api here: https://github.com/nats-io/nats.net/pull/885 |
Proposed change
The current implementation expects a file name for the credentials. This requires the file to be on disk, what makes it readable by others.
A workaround is the use of the handlers
Options.UserJWTEventHandler
andOptions.UserSignatureEventHandler
but this is not straightforward.I propose that the credentials are transported as a SecureString so that it can be read e.g. from the Windows Data Protection API or directly from a key vault like Azure key vault.
So this is the method signature:
Use case
I do not want to store the credentials unencrypted on disk
Contribution
No response
The text was updated successfully, but these errors were encountered: