This PR proposes the addition of a new public method, createHandler. The main use-case for this is to allow the user to inject their own configuration without having to rely on environment variables.
In my particular case, I am storing my secrets in AWS Parameter Store as SecretStrings, as I prefer to not to have to manually do KMS encryption and maintain (and pay for) yet another KMS key, and I don't want to keep my webhook url unencrypted as I'm using this in an open source project where anyone can see the build logs.
I considered writing to process.env['UNENCRYPTED_HOOK_URL'] after looking up the decrypted value, but since config.js is imported immediately, the value will have already been read from the environment before I can look it up.
Note
Since this project doesn't have a test suite, I'm not 100% sure that my code actually works. I haven't had a chance to manually test it yet, as it requires quite a lot of setup. If this PR would be considered to be merged, it will first have to actually be tested.
This PR proposes the addition of a new public method,
createHandler
. The main use-case for this is to allow the user to inject their own configuration without having to rely on environment variables.In my particular case, I am storing my secrets in AWS Parameter Store as SecretStrings, as I prefer to not to have to manually do KMS encryption and maintain (and pay for) yet another KMS key, and I don't want to keep my webhook url unencrypted as I'm using this in an open source project where anyone can see the build logs.
Example would be something like this for my case:
Considered alternatives
I considered writing to
process.env['UNENCRYPTED_HOOK_URL']
after looking up the decrypted value, but sinceconfig.js
is imported immediately, the value will have already been read from the environment before I can look it up.Note
Since this project doesn't have a test suite, I'm not 100% sure that my code actually works. I haven't had a chance to manually test it yet, as it requires quite a lot of setup. If this PR would be considered to be merged, it will first have to actually be tested.