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 +4 -4
- data/lib/omniauth/globalid/vault.rb +3 -4
- data/lib/omniauth/globalid/version.rb +1 -1
- data/lib/omniauth/strategies/globalid.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c564c5362740d38c5a31e3dbccba87586db783127a3416a7f0e55dc13429caa
|
4
|
+
data.tar.gz: 5b6b0484eacbf3ebab858cfd3e757261753d34c675e10984279e5f99699657fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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
|
-
|
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
|
@@ -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
|
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?
|