config icon indicating copy to clipboard operation
config copied to clipboard

feat: add rails credentials support

Open noxasch opened this issue 1 year ago • 21 comments

Added rails credentials support with config flag addressing #68

noxasch avatar Mar 08 '24 19:03 noxasch

I'm currently having trouble with different ruby version in the test, any clue ?

noxasch avatar Mar 14 '24 05:03 noxasch

Not 100% sure what's going on with the tests on CI. Tests pass for me locally. I suspect it has something to do with Rails 7.0 or 7.1 because we don't run tests for those Rails versions when running the test suite for Ruby 2.7, jruby, or truffleruby.

I merged in a change that address the deprecation warnings for fixture_path in Rails 7.1 to help clear up the test output. Hoping that will help clear things up 🤞

cjlarose avatar Mar 16 '24 07:03 cjlarose

Update:

Rebased to latest master

I look around and found the solution for rails 7.1 fail test. For Rails 7.1 and above it seems we need to use ActiveSupport::EncryptedConfiguration config method instead. But prior 7.1, Rails.credentials.to_h and Rails.secret.to_h will work just fine.

All test should pass now.

noxasch avatar Mar 16 '24 12:03 noxasch

Update:

  1. Addressed the changes and refactor the code.
  2. Update the crendentails to include the aws patter below to be more realistic
aws:
  secret_access_key: '123456'

Apparently we don't need to check for rails version, just need to require the master_key in test environment and for rails5.2 untiil 6.1 need test.key and master.key, otherwise it somehow ignore the RAILS_MASTER_KEY in environment variable

noxasch avatar Mar 17 '24 14:03 noxasch

@cjlarose let me know if there is anything else require.

noxasch avatar Apr 23 '24 07:04 noxasch

@cjlarose @noxasch can we please get this merged? Thanks!

nickpoorman avatar Sep 06 '24 22:09 nickpoorman

@cjlarose since you reviewed in the past, would you mind doing a re-review? Seems that all your feedback was addressed?

@noxasch would you mind adding a CHANGELOG entry?

pkuczynski avatar Sep 17 '24 20:09 pkuczynski