https://github.com/varvet/econfig-keychain
An OSX keychain adapter for Econfig.
https://github.com/varvet/econfig-keychain
Last synced: about 2 months ago
JSON representation
An OSX keychain adapter for Econfig.
- Host: GitHub
- URL: https://github.com/varvet/econfig-keychain
- Owner: varvet
- License: mit
- Created: 2014-04-09T14:54:52.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-23T13:32:26.000Z (over 10 years ago)
- Last Synced: 2025-07-27T15:06:59.731Z (2 months ago)
- Language: Ruby
- Size: 191 KB
- Stars: 4
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Econfig::Keychain
An OSX keychain adapter for [Econfig](http://github.com/elabs/econfig), using [Mellon](https://github.com/elabs/mellon).
## Usage with Rails
For OSX, during development only.
First, add econfig-keychain to your Gemfile:
``` ruby
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:``` ruby
module MyApp
extend Econfig::Shortcutif Rails.env.development?
Econfig.backends.use :keychain, Econfig::Keychain.new("thanks-a-latte")
endclass 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:
``` ruby
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:
``` ruby
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.