You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main issue is that the cloudfront-auth repo code is interactive only, doesn't support non-interactive CLI usage or loading all settings from a preconfigured file.
The tool we are using to build the CloudFront authentication lambda (https://github.com/Widen/cloudfront-auth) - Connect to preview only supports interactive mode. Even with a saved out configuration file, it continues to interactively prompt — it just uses the saved configuration for the prompt defaults. This does not lend itself to automation.
However, I was able to add a single line of code to enable command line-based automation for our use case. That's how this action is currently working -- it is patching in that line prior to run. But we're going to need something more robust/less hackish.
Options:
PR to Widen/cloudfront-auth ?
Fork Widen/cloudfront-auth ?
I noticed there's already a PR dated Mar 1 in Widen/cloudfront-auth to address our use case and more (Widen/cloudfront-auth#84). But it's much more than a one-line change. If that gets merged that will resolve our issues. Just not sure when that'll happen.
Rob has suggested either:
I suggest fork and apply the pull request(84), and then track and revert to main when fixed.
Also fine with leaving with your patch for now, if arkadiy reviews.
The text was updated successfully, but these errors were encountered:
- name: Patch cloudfront-auth to allow non-interative (CLI) use
run: |
cd ./deployment/cloudfront-auth
sed -i"" "s/^prompt.start/prompt.override=require('minimist')(process.argv.slice(2), opts={boolean:true, string:['method', 'AUTHZ']});prompt.start/" build/build.js
Sidenote: the above hack depends on minimist being available, which I'm not explicitly adding as a requirement to package.json (it is however a sub-dependency).
plaurent
changed the title
Robust needed for non-interactive cloudfront-auth
Robust fix needed for non-interactive cloudfront-auth
May 12, 2021
The main issue is that the cloudfront-auth repo code is interactive only, doesn't support non-interactive CLI usage or loading all settings from a preconfigured file.
The tool we are using to build the CloudFront authentication lambda (https://github.com/Widen/cloudfront-auth) - Connect to preview only supports interactive mode. Even with a saved out configuration file, it continues to interactively prompt — it just uses the saved configuration for the prompt defaults. This does not lend itself to automation.
However, I was able to add a single line of code to enable command line-based automation for our use case. That's how this action is currently working -- it is patching in that line prior to run. But we're going to need something more robust/less hackish.
Options:
I noticed there's already a PR dated Mar 1 in Widen/cloudfront-auth to address our use case and more (Widen/cloudfront-auth#84). But it's much more than a one-line change. If that gets merged that will resolve our issues. Just not sure when that'll happen.
Rob has suggested either:
The text was updated successfully, but these errors were encountered: