securenv 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f98e4349739d04c45f76ef3065a0c1929910fe9e9b29332d0a1d384cd69a6a73
4
- data.tar.gz: 23abb50be1835f36adea2c3a76d28aa7cda2997951d08bdfef49b4bbd1a1d969
3
+ metadata.gz: a81016414f2f135f892221107f59250bef0fa88c6266256842bc63750bcdd116
4
+ data.tar.gz: d19b97dc0e9bf70d1520798cbc78bd8b7897ae33d5692fe6bda638303a59d1c0
5
5
  SHA512:
6
- metadata.gz: d0298049140580e3a89db7abf0a5dee76c14b5202e101a10fd41b2cd0946d9fdb835825397529fc30848e4b310f7e81d75eaa5a697a485ef6692de9b37d9a59c
7
- data.tar.gz: 165c89584a73624004788ba1b11d4dbf9ca653ef60b1b3405b2417a3c614db5c5a6d94d9202138b45f75502c2da38d01351ad5d69daf083f54fb26151c992b13
6
+ metadata.gz: e6fababb6120228d63644966bb2ca448a9d629697d45a24f8bc2e71c2adafda386177c732cb462364b2216e0eb515c214ec74e58d2e28b3d23cbd33cea8af066
7
+ data.tar.gz: 1766c8d7a37b7cab046e3ded44671fb106dac333fb6049ae0a2000e08d13762ee2f9d4037da1f63ad71c5b9716aa032d2123896b217f5a0d803720a68d575efa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- securenv (0.1.1)
4
+ securenv (1.0.0)
5
5
  aws-sdk-ssm
6
6
  thor
7
7
 
data/README.md CHANGED
@@ -20,8 +20,9 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- **NOTE : These docs are currently aspirational. This gem is very new and doesn't do _anything_ yet. The
24
- following is "documentation driven development".**
23
+ There are two parts to using `securenv`:
24
+ 1. Setting secure environment variables in SSM via the command line or programatically.
25
+ 2. Populating a runtime ENV with values previously stored in SSM.
25
26
 
26
27
  ### Set a secure environment variable
27
28
 
@@ -37,6 +38,13 @@ Or you can use the short form:
37
38
  securenv set FOO=bar -a myapp -s production
38
39
  ```
39
40
 
41
+ If you want to set them programtically you can do something like this:
42
+
43
+ ```ruby
44
+ securenv = Securenv::Client.new(app: 'myapp', stage: 'dev')
45
+ securenv.set(variable: 'FOO', value: 'bar')
46
+ ```
47
+
40
48
  ### Using secure environment variables in your app
41
49
 
42
50
  Before or during the boot stage of your app you can require `securenv` and give it a list of ENV variables
@@ -44,15 +52,16 @@ to populate.
44
52
 
45
53
  ```ruby
46
54
  require 'securenv'
47
- Securenv.app = 'myapp' # For rails you could use Rails.application.class.module_parent.name
48
- Securenv.app = ENV['STAGE'] # For rails you might use ENV['RAILS_ENV']
49
- Securenv.populate %w[
50
- FOO
51
- MY_SECRET_KEY
52
- ]
55
+
56
+ securenv = Securenv::Client.new(
57
+ app: 'myapp', # For rails you could use Rails.application.class.module_parent.name
58
+ stage: ENV['STAGE'] # For rails you might use ENV['RAILS_ENV']
59
+ )
60
+
61
+ securenv.populate_env
53
62
  ```
54
63
 
55
- Then you'll be able to use `ENV['FOO']` to access the value that you set previously.
64
+ Then you'll be able to use `ENV['FOO']` (and others) to access the value that you set previously.
56
65
 
57
66
  ## Development
58
67
 
@@ -1,3 +1,3 @@
1
1
  module Securenv
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: securenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green