doorkeeper-jwt 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/doorkeeper-jwt.rb +16 -7
- data/lib/doorkeeper-jwt/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9ccfe46d3353aab84a2a11554970f4c8d784824
|
4
|
+
data.tar.gz: a674ffb947b6df31dcf1dd1fdefc660530a9d3b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 598c6248361ad6cf25e1bd5df14720696a1e671d13c808ad06217e3f54b3aa1ae01e8664bebef975bb225bea6837bcd7db67d6aa7c58c88a4f518c372ac5dab2
|
7
|
+
data.tar.gz: 5103722a7035d3b494a5b2ee79f61559980d2b4b5234a2269ddc206bb9eea8689146e6da13a5e1cbde01fdec5c64ecca3e0ab377e6bc27c31d8617b160f800d0
|
data/README.md
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
|
5
5
|
# Doorkeeper::JWT
|
6
6
|
|
7
|
-
Doorkeeper JWT adds JWT token support to the Doorkeeper OAuth library. Requires Doorkeeper 2.2.0 or newer.
|
7
|
+
Doorkeeper JWT adds JWT token support to the Doorkeeper OAuth library. Requires Doorkeeper 2.2.0 or newer.
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'doorkeeper'
|
10
|
+
gem 'doorkeeper'
|
11
11
|
```
|
12
12
|
|
13
13
|
## Installation
|
data/lib/doorkeeper-jwt.rb
CHANGED
@@ -45,9 +45,18 @@ module Doorkeeper
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def application_secret(opts)
|
48
|
-
opts
|
49
|
-
|
50
|
-
|
48
|
+
if opts[:application].nil?
|
49
|
+
fail "JWT `use_application_secret` is enabled but application is " \
|
50
|
+
"nil. This can happen if `client_id` was absent in the request " \
|
51
|
+
"params."
|
52
|
+
end
|
53
|
+
|
54
|
+
if opts[:application][:secret].nil?
|
55
|
+
fail "JWT `use_application_secret` is enabled but the application " \
|
56
|
+
"secret is nil."
|
57
|
+
end
|
58
|
+
|
59
|
+
opts[:application][:secret]
|
51
60
|
end
|
52
61
|
|
53
62
|
def rsa_encryption?
|
@@ -67,15 +76,15 @@ module Doorkeeper
|
|
67
76
|
end
|
68
77
|
|
69
78
|
def rsa_key_file
|
70
|
-
OpenSSL::PKey::RSA.new(
|
79
|
+
secret_key_file_open { |f| OpenSSL::PKey::RSA.new(f) }
|
71
80
|
end
|
72
81
|
|
73
82
|
def ecdsa_key_file
|
74
|
-
OpenSSL::PKey::EC.new(
|
83
|
+
secret_key_file_open { |f| OpenSSL::PKey::EC.new(f) }
|
75
84
|
end
|
76
85
|
|
77
|
-
def secret_key_file_open
|
78
|
-
File.open(Doorkeeper::JWT.configuration.secret_key_path)
|
86
|
+
def secret_key_file_open(&block)
|
87
|
+
File.open(Doorkeeper::JWT.configuration.secret_key_path, &block)
|
79
88
|
end
|
80
89
|
end
|
81
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Warren
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.4.
|
148
|
+
rubygems_version: 2.4.8
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: JWT token generator for Doorkeeper
|