vidibus-secure 0.3.1 → 4.0.0

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: 5f4a69db5bdea57a96ded4985a8bec8fc2e08f31
4
- data.tar.gz: 2a07bcaef997f53923fc90c35fd5d086384825c8
2
+ SHA256:
3
+ metadata.gz: '087a53fdae4da0a6050ff333ff57e943b169e4a253db2e217ae1bcd3fa84d11d'
4
+ data.tar.gz: 4c05589f8eab6eaeca0d1b9c3b6b1ac3e3e0ba7c4502ca87b2171e0237bd0291
5
5
  SHA512:
6
- metadata.gz: b42d54ad52af28470f84df40292789d333262bd350b46c39783fc1a159c7f6994465e8eabdbe9de36fc5bb7c95d0b4b46f59096070ebeafa4b3d9358133a3b54
7
- data.tar.gz: 7735e085b02d87cab22c1457c6d050c25e62833410ae9ec7e63fb7fe6b08d6f40f9cf9beaa6774cd611c38c70238581e33f9fba91cb505674fc8d11d9f147f73
6
+ metadata.gz: 3164ce5dcf84f266c299c278fe86d68b074e12597c6f11ad71802e63cee9bdc0421e105946441887464abd67502fd2799fabd9a9071674ebecdd3e97707af408
7
+ data.tar.gz: 5ff744c69fab0717a94f231d06dc347850368ce2f7c15822e7f709a5cff902921704e93697780d69899c5d0154ffd15cdcb24e60dd25235171dce9d3fea776e3
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
@@ -7,7 +7,7 @@ module Vidibus
7
7
  extend ActiveSupport::Concern
8
8
 
9
9
  included do
10
- helper_method :valid_request?
10
+ helper_method(:valid_request?) if respond_to?(:helper_method)
11
11
  end
12
12
 
13
13
  # Generates a signature of a request path.
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.1'
3
+ VERSION = '4.0.0'
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.1
4
+ version: 4.0.0
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: 2017-12-18 00:00:00.000000000 Z
11
+ date: 2023-04-03 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.14
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: []