rack-oauth2 1.16.0 → 1.17.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/VERSION +1 -1
- data/lib/rack/oauth2/client.rb +5 -0
- data/lib/rack/oauth2/util.rb +0 -4
- data/spec/rack/oauth2/client_spec.rb +18 -0
- data/spec/rack/oauth2/util_spec.rb +0 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ea33651fcefd142210b8b6c275eb6a3c6096274796ef3070a5fa87da18433a6
|
4
|
+
data.tar.gz: 284e253fbefbe51cc1d645ec348584160c6f4363251f908ea536d1796b3444e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae2c8ced737f24a116a0b484d745477e8e4b03732e5a7147428e4d63fee61518ca43a705020817b09311ac030267e1b55ab072f421b26a90292482945c9b3bd3
|
7
|
+
data.tar.gz: 2e70af95a0040f956e3de8d918d50c3322107f68cb7a5af25a9987cac914c40d6453202e97e42395bf1707e78b65987f0b059b9c77bf3421070ee6f51a2dddd3
|
data/.travis.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.17.0
|
data/lib/rack/oauth2/client.rb
CHANGED
@@ -90,6 +90,11 @@ module Rack
|
|
90
90
|
headers.merge!(
|
91
91
|
'Authorization' => "Basic #{cred}"
|
92
92
|
)
|
93
|
+
when :basic_without_www_form_urlencode
|
94
|
+
cred = ["#{identifier}:#{secret}"].pack('m').tr("\n", '')
|
95
|
+
headers.merge!(
|
96
|
+
'Authorization' => "Basic #{cred}"
|
97
|
+
)
|
93
98
|
when :jwt_bearer
|
94
99
|
params.merge!(
|
95
100
|
client_assertion_type: URN::ClientAssertionType::JWT_BEARER
|
data/lib/rack/oauth2/util.rb
CHANGED
@@ -117,6 +117,24 @@ describe Rack::OAuth2::Client do
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
+
context 'when basic_without_www_form_urlencode method is used' do
|
121
|
+
context 'when client_id is a url' do
|
122
|
+
let(:client_id) { 'https://client.example.com'}
|
123
|
+
|
124
|
+
it 'should be encoded in "application/x-www-form-urlencoded"' do
|
125
|
+
mock_response(
|
126
|
+
:post,
|
127
|
+
'https://server.example.com/oauth2/token',
|
128
|
+
'tokens/bearer.json',
|
129
|
+
request_header: {
|
130
|
+
'Authorization' => 'Basic aHR0cHM6Ly9jbGllbnQuZXhhbXBsZS5jb206Y2xpZW50X3NlY3JldA=='
|
131
|
+
}
|
132
|
+
)
|
133
|
+
client.access_token! :basic_without_www_form_urlencode
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
120
138
|
context 'when jwt_bearer auth method specified' do
|
121
139
|
context 'when client_secret is given' do
|
122
140
|
it 'should be JWT bearer client assertion w/ auto-generated HS256-signed JWT assertion' do
|
@@ -9,11 +9,6 @@ describe Rack::OAuth2::Util do
|
|
9
9
|
'http://client.example.com/callback'
|
10
10
|
end
|
11
11
|
|
12
|
-
describe '.rfc3986_encode' do
|
13
|
-
subject { util.rfc3986_encode '=+ .-/' }
|
14
|
-
it { should == '%3D%2B%20.-%2F' }
|
15
|
-
end
|
16
|
-
|
17
12
|
describe '.www_form_url_encode' do
|
18
13
|
subject { util.www_form_url_encode '=+ .-/' }
|
19
14
|
it { should == '%3D%2B+.-%2F' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|