omniauth-globalid 0.0.5 → 0.0.6
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/strategies/globalid.rb +27 -1
- data/lib/omniauth-globalid/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83940bd4e20de0706280b37adb6fbf87f1d7ae4b5a72609f6e6799ae5588d309
|
|
4
|
+
data.tar.gz: 22717588305d36395cf352e8185a51bde0ecbed1625d64277e39d829ad64566d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 962d6041ad635b47b11b9a2fd83c9d4fcf594d9c8ea3122d4bb066bb98b6fd466782c236995f61457e3e54fc7460b5f76eb43fa831856b07896bb4033d05c981
|
|
7
|
+
data.tar.gz: e3eee64ba5384822570dfb1995afe387e50e8287d471728d390d6bcfbdf54082d34183d1ca04c6e31b6e5da7ae574bd67332c75aff1c359f41643828f72ff71e
|
|
@@ -4,7 +4,7 @@ module OmniAuth
|
|
|
4
4
|
module Strategies
|
|
5
5
|
class Globalid < OmniAuth::Strategies::OAuth2
|
|
6
6
|
option :name, "globalid"
|
|
7
|
-
DEFAULT_SCOPE = "public"
|
|
7
|
+
DEFAULT_SCOPE = "public".freeze
|
|
8
8
|
|
|
9
9
|
option :client_options, site: "https://auth.global.id",
|
|
10
10
|
authorize_url: "/",
|
|
@@ -17,6 +17,16 @@ module OmniAuth
|
|
|
17
17
|
|
|
18
18
|
uid { raw_info["gid_uuid"] }
|
|
19
19
|
|
|
20
|
+
info do
|
|
21
|
+
{
|
|
22
|
+
nickname: nickname(raw_info),
|
|
23
|
+
name: raw_info["display_name"],
|
|
24
|
+
description: raw_info["description"],
|
|
25
|
+
image: raw_info["display_image_url"],
|
|
26
|
+
location: location(raw_info),
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
20
30
|
def raw_info
|
|
21
31
|
return @raw_info if defined?(@raw_info)
|
|
22
32
|
result = api_connection.get("/v1/identities/me")
|
|
@@ -32,6 +42,22 @@ module OmniAuth
|
|
|
32
42
|
conn.adapter Faraday.default_adapter
|
|
33
43
|
end
|
|
34
44
|
end
|
|
45
|
+
|
|
46
|
+
def location(raw_info)
|
|
47
|
+
location = [
|
|
48
|
+
raw_info["metro_name"],
|
|
49
|
+
raw_info["state_name"],
|
|
50
|
+
raw_info["country_code"],
|
|
51
|
+
].compact.map(&:strip).reject(&:empty?)
|
|
52
|
+
|
|
53
|
+
return if location.empty?
|
|
54
|
+
|
|
55
|
+
location.join(", ")
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def nickname(raw_info)
|
|
59
|
+
raw_info["gid_name"] if raw_info["gid_name_moderation_status"] == "accepted"
|
|
60
|
+
end
|
|
35
61
|
end
|
|
36
62
|
end
|
|
37
63
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-globalid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Seth Herr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-09-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: omniauth
|
|
@@ -97,8 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
97
97
|
- !ruby/object:Gem::Version
|
|
98
98
|
version: '0'
|
|
99
99
|
requirements: []
|
|
100
|
-
|
|
101
|
-
rubygems_version: 2.7.8
|
|
100
|
+
rubygems_version: 3.0.3
|
|
102
101
|
signing_key:
|
|
103
102
|
specification_version: 4
|
|
104
103
|
summary: OmniAuth strategy for GlobaliD
|