omniauth-globalid 0.0.5 → 0.0.6

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: 3e1578034a025780ef56592bcfebc4730196eed91c6d0df8c5305dfbd85faf68
4
- data.tar.gz: f16903d4578d012ba9debd4cf9b518951a429b44f0f52633077a21057bfe6a0b
3
+ metadata.gz: 83940bd4e20de0706280b37adb6fbf87f1d7ae4b5a72609f6e6799ae5588d309
4
+ data.tar.gz: 22717588305d36395cf352e8185a51bde0ecbed1625d64277e39d829ad64566d
5
5
  SHA512:
6
- metadata.gz: 4271bb18cdcd19796a87b8d0f3d1ae94c4a7b3cc3e1f1a2f9872e99e575e79bc9f0dc19122f98bf6e99e56891754ee656252a6956c957dd88f1729ad0f323da5
7
- data.tar.gz: 27a0f3ab4ddbeeeda65920ec376f02271a811cb2f73f65a4d9d9dcc809ab103f03338f9ff0b2abfc25e97e6c46635b2dd508e64fcc4a5dc0b59e837edcf0d252
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
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Globalid
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  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.5
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-06-27 00:00:00.000000000 Z
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
- rubyforge_project:
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