rack-oauth2 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/VERSION +1 -1
- data/lib/rack/oauth2/server.rb +1 -0
- data/lib/rack/oauth2/server/authorize/code.rb +2 -0
- data/lib/rack/oauth2/server/authorize/extension/code_and_token.rb +2 -0
- data/lib/rack/oauth2/server/extension.rb +1 -0
- data/lib/rack/oauth2/server/extension/pkce.rb +47 -0
- data/lib/rack/oauth2/server/token/authorization_code.rb +2 -0
- data/lib/rack/oauth2/util.rb +5 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a2df927b2cd7727df348e6e2c2d2822382bb207
|
4
|
+
data.tar.gz: 0cbd438ae8f7be634556bdf320721142e6ff497d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6498b5c59d3bc2ccdbe0b651956872185c3e89023c59fb1f609c8d1cc2012d0a1df926146d5d3579431d6fd5ed95498214b34fa67d8bacf7911f5d327ddb26b4
|
7
|
+
data.tar.gz: 57fafb111c251219dc32f95abb3523448e8852868873eea00e72c7bd7ba63f90750ebb69abffca6676f1eaf978101e6a883c179a55c4ebda2ad4db86a4f23b85
|
data/.travis.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
data/lib/rack/oauth2/server.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
require 'rack/oauth2/server/extension/pkce'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Rack
|
2
|
+
module OAuth2
|
3
|
+
module Server
|
4
|
+
module Extension
|
5
|
+
module PKCE
|
6
|
+
module AuthorizationRequest
|
7
|
+
def self.included(klass)
|
8
|
+
klass.send :attr_optional, :code_challenge, :code_challenge_method
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(env)
|
12
|
+
super
|
13
|
+
@code_challenge = params['code_challenge']
|
14
|
+
@code_challenge_method = params['code_challenge_method']
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module TokenRequest
|
19
|
+
def self.included(klass)
|
20
|
+
klass.send :attr_optional, :code_verifier
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(env)
|
24
|
+
super
|
25
|
+
@code_verifier = params['code_verifier']
|
26
|
+
end
|
27
|
+
|
28
|
+
def verify_code_verifier!(code_challenge, code_challenge_method = :S256)
|
29
|
+
if code_verifier.present? || code_challenge.present?
|
30
|
+
case code_challenge_method.try(:to_sym)
|
31
|
+
when :S256
|
32
|
+
code_challenge == Util.urlsafe_base64_encode(
|
33
|
+
OpenSSL::Digest::SHA256.digest(code_verifier.to_s)
|
34
|
+
) or invalid_grant!
|
35
|
+
when :plain
|
36
|
+
code_challenge == code_verifier or invalid_grant!
|
37
|
+
else
|
38
|
+
invalid_grant!
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/rack/oauth2/util.rb
CHANGED
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.4.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: 2016-
|
11
|
+
date: 2016-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -201,6 +201,8 @@ files:
|
|
201
201
|
- lib/rack/oauth2/server/authorize/extension.rb
|
202
202
|
- lib/rack/oauth2/server/authorize/extension/code_and_token.rb
|
203
203
|
- lib/rack/oauth2/server/authorize/token.rb
|
204
|
+
- lib/rack/oauth2/server/extension.rb
|
205
|
+
- lib/rack/oauth2/server/extension/pkce.rb
|
204
206
|
- lib/rack/oauth2/server/rails.rb
|
205
207
|
- lib/rack/oauth2/server/rails/authorize.rb
|
206
208
|
- lib/rack/oauth2/server/rails/response_ext.rb
|