rack-oauth2 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a2f073636f67589106aa93f4391600d582c7902
|
4
|
+
data.tar.gz: adce517353b54b8edb946a115f2312d836dc3eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dcbe63d67b03c6b26496150077109e14ec2e1d9a6714a25926f7b4c733dfa6a4740fcc8ff04c5312f9eea9540868ab3c1209173d16e1c4e37f589820a44858b
|
7
|
+
data.tar.gz: 1f0f366a6a0f8b7874f94613083d3ba7501e44980cafe5ca60b6e4e76eff7767183939dd6bd0e6817a8e6c251306eb1d0c71970f825a47c5f09bded70f6c2314
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.4
|
@@ -34,8 +34,10 @@ module Rack
|
|
34
34
|
end
|
35
35
|
|
36
36
|
class Request < Abstract::Request
|
37
|
+
include Server::Extension::ResponseMode::AuthorizationRequest
|
38
|
+
|
37
39
|
attr_required :response_type
|
38
|
-
attr_optional :redirect_uri, :state
|
40
|
+
attr_optional :redirect_uri, :state
|
39
41
|
attr_accessor :verified_redirect_uri
|
40
42
|
|
41
43
|
def initialize(env)
|
@@ -1 +1,2 @@
|
|
1
|
-
require 'rack/oauth2/server/extension/pkce'
|
1
|
+
require 'rack/oauth2/server/extension/pkce'
|
2
|
+
require 'rack/oauth2/server/extension/response_mode'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Rack
|
2
|
+
module OAuth2
|
3
|
+
module Server
|
4
|
+
module Extension
|
5
|
+
module ResponseMode
|
6
|
+
module AuthorizationRequest
|
7
|
+
def self.included(klass)
|
8
|
+
klass.send :attr_optional, :response_mode
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(env)
|
12
|
+
super
|
13
|
+
@response_mode = params['response_mode']
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper.rb'
|
2
|
+
|
3
|
+
describe Rack::OAuth2::Server::Authorize::Code do
|
4
|
+
let(:request) { Rack::MockRequest.new app }
|
5
|
+
let(:redirect_uri) { 'http://client.example.com/callback' }
|
6
|
+
let(:response_mode) { 'form_post' }
|
7
|
+
subject { @request }
|
8
|
+
|
9
|
+
describe 'authorization request' do
|
10
|
+
let :app do
|
11
|
+
Rack::OAuth2::Server::Authorize.new do |request, response|
|
12
|
+
@request = request
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'when response_mode is given' do
|
17
|
+
before do
|
18
|
+
request.get "/?response_type=code&client_id=client&redirect_uri=#{redirect_uri}&state=state&response_mode=#{response_mode}"
|
19
|
+
end
|
20
|
+
its(:response_mode) { should == response_mode }
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'otherwise' do
|
24
|
+
before do
|
25
|
+
request.get "/?response_type=code&client_id=client&redirect_uri=#{redirect_uri}&state=state"
|
26
|
+
end
|
27
|
+
its(:response_mode) { should == nil }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- lib/rack/oauth2/server/authorize/token.rb
|
204
204
|
- lib/rack/oauth2/server/extension.rb
|
205
205
|
- lib/rack/oauth2/server/extension/pkce.rb
|
206
|
+
- lib/rack/oauth2/server/extension/response_mode.rb
|
206
207
|
- lib/rack/oauth2/server/rails.rb
|
207
208
|
- lib/rack/oauth2/server/rails/authorize.rb
|
208
209
|
- lib/rack/oauth2/server/rails/response_ext.rb
|
@@ -262,6 +263,7 @@ files:
|
|
262
263
|
- spec/rack/oauth2/server/authorize/token_spec.rb
|
263
264
|
- spec/rack/oauth2/server/authorize_spec.rb
|
264
265
|
- spec/rack/oauth2/server/extension/pkce_spec.rb
|
266
|
+
- spec/rack/oauth2/server/extension/response_mode_spec.rb
|
265
267
|
- spec/rack/oauth2/server/resource/bearer/error_spec.rb
|
266
268
|
- spec/rack/oauth2/server/resource/bearer_spec.rb
|
267
269
|
- spec/rack/oauth2/server/resource/error_spec.rb
|
@@ -341,6 +343,7 @@ test_files:
|
|
341
343
|
- spec/rack/oauth2/server/authorize/token_spec.rb
|
342
344
|
- spec/rack/oauth2/server/authorize_spec.rb
|
343
345
|
- spec/rack/oauth2/server/extension/pkce_spec.rb
|
346
|
+
- spec/rack/oauth2/server/extension/response_mode_spec.rb
|
344
347
|
- spec/rack/oauth2/server/resource/bearer/error_spec.rb
|
345
348
|
- spec/rack/oauth2/server/resource/bearer_spec.rb
|
346
349
|
- spec/rack/oauth2/server/resource/error_spec.rb
|