Project

mrf

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Rails Application Secrets With GPG
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Mr F

For british eyes only

A libary for handling GPG-encrypted secrets.

Put your secrets in a gpg encrypted file. Ex: config/secrets.yml.gpg

Then you can access them like this:

require 'mrf'

secret_files = MrF::Project.new(
  secrets_path: "config/secrets.yml.gpg"
).unpack_secrets

A Example secrets file

database.yml:
  production:
    adapter: mysql
	database: my_db
	username: 0a1cd3bc-96fa-71d1-4338-27092ca4cfa5
	password: 070f1f0b-2454-3ffa-4aa2-d6e0652d03fe

other_service.yml:
  production:
    password: 115024d2-7c74-326e-c9ec-064f42d08b31
	username: 1e27a053-60a4-af61-f38d-9f1f123740d6

non_yaml_suff.key: |
  -----BEGIN PGP PRIVATE KEY BLOCK-----
  Version: GnuPG v1.4.14 (Darwin)

  lQH+BFI4SpEBBAC7culGRvKFA6mob902i8u4irg1jYP4WtJDtNMoMbCjhLrjE3kg
  Z8I9f0xpaBFZ2kHuD5Om7XH1w1OQ9G5EFiDBReCToe+xz7GLtFuJ/lDwLYLVHJiZ
  yPQKOv64kZ8F+063dr8j2NryBhKiJvcTIF2l0LWsI4OkfboLATVOUu1TqwARAQAB
  /gMDAremiA+pJjFcYPk8Ox0ynig50LCn1QuTja77+/ZjGoYsO9e7l11/6YcAGSb6
  e6zKkQqiSXUOLS912pRQk976Xl0mXLzQCLEufkdooh9SrQjfRoZVulwIjtrJj/CC
  r4iCSFyilrZOeSNIVGMXjkvSykHkiKc8XJiC3iXvaZa9nxJZOfvCVOW80NaNwDEv
  h7a1va+vlQAtlkiplXt/n2Y+4TfY2PjZnBC2hXn7FRxj45upOxuTo1B4RSEiN+8q
  IP3jbBSeq11Z7KMJXH/mEKRdjdxSFql9gnhX3XvWMifTULbw5ynur8ZKc8J99kGU
  /NYEo197z5KjvG5i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YQ/ehxyhWgMmDHoSb6ed5pLpAiLkgb
  /1TNVkdeigkRdO/2nu92uLMENJP2QSGKEH0cX5ao8jmiRz84T69pgOH9nyQeyy1C
  pSpEQlhITl0m/YifBBgBAgAJBQJSOEqRAhsMAAoJEHGEAzwJGrcBerkD/R5RkyKi
  8K4p+zX4dSYP/i9PhLZeVP0tjCYj48eTJg17fnyFbeK6VwZ30bMK7VYBJzPCCeza
  5xTiZlBAC/BByRZiSGWTEiec6U4y6GSpkdi8fWrWp8KkFhHm9yviJk0Up8g9QLo3
  a1W2egzD5CeUVPSYxEIj7FgEMA39UxYwVABv
  =NGkh
  -----END PGP PRIVATE KEY BLOCK-----

Running the specs

bundle install # install deps
./scripts/import_test_keys
rake # runs the tests