symmetric-encryption 3.1.0 → 3.2

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
  SHA1:
3
- metadata.gz: 5b55176807bf8e48cedee2a8f6d40a12c7119200
4
- data.tar.gz: f8e5b0547683314ff7c1212989ba81a4cad1439c
3
+ metadata.gz: acc34e0886fa7dcf660847dd29c02a34b102a815
4
+ data.tar.gz: 2e74557115bc5fc5da4f899271f756f34a6af987
5
5
  SHA512:
6
- metadata.gz: dae35d6143650d7a3ea7b3d181a70456088d9a26341bb2c7d83b4aab6f7969b271965c24d0dda7fe906cb26702a7dbdd964c93cecf1df9310dd6d0239acad2e8
7
- data.tar.gz: 19e4120aa1a617601c41002326256743ef8ea707001e14f7d3f324e2e8675ec1067bc45c4561f43e9daf7a25ef005e408d5aff4dee0daa1100aab513495ad2f2
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
- config_file = Rails.root.join("config", "symmetric-encryption.yml")
37
- if config_file.file?
38
- ::SymmetricEncryption.load!(config_file, Rails.env)
39
- else
40
- puts "\nSymmetric Encryption config not found."
41
- puts "To generate one for the first time: rails generate symmetric_encryption:config\n\n"
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
@@ -1,3 +1,3 @@
1
1
  module SymmetricEncryption #:nodoc
2
- VERSION = "3.1.0"
2
+ VERSION = "3.2"
3
3
  end
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.1.0
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-09-25 00:00:00.000000000 Z
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