omniauth-salesforce 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Salesforce
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
@@ -34,7 +34,7 @@ module OmniAuth
34
34
 
35
35
  def auth_hash
36
36
  signed_value = access_token.params['id'] + access_token.params['issued_at']
37
- raw_expected_signature = OpenSSL::HMAC.digest('sha256', options.client_secret, signed_value)
37
+ raw_expected_signature = OpenSSL::HMAC.digest('sha256', options.client_secret.to_s, signed_value)
38
38
  expected_signature = Base64.strict_encode64 raw_expected_signature
39
39
  signature = access_token.params['signature']
40
40
  fail! "Salesforce user id did not match signature!" unless signature == expected_signature
@@ -66,8 +66,7 @@ module OmniAuth
66
66
  end
67
67
 
68
68
  def raw_info
69
- access_token.options[:mode] = :query
70
- access_token.options[:param_name] = :oauth_token
69
+ access_token.options[:mode] = :header
71
70
  @raw_info ||= access_token.post(access_token['id']).parsed
72
71
  end
73
72
 
@@ -79,7 +78,7 @@ module OmniAuth
79
78
  'issued_at' => access_token.params['issued_at']
80
79
  })
81
80
  end
82
-
81
+
83
82
  end
84
83
 
85
84
  class SalesforceSandbox < OmniAuth::Strategies::Salesforce
@@ -17,9 +17,9 @@ describe OmniAuth::Strategies::Salesforce do
17
17
  'REQUEST_METHOD' => 'GET',
18
18
  'rack.input' => '',
19
19
  'rack.url_scheme' => 'http',
20
- 'SERVER_NAME' => 'server.example',
21
- 'QUERY_STRING' => 'code=xxxx',
22
- 'SCRIPT_NAME' => '',
20
+ 'SERVER_NAME' => 'server.example',
21
+ 'QUERY_STRING' => 'code=xxxx',
22
+ 'SCRIPT_NAME' => '',
23
23
  'SERVER_PORT' => 80
24
24
  }
25
25
  end
@@ -107,7 +107,7 @@ describe OmniAuth::Strategies::Salesforce do
107
107
  it "returns an info hash" do
108
108
  subject.should_not be_nil
109
109
  end
110
- it "sets name" do
110
+ it "sets name" do
111
111
  subject['name'].should == raw_info['display_name']
112
112
  end
113
113
  it "sets email" do
@@ -140,7 +140,7 @@ describe OmniAuth::Strategies::Salesforce do
140
140
  end
141
141
  describe "credentials" do
142
142
  subject { strategy.credentials }
143
- it "sets token" do
143
+ it "sets token" do
144
144
  subject['token'].should == strategy.access_token.token
145
145
  end
146
146
  it "sets instance_url" do
@@ -180,7 +180,7 @@ describe OmniAuth::Strategies::Salesforce do
180
180
  before do
181
181
  client_id = "https://login.salesforce.com/id/00Dd0000000d45TEBQ/005d0000000fyGPCCY"
182
182
  issued_at = "1331142541514"
183
- signature = Base64.strict_encode64(OpenSSL::HMAC.digest('sha256', strategy.options.client_secret, client_id + issued_at))
183
+ signature = Base64.strict_encode64(OpenSSL::HMAC.digest('sha256', strategy.options.client_secret.to_s, client_id + issued_at))
184
184
  end
185
185
  context "when the signature does not match" do
186
186
  before do
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-salesforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Richard Vanhook
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-05-27 00:00:00.000000000 Z
12
+ date: 2014-10-27 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: omniauth
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: omniauth-oauth2
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rspec
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,43 +62,49 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rack-test
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: simplecov
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - '>='
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: '0'
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - '>='
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0'
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: webmock
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - '>='
99
+ - - ! '>='
88
100
  - !ruby/object:Gem::Version
89
101
  version: '0'
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - '>='
107
+ - - ! '>='
95
108
  - !ruby/object:Gem::Version
96
109
  version: '0'
97
110
  description: OmniAuth strategy for salesforce.com.
@@ -118,26 +131,27 @@ files:
118
131
  homepage: https://github.com/realdoug/omniauth-salesforce
119
132
  licenses:
120
133
  - MIT
121
- metadata: {}
122
134
  post_install_message:
123
135
  rdoc_options: []
124
136
  require_paths:
125
137
  - lib
126
138
  required_ruby_version: !ruby/object:Gem::Requirement
139
+ none: false
127
140
  requirements:
128
- - - '>='
141
+ - - ! '>='
129
142
  - !ruby/object:Gem::Version
130
143
  version: '0'
131
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
+ none: false
132
146
  requirements:
133
- - - '>='
147
+ - - ! '>='
134
148
  - !ruby/object:Gem::Version
135
149
  version: '0'
136
150
  requirements: []
137
151
  rubyforge_project:
138
- rubygems_version: 2.0.3
152
+ rubygems_version: 1.8.25
139
153
  signing_key:
140
- specification_version: 4
154
+ specification_version: 3
141
155
  summary: OmniAuth strategy for salesforce.com.
142
156
  test_files:
143
157
  - spec/omniauth/strategies/salesforce_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 09b903072b7e9b94e366fb7ff1a22b3c058a87d1
4
- data.tar.gz: 20caac8cc1e94b718387f0744e265a6e457763cc
5
- SHA512:
6
- metadata.gz: 2058ec807e22afc966995ae504ec7ecefef72980812690d226795d125c9c27f5521a20dbf4b4146ef1d9feb609e75326c676b7a11b6c7fcca75871caab7d2278
7
- data.tar.gz: 65662fa728868aec3a07786bcc77b471e1994af2ca33c495b618a4150ec354f8efd76a85b34c844c497026a694583f8e2d1d2b6b770267d993ebf66077e35158