omniauth-doximity-oauth2 1.2.0.pre → 1.2.0.pre.3

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
  SHA256:
3
- metadata.gz: 7a115db51c6901227e768b5d4e6b3936cece507e74e95c56e863df69ea8df6a9
4
- data.tar.gz: d271503b99bac24d5c48f2671f50d2fee7f2d76f154a6964910e567af76f8f5c
3
+ metadata.gz: 1642591775f515a59d09b10e8a33847385dd631f7b56e5f66189498ac1a5d85c
4
+ data.tar.gz: f72018f59d00f2e9e5797f4fdb4a5b424e35ab90d5bba5f6341adcd1f2cdd155
5
5
  SHA512:
6
- metadata.gz: d3e64fd03c57ced3f0b77ebb95a0ef3b8d32e6907ad16d3b65da5fc314f1a4085ed7c7b0b2d6b89dadfc67a641d5693bfa71ff9b8348d3b292cb03e55ad5f04b
7
- data.tar.gz: '0208112352a8904c69b7a54c602c10f3e017881efc73f6e5e257bf9bca130288fd3438aa35bdac7f2dcd697004f077bd0fc5fc9833a1e290ba5c8d3794ab894e'
6
+ metadata.gz: 05c9241df99c419635cc04f0b58c05eea994b1d6a86f804bc0370684562e30f357879d3b3de5ebaf42716760247b1b79bd79b72197dab8762960f6699f8ee9ae
7
+ data.tar.gz: 38428772017194b3f928900a41b0a9ad8990b15ada8b910e92aab556f5871732b87075de1dfe575469bafae7134fd9c46a48162924a2eb0952f55af62d4969c8
data/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- ## 1.2.0.pre - 05/05/2023
4
+ ## 1.2.0.pre.3 - 05/05/2023
5
5
  * Update mechanism for verifying RSA public keys to work on OpenSSL 3
6
6
  * Ensure state persists between initial call and on callback
7
7
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-doximity-oauth2 (1.2.0.pre)
4
+ omniauth-doximity-oauth2 (1.2.0.pre.3)
5
5
  activesupport
6
6
  faraday
7
7
  jwt
@@ -102,7 +102,7 @@ module OmniAuth
102
102
  keys = request_keys
103
103
 
104
104
  public_key_params = keys.find { |key| key["kid"] == header["kid"] }
105
- rsa_key = Crypto.create_rsa_key(public_key_params["n"], public_key_params["e"])
105
+ rsa_key = OmniAuth::DoximityOauth2::Crypto.create_rsa_key(public_key_params["n"], public_key_params["e"])
106
106
 
107
107
  body, = JWT.decode(token, rsa_key.public_key, true, { algorithm: header["alg"] })
108
108
  body
@@ -1,29 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Omniauth
3
+ module OmniAuth
4
4
  module DoximityOauth2
5
5
  # Static crypto methods
6
6
  class Crypto
7
- def self.create_rsa_key(n, e)
8
- data_sequence = OpenSSL::ASN1::Sequence([
9
- OpenSSL::ASN1::Integer(base64_to_long(n)),
10
- OpenSSL::ASN1::Integer(base64_to_long(e))
11
- ])
12
- asn1 = OpenSSL::ASN1::Sequence(data_sequence)
13
- OpenSSL::PKey::RSA.new(asn1.to_der)
14
- end
7
+ class << self
8
+ def create_rsa_key(n, e)
9
+ data_sequence = OpenSSL::ASN1::Sequence([
10
+ OpenSSL::ASN1::Integer(base64_to_long(n)),
11
+ OpenSSL::ASN1::Integer(base64_to_long(e))
12
+ ])
13
+ asn1 = OpenSSL::ASN1::Sequence(data_sequence)
14
+ OpenSSL::PKey::RSA.new(asn1.to_der)
15
+ end
15
16
 
16
- private
17
+ private
17
18
 
18
- def base64_to_long(data)
19
- decoded_with_padding = Base64.urlsafe_decode64(data) + Base64.decode64("==")
20
- decoded_with_padding.to_s.unpack("C*").map do |byte|
21
- byte_to_hex(byte)
22
- end.join.to_i(16)
23
- end
19
+ def base64_to_long(data)
20
+ decoded_with_padding = Base64.urlsafe_decode64(data) + Base64.decode64("==")
21
+ decoded_with_padding.to_s.unpack("C*").map do |byte|
22
+ byte_to_hex(byte)
23
+ end.join.to_i(16)
24
+ end
24
25
 
25
- def byte_to_hex(int)
26
- int < 16 ? "0#{int.to_s(16)}" : int.to_s(16)
26
+ def byte_to_hex(int)
27
+ int < 16 ? "0#{int.to_s(16)}" : int.to_s(16)
28
+ end
27
29
  end
28
30
  end
29
31
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Omniauth
3
+ module OmniAuth
4
4
  module DoximityOauth2
5
5
  # Error for failed request to get public keys, for JWK verification
6
6
  class JWKSRequestError < StandardError
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Omniauth
3
+ module OmniAuth
4
4
  module DoximityOauth2
5
- VERSION = "1.2.0.pre"
5
+ VERSION = "1.2.0.pre.3"
6
6
  end
7
7
  end
@@ -5,7 +5,7 @@ require File.expand_path('lib/omniauth-doximity-oauth2/version', __dir__)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "omniauth-doximity-oauth2"
8
- spec.version = Omniauth::DoximityOauth2::VERSION
8
+ spec.version = OmniAuth::DoximityOauth2::VERSION
9
9
  spec.authors = ["William Harvey"]
10
10
  spec.email = ["wharvey@doximity.com"]
11
11
  spec.description = 'OmniAuth strategy for Doximity, supporting OIDC, and using PKCE'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-doximity-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.pre
4
+ version: 1.2.0.pre.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Harvey