loyal3-sentry 0.4.2 → 0.4.3

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/Rakefile CHANGED
@@ -22,7 +22,7 @@ Rake::TestTask.new("test") do |t|
22
22
  t.verbose = true
23
23
  end
24
24
 
25
- load 'tasks/sentry.rake'
25
+ #load 'tasks/sentry.rake'
26
26
 
27
27
  Rake::RDocTask.new do |rdoc|
28
28
  rdoc.rdoc_dir = 'doc'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -46,8 +46,7 @@ module ActiveRecord # :nodoc:
46
46
  alias_method "#{attr_name}_before_type_cast", "#{attr_name}_with_decryption"
47
47
 
48
48
  define_method("#{attr_name}_with_encryption=") do |value|
49
- padded_value = ActiveRecord::Sentry.rand_string + value
50
- encrypted_value = ::Sentry::AsymmetricSentry.encrypt_to_base64(padded_value)
49
+ encrypted_value = self.class.encrypt_for_sentry(value)
51
50
  self.send("#{attr_name}_without_encryption=", encrypted_value)
52
51
  nil
53
52
  end
@@ -56,6 +55,12 @@ module ActiveRecord # :nodoc:
56
55
  end
57
56
 
58
57
  end
58
+
59
+ def encrypt_for_sentry(string)
60
+ padded_value = ActiveRecord::Sentry.rand_string + string
61
+ encrypted_value = ::Sentry::AsymmetricSentry.encrypt_to_base64(padded_value)
62
+ end
63
+
59
64
  private
60
65
 
61
66
  #def symmetrically_encrypts(attr_name)
data/lib/sentry.rb CHANGED
@@ -44,4 +44,4 @@ begin
44
44
  end
45
45
  rescue NameError
46
46
  nil
47
- end
47
+ end
data/sentry.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sentry}
5
- s.version = "0.4.2"
5
+ s.version = "0.4.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Pelly", "David Stevenson"]
9
- s.date = %q{2009-07-30}
9
+ s.date = %q{2009-08-04}
10
10
  s.description = %q{Asymmetric encryption of active record fields}
11
11
  s.email = %q{commoncode@pivotallabs.com}
12
12
  s.extra_rdoc_files = [
@@ -46,10 +46,11 @@ Gem::Specification.new do |s|
46
46
  "test/symmetric_sentry_test.rb",
47
47
  "test/tests.rb"
48
48
  ]
49
+ s.has_rdoc = true
49
50
  s.homepage = %q{http://github.com/pivotal/sentry}
50
51
  s.rdoc_options = ["--charset=UTF-8"]
51
52
  s.require_paths = ["lib"]
52
- s.rubygems_version = %q{1.3.5}
53
+ s.rubygems_version = %q{1.3.1}
53
54
  s.summary = %q{Asymmetric encryption of active record fields}
54
55
  s.test_files = [
55
56
  "test/abstract_unit.rb",
@@ -65,7 +66,7 @@ Gem::Specification.new do |s|
65
66
 
66
67
  if s.respond_to? :specification_version then
67
68
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
68
- s.specification_version = 3
69
+ s.specification_version = 2
69
70
 
70
71
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
71
72
  else
@@ -33,6 +33,10 @@ class AsymmetricSentryCallbackTest < ActiveSupport::TestCase
33
33
  assert_equal @orig, users(:user_2).creditcard
34
34
  end
35
35
 
36
+ def test_encrypt_for_sentry
37
+ assert_not_nil User.encrypt_for_sentry("hello")
38
+ end
39
+
36
40
  def test_encryption_with_random_padding
37
41
  # system works with unsaved record
38
42
  u = User.new :login => 'jones'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loyal3-sentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Pelly
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-07-30 00:00:00 -07:00
13
+ date: 2009-08-04 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -55,7 +55,7 @@ files:
55
55
  - test/symmetric_sentry_callback_test.rb
56
56
  - test/symmetric_sentry_test.rb
57
57
  - test/tests.rb
58
- has_rdoc: false
58
+ has_rdoc: true
59
59
  homepage: http://github.com/pivotal/sentry
60
60
  licenses:
61
61
  post_install_message:
@@ -80,7 +80,7 @@ requirements: []
80
80
  rubyforge_project:
81
81
  rubygems_version: 1.3.5
82
82
  signing_key:
83
- specification_version: 3
83
+ specification_version: 2
84
84
  summary: Asymmetric encryption of active record fields
85
85
  test_files:
86
86
  - test/abstract_unit.rb