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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44e71490c8d6dd25608eb34a26f74b59e82e71a3
4
- data.tar.gz: 30fa676aa47773f1deaca97e012e15e01b21b61a
3
+ metadata.gz: 1c95e333012ef38f81ceee7a5a2c431d33ecbf1d
4
+ data.tar.gz: 2e805901112a1968d5c7e21eab8db7a5f5187aa3
5
5
  SHA512:
6
- metadata.gz: 0c99f9985082770696469a20ec4e27a1bf1b35defa46b56f1b28179470c24745bf25fd21e1a5bc12d1e56979c13732e96b53ffb4fb1f22eab47bb6dad5714984
7
- data.tar.gz: bdf54aa02a767397733400f20d581c3f317a142e32280c6090dae0011c96a84423f105a81b696b67f8983a744724a9eea6ea2e6b4a65e9fcbed4f3902de402df
6
+ metadata.gz: a14d4bd9c67834b5a2d1384c8140396cc9a3ac261aed4d69278e4b52cfd5c95a0717f87d84af064ca46eaf8e22004e6c7e6127b84ae4335229f33cd0f7283685
7
+ data.tar.gz: 0ebb2d51b8c517b1de6b13afcf403fdfdaaa3d72692a43abf8155c459b97457d9d1f2cfe6cb2c0cd882ccd283a8bd3d6cac7bc51280919f6b8667115580b5f2e
@@ -19,7 +19,9 @@ module Doorkeeper
19
19
  end
20
20
 
21
21
  def self.secret_key
22
- secret_key_file || Doorkeeper::JWT.configuration.secret_key
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
@@ -1,5 +1,5 @@
1
1
  module Doorkeeper
2
2
  module JWT
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doorkeeper-jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Warren