rainforest_auth 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data.tar.gz.sig +0 -0
  2. data/lib/rainforest/auth.rb +14 -14
  3. metadata +31 -3
  4. metadata.gz.sig +2 -0
data.tar.gz.sig ADDED
Binary file
@@ -17,25 +17,25 @@ class RainforestAuth
17
17
  self
18
18
  end
19
19
 
20
- def get_run_callback run_id, action
21
- digest = sign(action, {run_id: run_id})
22
- "https://www.rainforestqa.com/api/1/callback/run/#{run_id}/#{action}/#{digest}"
20
+ def get_run_callback run_id, callback_type
21
+ digest = sign(callback_type, {run_id: run_id})
22
+ "https://www.rainforestqa.com/api/1/callback/run/#{run_id}/#{callback_type}/#{digest}"
23
23
  end
24
24
 
25
- # Return a signature for a command and specified options
26
- def sign command, options = nil
27
- OpenSSL::HMAC.hexdigest(digest, @key, merge_data(command, options))
25
+ # Return a signature for a callback_type and specified options
26
+ def sign callback_type, options = nil
27
+ OpenSSL::HMAC.hexdigest(digest, @key, merge_data(callback_type, options))
28
28
  end
29
29
 
30
- # Verify a digest vs command and options
31
- def verify digest, command, options = nil
32
- digest == sign(command, options)
30
+ # Verify a digest vs callback_type and options
31
+ def verify digest, callback_type, options = nil
32
+ digest == sign(callback_type, options)
33
33
  end
34
34
 
35
35
  # Run a block if valid
36
- def run_if_valid digest, command, options, &block
37
- if verify digest, command, options
38
- block.call command, options
36
+ def run_if_valid digest, callback_type, options, &block
37
+ if verify digest, callback_type, options
38
+ block.call callback_type, options
39
39
  end
40
40
  end
41
41
 
@@ -45,8 +45,8 @@ class RainforestAuth
45
45
  OpenSSL::Digest::Digest.new 'sha1'
46
46
  end
47
47
 
48
- def merge_data command, options
49
- {command: command, options: options}.to_json
48
+ def merge_data callback_type, options
49
+ {callback_type: callback_type, options: options}.to_json
50
50
  end
51
51
 
52
52
  end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rainforest_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Russell Smith
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
11
+ cert_chain:
12
+ - !binary |-
13
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURPRENDQWlDZ0F3SUJB
14
+ Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREJDTVEwd0N3WURWUVFEREFSeWRY
15
+ TnoKTVJ3d0dnWUtDWkltaVpQeUxHUUJHUllNY21GcGJtWnZjbVZ6ZEhGaE1S
16
+ TXdFUVlLQ1pJbWlaUHlMR1FCR1JZRApZMjl0TUI0WERURXpNREV3T0RFeU5E
17
+ VTBNbG9YRFRFME1ERXdPREV5TkRVME1sb3dRakVOTUFzR0ExVUVBd3dFCmNu
18
+ VnpjekVjTUJvR0NnbVNKb21UOGl4a0FSa1dESEpoYVc1bWIzSmxjM1J4WVRF
19
+ VE1CRUdDZ21TSm9tVDhpeGsKQVJrV0EyTnZiVENDQVNJd0RRWUpLb1pJaHZj
20
+ TkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFLb3c3U3JHN3pnSwp0UG1QM28r
21
+ RkNvS3h5UjVwQUdLT3VLVVpVWlFBbnEyeU0vSk9rbW11TDQ2bTE3RGFDdDZ3
22
+ N2s0Umx2UnpncmQyCkMzcGJWV3lxclhHNS9sS3djaThsdTRtbTl2YlZkZVhB
23
+ TmJTRnk3eno3YnJSVTErYVUvMWxRblErWXltemFpdTMKYm9nZDM0ZzZxaG83
24
+ ZXFmTWlXYXZWNzRuYys4bnV2cmlYUjQ1SUM0RE5GQ29ya1NvWWpvNE9IR1Fl
25
+ ZlJUZzFFagpSVnZEZkUvMnI2bzZDY0U1czJKUWRGdzV4Vi9UbHdONHFiUERD
26
+ Z2xzSXM4WDhIbEVuQlhlUzhWQ1hBS29pOG9RCjFaVDFaTUI0NUE2R1BqeHQ4
27
+ MytRTlFkcnBBaEdEeDR3bm9IWmc5RkRpbVViWU03ZE8zNC8wMjNCL1ZFOGQ4
28
+ akYKQ0Q1OEtZNGpxNFVDQXdFQUFhTTVNRGN3Q1FZRFZSMFRCQUl3QURBZEJn
29
+ TlZIUTRFRmdRVUJQQktZT2kycEZzQgo1TjdxamxYbkp5SVgrM1l3Q3dZRFZS
30
+ MFBCQVFEQWdTd01BMEdDU3FHU0liM0RRRUJCUVVBQTRJQkFRQWY3bzV4Cmc3
31
+ UmZxdnoyRDdsbzBsN08vYWZzVEdxWHlmeE11U2d4YzVFbUQ1aXhqWFgrK1lu
32
+ VkhSbStpNU11SzErbEh1Rk8KZGltUk9aUTk1S2lNc1pRN0NFOEhRRkRqcHhG
33
+ cEh0WFZiRFhkL0M5NS9Dc2g5emVmYzRBWnlYWjZPNXhOcWxSUQozMzh4MEtT
34
+ VktaU0l2MjVCTThUbGpWQWR1SFBFeGdNWUhrc0NDM2tIdzVVRUxJalMrRit5
35
+ RXNhYnlvNWVLK292CnNCSzJmQmFpU3lVeUFLdjFkTmVYYmg1NnhTNkVyVFdy
36
+ Qi9ublptU0RLRi9oKzZFWUVMUDlVd0VkQnorVGwwU1kKUllPRXYxVWVhUFFU
37
+ RzcyeUNLN1BmMjAvN29kV00wL3RMTlllVmo1amduc1NuWTY0U1FMUVNaSUFs
38
+ MzZ0Zzh5NQovNGlyTi90bkd3eWVNZWZuCi0tLS0tRU5EIENFUlRJRklDQVRF
39
+ LS0tLS0K
40
+ date: 2013-01-16 00:00:00.000000000 Z
13
41
  dependencies:
14
42
  - !ruby/object:Gem::Dependency
15
43
  name: rspec
metadata.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ e[P�,o��� _]\WTp��θ&�'洜x��a��0����_��A�� ��Խ�q�.�Z"�w�,���`�/F�|t����
2
+ ���{&Rq������U���!�A �����r.��ds��������0]���~P�%S��E����Ejuz��j�=�&��Ϯ�ޓV�/vAT��܎���B����izB\�B/�~>��_Y�G�r���#Z�顀�KS���#YF�����OS��JoU\�$�����