rack-oauth2 0.6.7 → 0.6.8

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.7
1
+ 0.6.8
@@ -17,12 +17,10 @@ module Rack
17
17
  def normalized_request_string
18
18
  arr = [
19
19
  token,
20
- secret,
21
- algorithm,
22
20
  timestamp,
23
21
  nonce,
24
- body_hash,
25
- method,
22
+ body_hash || '',
23
+ method.to_s.upcase,
26
24
  host,
27
25
  port,
28
26
  path,
@@ -46,4 +44,4 @@ module Rack
46
44
  end
47
45
  end
48
46
  end
49
- end
47
+ end
@@ -37,7 +37,7 @@ describe Rack::OAuth2::AccessToken::MAC do
37
37
  Time.fix(Time.at(1302361200)) do
38
38
  RestClient.should_receive(:get).with(
39
39
  resource_endpoint,
40
- :AUTHORIZATION => "MAC token=\"access_token\", timestamp=\"1302361200\", nonce=\"51e74de734c05613f37520872e68db5f\", signature=\"yYDSkZMrEbOOqj0anHNLA9ougNA+lxU0zmPiMSPtmJ8=\""
40
+ :AUTHORIZATION => "MAC token=\"access_token\", timestamp=\"1302361200\", nonce=\"51e74de734c05613f37520872e68db5f\", signature=\"l7uMvWa3BIHjBaJrS3MHKPUAwEFTf5Xyp+N3R7Fda/s=\""
41
41
  )
42
42
  token.get resource_endpoint
43
43
  end
@@ -50,7 +50,7 @@ describe Rack::OAuth2::AccessToken::MAC do
50
50
  RestClient.should_receive(:post).with(
51
51
  resource_endpoint,
52
52
  {:key => :value},
53
- {:AUTHORIZATION => "MAC token=\"access_token\", timestamp=\"1302361200\", nonce=\"51e74de734c05613f37520872e68db5f\", bodyhash=\"Vj8DVxGNBe8UXWvd8pZswj6Gyo8vAT+RXlZa/fCfeiM=\", signature=\"xRvIiA+rmjhPjULVpyCCgiHEsOkLEHZik4ZaB+cyqgk=\""}
53
+ {:AUTHORIZATION => "MAC token=\"access_token\", timestamp=\"1302361200\", nonce=\"51e74de734c05613f37520872e68db5f\", bodyhash=\"Vj8DVxGNBe8UXWvd8pZswj6Gyo8vAT+RXlZa/fCfeiM=\", signature=\"r7IH6k98Wo0qxA6udjhsgURJoxdlS4MQ3rV6YOlGmXA=\""}
54
54
  )
55
55
  token.post resource_endpoint, :key => :value
56
56
  end
@@ -63,7 +63,7 @@ describe Rack::OAuth2::AccessToken::MAC do
63
63
  RestClient.should_receive(:put).with(
64
64
  resource_endpoint,
65
65
  {:key => :value},
66
- {:AUTHORIZATION => "MAC token=\"access_token\", timestamp=\"1302361200\", nonce=\"51e74de734c05613f37520872e68db5f\", bodyhash=\"Vj8DVxGNBe8UXWvd8pZswj6Gyo8vAT+RXlZa/fCfeiM=\", signature=\"2lWgkUCtD9lNBlDi5fe9eVDwEwbxfLGAqjgykaSV1ww=\""}
66
+ {:AUTHORIZATION => "MAC token=\"access_token\", timestamp=\"1302361200\", nonce=\"51e74de734c05613f37520872e68db5f\", bodyhash=\"Vj8DVxGNBe8UXWvd8pZswj6Gyo8vAT+RXlZa/fCfeiM=\", signature=\"JP0Kvw+0wVF+XRlweJNCXsEJGjjZGz8ZU7ehc4/7Z10=\""}
67
67
  )
68
68
  token.put resource_endpoint, :key => :value
69
69
  end
@@ -75,7 +75,7 @@ describe Rack::OAuth2::AccessToken::MAC do
75
75
  Time.fix(Time.at(1302361200)) do
76
76
  RestClient.should_receive(:delete).with(
77
77
  resource_endpoint,
78
- :AUTHORIZATION => "MAC token=\"access_token\", timestamp=\"1302361200\", nonce=\"51e74de734c05613f37520872e68db5f\", signature=\"PX2GhHuo5yYNEs51e4Zlllw8itQ4Te0v+6ZuRCK7k+s=\""
78
+ :AUTHORIZATION => "MAC token=\"access_token\", timestamp=\"1302361200\", nonce=\"51e74de734c05613f37520872e68db5f\", signature=\"aPVm8GmDwc/BZ8AYus4FICZ6ylsNECCWdxWYKJSCX2s=\""
79
79
  )
80
80
  token.delete resource_endpoint
81
81
  end
@@ -95,7 +95,7 @@ describe Rack::OAuth2::AccessToken::MAC do
95
95
  end
96
96
 
97
97
  context 'when signature is valid' do
98
- let(:signature) { 'jaOwJ1eEjabkiRJJ4hdOeVvCGfiCHgeb9NDSrkM0ka4=' }
98
+ let(:signature) { 'zohXlhqYIVrRlT6YTR4pIZuKgAYepZ6/GlnGqHahOog=' }
99
99
  it do
100
100
  Time.fix(Time.at(1302361200)) do
101
101
  token.verify!(request.setup!).should == :verified
@@ -141,7 +141,7 @@ describe Rack::OAuth2::AccessToken::MAC do
141
141
  let(:body_hash) { 'TPzUbFn1S16mpfmwXCi1L+8oZHRxlLX9/D1ZwAV781o=' }
142
142
 
143
143
  context 'when signature is valid' do
144
- let(:signature) { 'ZSicF/YCg5bdDef103/NLGeuhH7ylHwrnYUUMcCz12A=' }
144
+ let(:signature) { 'xq2HfmPIC6VL4zXulRLYi9AesMyT58Jztu4Kn9k9MJ0=' }
145
145
  it do
146
146
  Time.fix(Time.at(1302361200)) do
147
147
  token.verify!(request.setup!).should == :verified
@@ -72,7 +72,7 @@ describe Rack::OAuth2::Server::Resource::MAC do
72
72
  end
73
73
 
74
74
  context 'when all required params are valid' do
75
- let(:env) { Rack::MockRequest.env_for('/protected_resource', 'HTTP_AUTHORIZATION' => 'MAC token="valid_token", timestamp="1302361200", nonce="51e74de734c05613f37520872e68db5f", signature="0rykQnhMJ3/yoogoDM0R2ReCN7aiFFPQmQTQotBOQaI=""') }
75
+ let(:env) { Rack::MockRequest.env_for('/protected_resource', 'HTTP_AUTHORIZATION' => 'MAC token="valid_token", timestamp="1302361200", nonce="51e74de734c05613f37520872e68db5f", signature="cK4sig+1Rb7w5Dtvadj6q9RqCFnY4/Y+dvaVjXlm5Wk="') }
76
76
  it_behaves_like :authenticated_mac_request
77
77
  end
78
78
  end
@@ -105,4 +105,4 @@ describe Rack::OAuth2::Server::Resource::MAC do
105
105
  end
106
106
  end
107
107
  end
108
- end
108
+ end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 6
9
- - 7
10
- version: 0.6.7
5
+ version: 0.6.8
11
6
  platform: ruby
12
7
  authors:
13
8
  - nov matake
@@ -25,10 +20,6 @@ dependencies:
25
20
  requirements:
26
21
  - - ">="
27
22
  - !ruby/object:Gem::Version
28
- hash: 13
29
- segments:
30
- - 1
31
- - 1
32
23
  version: "1.1"
33
24
  type: :runtime
34
25
  version_requirements: *id001
@@ -40,11 +31,6 @@ dependencies:
40
31
  requirements:
41
32
  - - ">="
42
33
  - !ruby/object:Gem::Version
43
- hash: 1
44
- segments:
45
- - 1
46
- - 4
47
- - 3
48
34
  version: 1.4.3
49
35
  type: :runtime
50
36
  version_requirements: *id002
@@ -56,9 +42,6 @@ dependencies:
56
42
  requirements:
57
43
  - - ">="
58
44
  - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
45
  version: "0"
63
46
  type: :runtime
64
47
  version_requirements: *id003
@@ -70,10 +53,6 @@ dependencies:
70
53
  requirements:
71
54
  - - ">="
72
55
  - !ruby/object:Gem::Version
73
- hash: 5
74
- segments:
75
- - 2
76
- - 3
77
56
  version: "2.3"
78
57
  type: :runtime
79
58
  version_requirements: *id004
@@ -85,9 +64,6 @@ dependencies:
85
64
  requirements:
86
65
  - - ">="
87
66
  - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
67
  version: "0"
92
68
  type: :runtime
93
69
  version_requirements: *id005
@@ -99,11 +75,6 @@ dependencies:
99
75
  requirements:
100
76
  - - ">="
101
77
  - !ruby/object:Gem::Version
102
- hash: 25
103
- segments:
104
- - 0
105
- - 0
106
- - 3
107
78
  version: 0.0.3
108
79
  type: :runtime
109
80
  version_requirements: *id006
@@ -115,10 +86,6 @@ dependencies:
115
86
  requirements:
116
87
  - - ">="
117
88
  - !ruby/object:Gem::Version
118
- hash: 27
119
- segments:
120
- - 0
121
- - 8
122
89
  version: "0.8"
123
90
  type: :development
124
91
  version_requirements: *id007
@@ -130,10 +97,6 @@ dependencies:
130
97
  requirements:
131
98
  - - ">="
132
99
  - !ruby/object:Gem::Version
133
- hash: 25
134
- segments:
135
- - 0
136
- - 9
137
100
  version: "0.9"
138
101
  type: :development
139
102
  version_requirements: *id008
@@ -145,9 +108,6 @@ dependencies:
145
108
  requirements:
146
109
  - - ">="
147
110
  - !ruby/object:Gem::Version
148
- hash: 7
149
- segments:
150
- - 2
151
111
  version: "2"
152
112
  type: :development
153
113
  version_requirements: *id009
@@ -159,10 +119,6 @@ dependencies:
159
119
  requirements:
160
120
  - - ">="
161
121
  - !ruby/object:Gem::Version
162
- hash: 9
163
- segments:
164
- - 1
165
- - 3
166
122
  version: "1.3"
167
123
  type: :development
168
124
  version_requirements: *id010
@@ -271,20 +227,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
227
  requirements:
272
228
  - - ">="
273
229
  - !ruby/object:Gem::Version
274
- hash: 3
275
- segments:
276
- - 0
277
230
  version: "0"
278
231
  required_rubygems_version: !ruby/object:Gem::Requirement
279
232
  none: false
280
233
  requirements:
281
234
  - - ">="
282
235
  - !ruby/object:Gem::Version
283
- hash: 23
284
- segments:
285
- - 1
286
- - 3
287
- - 6
288
236
  version: 1.3.6
289
237
  requirements: []
290
238