doorkeeper-jwt 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/doorkeeper-jwt.rb +11 -1
- data/lib/doorkeeper-jwt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c95e333012ef38f81ceee7a5a2c431d33ecbf1d
|
4
|
+
data.tar.gz: 2e805901112a1968d5c7e21eab8db7a5f5187aa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a14d4bd9c67834b5a2d1384c8140396cc9a3ac261aed4d69278e4b52cfd5c95a0717f87d84af064ca46eaf8e22004e6c7e6127b84ae4335229f33cd0f7283685
|
7
|
+
data.tar.gz: 0ebb2d51b8c517b1de6b13afcf403fdfdaaa3d72692a43abf8155c459b97457d9d1f2cfe6cb2c0cd882ccd283a8bd3d6cac7bc51280919f6b8667115580b5f2e
|
data/lib/doorkeeper-jwt.rb
CHANGED
@@ -19,7 +19,9 @@ module Doorkeeper
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.secret_key
|
22
|
-
secret_key_file
|
22
|
+
return secret_key_file if !secret_key_file.nil?
|
23
|
+
return rsa_key if rsa_encryption?
|
24
|
+
Doorkeeper::JWT.configuration.secret_key
|
23
25
|
end
|
24
26
|
|
25
27
|
def self.secret_key_file
|
@@ -33,5 +35,13 @@ module Doorkeeper
|
|
33
35
|
return nil unless Doorkeeper::JWT.configuration.encryption_method
|
34
36
|
Doorkeeper::JWT.configuration.encryption_method.to_s.upcase
|
35
37
|
end
|
38
|
+
|
39
|
+
def self.rsa_encryption?
|
40
|
+
/RS\d{3}/ =~ encryption_method
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.rsa_key
|
44
|
+
OpenSSL::PKey::RSA.new(Doorkeeper::JWT.configuration.secret_key)
|
45
|
+
end
|
36
46
|
end
|
37
47
|
end
|