ncypher 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ncypher.rb +7 -4
- data/lib/ncypher/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfd1b3326757bdf0d4c6e574244fef35590c0e82
|
4
|
+
data.tar.gz: 256719f1a6f1ae607a368f53f409a1b6c006f4ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f75236a2af542fa8846200cc32bcd38e84fde0e72f8be468d41d1b03900b19f85795646dce6934a10e903877a1a86c09691aaf5993f39aadd88b799d7854de1e
|
7
|
+
data.tar.gz: ae27d9edee23c8ca7f38f69bd9b392f36fa8318fe14ad063a93d5756c5cda0467f9238da36c97fe7e85173223f5c8daecf5c74facdbd008e55593a0d564e3a2a
|
data/lib/ncypher.rb
CHANGED
@@ -8,7 +8,8 @@ module Ncypher
|
|
8
8
|
|
9
9
|
class Ncypher
|
10
10
|
|
11
|
-
def initialize(key_filename: '.ncypher_key')
|
11
|
+
def initialize(key_filename: '.ncypher_key', key: nil)
|
12
|
+
@key = key ? Base64.strict_decode64(key.strip) : nil
|
12
13
|
@key_filename = key_filename
|
13
14
|
end
|
14
15
|
|
@@ -26,9 +27,11 @@ module Ncypher
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def key
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
@key ||= begin
|
31
|
+
saved_key = ENV['NCYPHER_KEY'] || find_keyfile
|
32
|
+
abort "Can't find .ncypher_key file or NCYPHER_KEY env variable" if saved_key.nil?
|
33
|
+
Base64.strict_decode64(saved_key.strip)
|
34
|
+
end
|
32
35
|
end
|
33
36
|
|
34
37
|
def key_b64
|
data/lib/ncypher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ncypher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Hagege
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.6.13
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Ncypher lets you encrypt/decrypt credentials in a safe and transparent way
|