-
Notifications
You must be signed in to change notification settings - Fork 48
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
Multiple options for configuring RavenDB client certificate #4767
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The things mentioned are just suggestions
src/ServiceControl.Audit.Persistence.RavenDB/ServerConfiguration.cs
Outdated
Show resolved
Hide resolved
public class ServerConfiguration | ||
using ServiceControl.RavenDB; | ||
|
||
public class ServerConfiguration : IRavenClientCertificateInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't hesitate to ignore. I do not find the interface is particularly helpful. We could also just have a record/class encapsulating these settings that is then passed to the reader code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was lazy and didn't want to do extra mapping.
{ | ||
try | ||
{ | ||
var bytes = Convert.FromBase64String(certInfo.ClientCertificateBase64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it is probably better to throw when the values are not valid instead of falling back to reading the other variables
71725b3
to
d7dd734
Compare
Adds the following configuration options as environment variables for connecting to external RavenDB instances, generally for use when deployed as a container:
RAVENDB_CLIENTCERTIFICATEPATH
: Provide a path to the client certificate, for example, to a path loaded in a mounted secrets volume.RAVENDB_CLIENTCERTIFICATEBASE64
: Provide the client certificate as a Base64-encoded string.RAVENDB_CLIENTCERTIFICATEPASSWORD
: If using a password-protected *.pfx certificate, supply the password to read it. If using a non-protected certificate, do not include this option.If the certificate path or Base64 options are not used, the app will still look for a certificate in a static path in the application root. When deployed as a container, this path is
/app/raven-client-certificate.pfx
.