symmetric-encryption 3.1.0 → 3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acc34e0886fa7dcf660847dd29c02a34b102a815
|
4
|
+
data.tar.gz: 2e74557115bc5fc5da4f899271f756f34a6af987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9760706ef46ddd952e26b10fbea5007b51e8bfc5fedc85b7827fa4a3119850c089d1865d86b7ced4d8b5037117aa23b06eeb0c7f0841a56240823a28f09ac4c0
|
7
|
+
data.tar.gz: e2b5991b164831c50519c5dd0879f1f5d720909bbcb57ff6a4537219ba58268cfa3425bcc0b10515a0f23a1783c6ba67a201ae3a18c7002de125e1d5ab173705
|
@@ -33,12 +33,15 @@ module SymmetricEncryption #:nodoc:
|
|
33
33
|
# Loaded before Active Record initializes since database.yml can have encrypted
|
34
34
|
# passwords in it
|
35
35
|
config.before_configuration do
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
# Check if already configured
|
37
|
+
unless ::SymmetricEncryption.cipher?
|
38
|
+
config_file = Rails.root.join("config", "symmetric-encryption.yml")
|
39
|
+
if config_file.file?
|
40
|
+
::SymmetricEncryption.load!(config_file, Rails.env)
|
41
|
+
else
|
42
|
+
puts "\nSymmetric Encryption config not found."
|
43
|
+
puts "To generate one for the first time: rails generate symmetric_encryption:config\n\n"
|
44
|
+
end
|
42
45
|
end
|
43
46
|
end
|
44
47
|
|
@@ -38,6 +38,11 @@ module SymmetricEncryption
|
|
38
38
|
secondary_ciphers.find {|c| c.version == version} || (@@cipher if version == 0)
|
39
39
|
end
|
40
40
|
|
41
|
+
# Returns whether a primary cipher has been set
|
42
|
+
def self.cipher?
|
43
|
+
!@@cipher.nil?
|
44
|
+
end
|
45
|
+
|
41
46
|
# Set the Secondary Symmetric Ciphers Array to be used
|
42
47
|
def self.secondary_ciphers=(secondary_ciphers)
|
43
48
|
raise "secondary_ciphers must be a collection" unless secondary_ciphers.respond_to? :each
|
data/test/test_db.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: symmetric-encryption
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: '3.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: SymmetricEncryption supports encrypting ActiveRecord data, Mongoid data,
|
14
14
|
passwords in configuration files, encrypting and decrypting of large files through
|