-
-
Notifications
You must be signed in to change notification settings - Fork 250
Description
I'm needing to be able to use the cert/key and oauth options in Azurite (Yes, I know, life would be much simpler if I didn't have to 🤷 ).
It seems fairly straightforward to add the proper flags/options to the azurite module - it's testing it that seems difficult, since we likely want to make sure that we can call the thing with the expected certificates.
After doing some digging, I'm thinking that it could be done using the TlsSettings.ca property when constructing an Azure client, which will let us set up a self-signed CA and an associated cert that can we can use.
As for generating such a CA/cert for testing, after reviewing the various JS-native options, I'm pretty tempted to just generate the necessary keys/certs with an absurd expiration time (does 999,999 days - 2700+ years - seem long enough?) and embed them directly in the tests. It seems like this is the easiest way to go forward, since it means we won't have to count on a contributor having anything set up on their machine. Alternatively, the test-certs approach used in the kafka module could be easily adapted to generate what we need (really, just removing the keytool parts, since we just need what we can get with openssl).
I can likely have a PR up within a few days (depends on how hectic things get at work) that implements this, as long as we have an agreement on how to test it.