bitzesty-safe 0.1.4 → 0.1.5
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.
- data/README.markdown +5 -0
- data/VERSION +1 -1
- data/app/controllers/safe_cabinets_controller.rb +5 -1
- data/app/models/safe_cabinet.rb +1 -1
- data/app/views/safe_cabinets/show.html.erb +1 -1
- data/safe.gemspec +1 -1
- metadata +1 -1
data/README.markdown
CHANGED
@@ -43,6 +43,11 @@ In your model that you want to store the encrypted data add:
|
|
43
43
|
after_create :make_keys!
|
44
44
|
end
|
45
45
|
|
46
|
+
Make sure you are not logging the data/password by adding the following in your ApplicationController
|
47
|
+
|
48
|
+
filter_parameter_logging :data
|
49
|
+
filter_parameter_logging :password
|
50
|
+
|
46
51
|
_N.B. A password must be used when creating an instance of MyModel._
|
47
52
|
|
48
53
|
To create and use safe_cabinets:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -1,6 +1,9 @@
|
|
1
1
|
class SafeCabinetsController < ApplicationController
|
2
2
|
unloadable
|
3
3
|
|
4
|
+
filter_parameter_logging :data
|
5
|
+
filter_parameter_logging :password
|
6
|
+
|
4
7
|
def show
|
5
8
|
@cabinet = SafeCabinet.find(params[:id])
|
6
9
|
@data = nil
|
@@ -9,7 +12,8 @@ class SafeCabinetsController < ApplicationController
|
|
9
12
|
|
10
13
|
def unlock
|
11
14
|
@cabinet = SafeCabinet.find(params[:id])
|
12
|
-
@data = @cabinet.read_data(params[:
|
15
|
+
@data = @cabinet.read_data(params[:password])
|
13
16
|
render :show
|
14
17
|
end
|
18
|
+
|
15
19
|
end
|
data/app/models/safe_cabinet.rb
CHANGED
@@ -44,7 +44,7 @@ class SafeCabinet < ActiveRecord::Base
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def lock_for name
|
47
|
-
lock_options[name] = options.merge(:key_pair => File.join(SAFE_KEYS_DIR, self.encryptable_id.to_s, "keypair.pem"))
|
47
|
+
lock_options[name] = options.merge(:key_pair => File.join(SAFE_KEYS_DIR, self.encryptable_class.to_s.tableize, self.encryptable_id.to_s, "keypair.pem"))
|
48
48
|
@_locks ||= {}
|
49
49
|
@_locks[name] ||= Lock.new(name, self, self.class.lock_options[name])
|
50
50
|
end
|
data/safe.gemspec
CHANGED