omniauth-globalid 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb02c58ca0c780feb42b7518bf4fe51b297a296dee418dbb13f9b2287f8d0d29
4
- data.tar.gz: 76eee540664df39fd0d64b596c99b20fd82a0c7aeb1f5865c65f1d3bb30a7c89
3
+ metadata.gz: 9c564c5362740d38c5a31e3dbccba87586db783127a3416a7f0e55dc13429caa
4
+ data.tar.gz: 5b6b0484eacbf3ebab858cfd3e757261753d34c675e10984279e5f99699657fd
5
5
  SHA512:
6
- metadata.gz: ad5836f727bdfe6a9a50971c4e06b98a50af2a788bfaf6204de0f1ab2908e3a2fcfa5c2ba3fc25dbad2ea87c9993bf9adc91c8c27a47ea109e769ca7da1aac63
7
- data.tar.gz: ab52c6695f2a1a68234e02775a0332053c6e70ec42515735a04273593cc4a99777d98b3639cde18afca769bbde80a9e49a734cefa0f9fa8fff08bb8520126c97
6
+ metadata.gz: 0362dbaf66eef9378c048020f41773d2723857a9a49f0ada7fa05c67f7d31ac8532e0f67164a8bf9fbe4252ecab5ad5dbc7f41222bedeb4c5744de618685c99c
7
+ data.tar.gz: 907a483a2acbb90088c9e6860e92c1d79157875e5b660bed1855b0e18d062e02c9562448ae1421f19153fe27fc0b15d308da6fc71d20ba4cc95ca787dca8612b
@@ -3,16 +3,15 @@
3
3
  module OmniAuth
4
4
  module Globalid
5
5
  class Vault
6
- def initialize(openid_token: nil, token_url: nil, client_id: nil, client_secret: nil, redirect_uri: nil)
6
+ def initialize(openid_token: nil, token_url: nil, client_id: nil, client_secret: nil,
7
+ redirect_uri: nil, private_key: nil, private_key_pass: nil)
7
8
  @openid_token = openid_token
8
9
  # TODO: Figure out a cleaner way to implement this!
9
10
  @token_url = token_url || "https://api.globalid.net/v1/auth/token"
10
11
  @client_id = client_id || ENV["GLOBALID_CLIENT_ID"]
11
12
  @client_secret = client_secret || ENV["GLOBALID_CLIENT_SECRET"]
12
13
  @redirect_uri = redirect_uri || ENV["GLOBALID_REDIRECT_URL"]
13
- if ENV["GLOBALID_PRIVATE_KEY"]&.length
14
- @private_key = OpenSSL::PKey::RSA.new(ENV["GLOBALID_PRIVATE_KEY"], ENV["GLOBALID_PRIVATE_KEY_PASS"])
15
- end
14
+ @private_key = OpenSSL::PKey::RSA.new(private_key, private_key_pass)
16
15
  end
17
16
 
18
17
  attr_accessor :openid_token, :private_key
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Globalid
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
@@ -47,6 +47,7 @@ module OmniAuth
47
47
  description: raw_info["description"],
48
48
  image: raw_info["display_image_url"],
49
49
  location: location(raw_info),
50
+ email: decrypted_pii,
50
51
  }.merge(id_token: openid_token)
51
52
  .merge(decrypted_pii: decrypted_pii)
52
53
  end
@@ -70,7 +71,7 @@ module OmniAuth
70
71
  end
71
72
 
72
73
  def decrypted_pii
73
- return {} unless @openid_token.keys.any? && options[:decrypt_pii_on_login]
74
+ return {} unless openid_token.keys.any? && options[:decrypt_pii_on_login]
74
75
  @decrypted_pii ||= vault.decrypted_pii
75
76
  end
76
77
 
@@ -89,7 +90,9 @@ module OmniAuth
89
90
  token_url: options[:token_url],
90
91
  client_id: options[:client_id],
91
92
  client_secret: options[:client_secret],
92
- redirect_uri: options[:redirect_uri])
93
+ redirect_uri: options[:redirect_uri],
94
+ private_key: options[:private_key],
95
+ private_key_pass: options[:private_key_pass])
93
96
  end
94
97
 
95
98
  def acrc_id_in_request?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-globalid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Herr