vidibus-secure 0.3.2 → 4.0.1

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
- SHA1:
3
- metadata.gz: 17282ec7a50784df78d45b47eb96143106bdba48
4
- data.tar.gz: bef0691493110f1237ec3e62de6c601559b22f40
2
+ SHA256:
3
+ metadata.gz: c6e19394e65e0b26b4b984609723d708e93cbfcc0d8e26c4b8f9b3c14ba168b3
4
+ data.tar.gz: 55981c68d9fc1269a0302e40ec47f6b95c48243665b9d0035b846607af877b7d
5
5
  SHA512:
6
- metadata.gz: d3f624b3077f1b4179fc42da0e1a6aeac3734d2b0ed9926b42c2bfe7d48e9973af87848e8b31b26c78fd98fd364af43e2ac82303ab5e8e86da00e99eb4f5e20b
7
- data.tar.gz: 574f254658988ad0bf1e00212dc00c79774d0fcb23953edbb7a5a445722c173dc73277d0c2d322233d5c5ee2dcb0c7fb83d7401962f5a77eeed80d56ac73fd3b
6
+ metadata.gz: 328a4d934659747d50ff53ddb1e77fe462e9168daa05d0ed92aa899867656aee326a02383ac1ed4e098d8fc1d40c48e698cba0d61434297c7279a7563a775147
7
+ data.tar.gz: a7c90ccf4e6c508deda61a89a88ce5a3303ba55a1c3e9120f2a99a7d12305b325fa80474bf6bd1a00ebf17647ef47c3772f3677ed956bd48be1ae24b41ebca2c
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Vidibus::Secure [![Build Status](https://travis-ci.org/vidibus/vidibus-secure.png)](https://travis-ci.org/vidibus/vidibus-secure)
1
+ # Vidibus::Secure
2
2
 
3
3
  Allows encryption and signing of requests and storing encrypted data within Mongoid documents.
4
4
 
@@ -14,14 +14,17 @@ If you want to use Vidibus::Secure::Mongoid on your models, you should generate
14
14
 
15
15
  ## Usage
16
16
 
17
- TODO
17
+ ```
18
+ class MyModel
19
+ include Mongoid::Document
20
+ include Vidibus::Secure::Mongoid
18
21
 
22
+ attr_encrypted :my_secret
23
+ ```
19
24
 
20
- ## TODO
21
-
22
- * Documentation
25
+ Defining `attr_encrypted :my_secret` will create setter and getter for `my_secret`. You can use it like normal. But it will be stored encrypted.
23
26
 
24
27
 
25
28
  ## Copyright
26
29
 
27
- © 2010-2013 Andre Pankratz. See LICENSE for details.
30
+ © 2010-2023 Andre Pankratz. See LICENSE for details.
data/Rakefile CHANGED
File without changes
@@ -1,11 +1,7 @@
1
1
  class VidibusSecureKeyGenerator < Rails::Generators::Base
2
- desc 'Generates an initializer that sets ENV["VIDIBUS_SECURE_KEY"]'
2
+ desc 'Creates secure key to be stored as ENV["VIDIBUS_SECURE_KEY"]'
3
3
 
4
- def create_initializer
5
- create_file "config/initializers/vidibus_secure_key.rb" do
6
- %(# This is a secret key for encrypting values of field defined by attr_encrypted.\n) +
7
- %(# Do not change this encryption key! Otherwise you will not be able to decrypt data already stored in your database.\n) +
8
- %(ENV["VIDIBUS_SECURE_KEY"] = "#{Vidibus::Secure.random(:encoding => :base64, :length => 100)}")
9
- end
10
- end
4
+ puts "\nAdd VIDIBUS_SECURE_KEY to your env file like ~/.bashrc, /etc/profile or ~/.zprofile"
5
+ key = %(export VIDIBUS_SECURE_KEY=#{Vidibus::Secure.random(:encoding => :base64, :length => 100)})
6
+ puts key
11
7
  end
File without changes
File without changes
@@ -12,19 +12,21 @@ module Vidibus
12
12
 
13
13
  # Define Mongoid field
14
14
  encrypted_field = "#{field}_encrypted"
15
- self.send(:field, encrypted_field, :type => BSON::Binary)
15
+ self.send(:field, encrypted_field, type: BSON::Binary)
16
16
 
17
17
  # Define setter
18
18
  class_eval <<-EOV
19
19
  def #{field}=(value)
20
- self.#{encrypted_field} = value ? Vidibus::Secure.encrypt(value, "#{key}") : nil
20
+ self.#{encrypted_field} = value ?
21
+ Vidibus::Secure.encrypt(value, "#{key}") :
22
+ nil
21
23
  end
22
24
  EOV
23
25
 
24
26
  # Define getter
25
27
  class_eval <<-EOV
26
28
  def #{field}
27
- Vidibus::Secure.decrypt(#{encrypted_field}, "#{key}") if #{encrypted_field}
29
+ Vidibus::Secure.decrypt(#{encrypted_field}.data, "#{key}") if #{encrypted_field}
28
30
  end
29
31
  EOV
30
32
  end
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Secure
3
- VERSION = '0.3.2'
3
+ VERSION = '4.0.1'
4
4
  end
5
5
  end
@@ -114,7 +114,7 @@ module Vidibus
114
114
 
115
115
  def crypt(cipher_method, data, key, options = {})
116
116
  return unless data && data != ''
117
- cipher = OpenSSL::Cipher::Cipher.new(options[:algorithm])
117
+ cipher = OpenSSL::Cipher.new(options[:algorithm])
118
118
  digest = OpenSSL::Digest::SHA512.new(key).digest
119
119
  cipher.send(cipher_method)
120
120
  cipher.pkcs5_keyivgen(digest)
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-secure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Pankratz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-09 00:00:00.000000000 Z
11
+ date: 2023-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 8.0.0
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: '0'
40
+ version: 8.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -179,7 +179,7 @@ dependencies:
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
- name: database_cleaner
182
+ name: database_cleaner-mongoid
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ">="
@@ -213,7 +213,7 @@ homepage: https://github.com/vidibus/vidibus-secure
213
213
  licenses:
214
214
  - MIT
215
215
  metadata: {}
216
- post_install_message:
216
+ post_install_message:
217
217
  rdoc_options: []
218
218
  require_paths:
219
219
  - lib
@@ -228,9 +228,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  - !ruby/object:Gem::Version
229
229
  version: 1.3.6
230
230
  requirements: []
231
- rubyforge_project: vidibus-secure
232
- rubygems_version: 2.6.11
233
- signing_key:
231
+ rubygems_version: 3.0.9
232
+ signing_key:
234
233
  specification_version: 4
235
234
  summary: Security tools for Vidibus applications
236
235
  test_files: []