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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +18 -9
- data/lib/securenv/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a81016414f2f135f892221107f59250bef0fa88c6266256842bc63750bcdd116
|
4
|
+
data.tar.gz: d19b97dc0e9bf70d1520798cbc78bd8b7897ae33d5692fe6bda638303a59d1c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6fababb6120228d63644966bb2ca448a9d629697d45a24f8bc2e71c2adafda386177c732cb462364b2216e0eb515c214ec74e58d2e28b3d23cbd33cea8af066
|
7
|
+
data.tar.gz: 1766c8d7a37b7cab046e3ded44671fb106dac333fb6049ae0a2000e08d13762ee2f9d4037da1f63ad71c5b9716aa032d2123896b217f5a0d803720a68d575efa
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -20,8 +20,9 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
24
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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
|
|
data/lib/securenv/version.rb
CHANGED