No commit activity in last 3 years
No release in over 3 years
An OSX keychain adapter for Econfig.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
>= 0

Runtime

~> 2.0
~> 1.0
 Project Readme

Econfig::Keychain

An OSX keychain adapter for Econfig, using Mellon.

Usage with Rails

For OSX, during development only.

First, add econfig-keychain to your Gemfile:

gem "econfig", require: "econfig/rails"
gem "econfig-keychain"

Second, create a keychain you wish to store configuration in, name it something clever like thanks-a-latte. Within config/application.rb write the following:

module MyApp
  extend Econfig::Shortcut

  if Rails.env.development?
    Econfig.backends.use :keychain, Econfig::Keychain.new("thanks-a-latte")
  end

  class Application < Rails::Application
    # … rest of the configuration
  end

That's it!

Econfig::Keychain will automatically create an empty secure note using the name of the directory your project is located at, in the thanks-a-latte keychain. If you wish to specify the name yourself, you can do so:

Econfig.backends.use :keychain, Econfig::Keychain.new("thanks-a-latte", name: "project name")

Changing configuration

Econfig::Keychain supports changing configuration by setting values, e.g. from the Rails console:

MyApp.config[:keychain, :aws_access_key_id] = "xyz"

You can also edit your configuration with your $EDITOR manually using the Mellon CLI:

bundle exec mellon edit myapp

Finally, you can also edit the keychain entry manually using Keychain Access.

License

MIT. See LICENSE.