Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bendyworks/idkfa
Simple credentials loading
https://github.com/bendyworks/idkfa
Last synced: 28 days ago
JSON representation
Simple credentials loading
- Host: GitHub
- URL: https://github.com/bendyworks/idkfa
- Owner: bendyworks
- Created: 2011-04-04T16:52:18.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-04-18T17:52:51.000Z (over 12 years ago)
- Last Synced: 2024-04-24T20:03:16.270Z (8 months ago)
- Language: Ruby
- Homepage: https://github.com/bendyworks/idkfa
- Size: 425 KB
- Stars: 4
- Watchers: 31
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.textile
Awesome Lists containing this project
README
h1. idkfa
Storing keys in your repository is A Bad Idea™. With @idkfa@, you can store them in a YAML file outside your repository yet include them easily.
Once installed and setup with @Idkfa.load_keys@, your sensitive information will be stored in upper-cased keys inside @ENV@.
Why "idkfa?" Haven't you played Doom?
h2. Default Configuration
To configure idkfa, you will need to add a @credentials.yml@ file to your project
Sample @config/credentials.yml@:
bc. common: &COMMON
domain_url: http://localhost:3000
my_secret_api_key: something_really_secret
development:
<<: *COMMON
production:
<<: *COMMONh2. Usage with Rails
* Add @gem 'idkfa'@ to your @Gemfile@
* Run @bundle@
* Add the @Idkfa.load_keys@ call inside your Application definition in @config/application.rb@:bc. class Application < Rails::Application
Idkfa.load_keys Rails.env, :credentials => Rails.root.join('config', 'credentials.yml')
...
end* In your application, use @ENV['MY_SECRET_API_KEY']@
h2. General Usage
* Run @gem install idkfa@
* Use @Idkfa.load_keys :production, :credentials => File.expand_path('../credentials.yml', __FILE__)@ (or similar)
* In your code, use @ENV['MY_SECRET_API_KEY']@h2. Acknowledgements
Written/Conceived by:
* Bradley Grzesiak - Bendyworks
* Jaymes Waters - Bendyworks
* Nick Karpenske - Bendyworks