bitzesty-safe 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
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.4
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[:passphrase])
15
+ @data = @cabinet.read_data(params[:password])
13
16
  render :show
14
17
  end
18
+
15
19
  end
@@ -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
@@ -1,6 +1,6 @@
1
1
  <% unless @data %>
2
2
  <% form_tag unlock_safe_cabinet_path(@cabinet) do |f| %>
3
- <%= password_field_tag :passphrase %>
3
+ <%= password_field_tag :password %>
4
4
  <%= submit_tag "unlock" %>
5
5
  <% end %>
6
6
  <% else %>
data/safe.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{safe}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matthew Ford"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitzesty-safe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ford