rails_validations_hmac 0.0.2 → 0.0.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/README.md CHANGED
@@ -13,7 +13,7 @@ Usage
13
13
 
14
14
  class ApiUser < ActiveRecord::Base
15
15
  has_many :posts
16
- validates :secret, presence: true
16
+ validates :secret_key, presence: true
17
17
  validates :secret_algorithm, presence: true
18
18
  end
19
19
 
@@ -25,21 +25,21 @@ class Post < ActiveRecord::Base
25
25
 
26
26
  # these have same meaning (supports Lambdas and Symbols evaluating):
27
27
  validate :hmac, precence: true, hmac: {
28
- secret: lambda { api_user.secret },
29
- content: lambda { API_FIELDS.collect{|m| send(m) }.join },
28
+ key: lambda { api_user.secret_key },
29
+ data: lambda { API_FIELDS.collect{|m| send(m) }.join },
30
30
  algorithm: lambda { api_user.secret_algorithm }
31
31
  }
32
32
 
33
33
  validates :hmac, presence: true, hmac: {
34
- secret: :'api_user.secret',
35
- content: API_FIELDS,
34
+ key: :'api_user.secret_key',
35
+ data: API_FIELDS,
36
36
  algorithm: :'api_user.secret_algorithm'
37
37
  }
38
38
 
39
39
  # these are not evaluated (presumed that static value is written)
40
40
  validates :hmac, presence: true, hmac: {
41
- secret: 'all_the_time_same',
42
- content: 'why you would like to have a static value here?',
41
+ key: 'all_the_time_same',
42
+ data: 'why you would like to have a static value here?',
43
43
  algorithm: 'md5' # by default its sha1
44
44
  }
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module RailsValidationsHmac
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_validations_hmac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  segments:
214
214
  - 0
215
- hash: -721065036959082116
215
+ hash: 1495700232791925941
216
216
  requirements: []
217
217
  rubyforge_project:
218
218
  rubygems_version: 1.8.24