ssssh 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/bin/ssssh +10 -4
- data/lib/ssssh/version.rb +1 -1
- data/ssssh.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eef52cc397abec11348e1c17be44d31adf552a56
|
4
|
+
data.tar.gz: a1673a612e4cac2b428e55d04a5dcef21ea58335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccfab41aa8f45b245b2c87d1011736efcb87f628b18a23fa793c42df933dbf350c9c1c6d433d83f906bee6a45fa9c96fa57deaabcb0175c630a55a36e1b94dd8
|
7
|
+
data.tar.gz: e44a896cc694db6b11f768c827e30350d4bca6fb4b7a33931765b4f7ad1eece187e3a8e6e0321bd8f87243767c6dd74a59560e9ffda16047b94c85666ee1aac4
|
data/README.md
CHANGED
@@ -12,7 +12,9 @@ Later, you can decrypt them:
|
|
12
12
|
|
13
13
|
ssssh decrypt < secrets.encrypted > secrets.txt
|
14
14
|
|
15
|
-
|
15
|
+
KEY-ID must be the name or alias of an existing KMS key.
|
16
|
+
|
17
|
+
Naturally, suitable AWS credentials must be provided (via environment variables, command-line options, or EC2 instance profile).
|
16
18
|
|
17
19
|
## Limitations
|
18
20
|
|
data/bin/ssssh
CHANGED
@@ -82,16 +82,22 @@ Clamp do
|
|
82
82
|
}.reject { |k,v| v.nil? || v == "" }
|
83
83
|
end
|
84
84
|
|
85
|
-
def
|
86
|
-
|
85
|
+
def with_kms
|
86
|
+
yield Aws::KMS::Client.new(aws_config)
|
87
|
+
rescue Aws::KMS::Errors::ServiceError => e
|
88
|
+
signal_error(e.message, :status => 9)
|
87
89
|
end
|
88
90
|
|
89
91
|
def encrypt(plaintext, key_id)
|
90
|
-
|
92
|
+
with_kms do |kms|
|
93
|
+
kms.encrypt(:key_id => key_id, :plaintext => plaintext).ciphertext_blob
|
94
|
+
end
|
91
95
|
end
|
92
96
|
|
93
97
|
def decrypt(ciphertext)
|
94
|
-
|
98
|
+
with_kms do |kms|
|
99
|
+
kms.decrypt(:ciphertext_blob => ciphertext).plaintext
|
100
|
+
end
|
95
101
|
end
|
96
102
|
|
97
103
|
end
|
data/lib/ssssh/version.rb
CHANGED
data/ssssh.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.add_runtime_dependency "aws-sdk-core", "~> 2.0"
|
25
|
-
spec.add_runtime_dependency "clamp", ">= 0.6"
|
25
|
+
spec.add_runtime_dependency "clamp", ">= 0.6.4"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 1.7"
|
28
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ssssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.6.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.6.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|