vidibus-secure 0.3.2 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +0 -0
- data/README.md +9 -6
- data/Rakefile +0 -0
- data/lib/generators/vidibus_secure_key/vidibus_secure_key_generator.rb +0 -0
- data/lib/vidibus/secure/extensions/controller.rb +0 -0
- data/lib/vidibus/secure/extensions.rb +0 -0
- data/lib/vidibus/secure/mongoid.rb +5 -3
- data/lib/vidibus/secure/version.rb +1 -1
- data/lib/vidibus/secure.rb +1 -1
- data/lib/vidibus-secure.rb +0 -0
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '087a53fdae4da0a6050ff333ff57e943b169e4a253db2e217ae1bcd3fa84d11d'
|
4
|
+
data.tar.gz: 4c05589f8eab6eaeca0d1b9c3b6b1ac3e3e0ba7c4502ca87b2171e0237bd0291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
17
|
+
```
|
18
|
+
class MyModel
|
19
|
+
include Mongoid::Document
|
20
|
+
include Vidibus::Secure::Mongoid
|
18
21
|
|
22
|
+
attr_encrypted :my_secret
|
23
|
+
```
|
19
24
|
|
20
|
-
|
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-
|
30
|
+
© 2010-2023 Andre Pankratz. See LICENSE for details.
|
data/Rakefile
CHANGED
File without changes
|
File without changes
|
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, :
|
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 ?
|
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
|
data/lib/vidibus/secure.rb
CHANGED
@@ -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
|
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)
|
data/lib/vidibus-secure.rb
CHANGED
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.
|
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:
|
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:
|
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:
|
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
|
-
|
232
|
-
|
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: []
|