omniauth-infinum_azure 0.1.7 → 0.3.0

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: 5f3293acb8cb3c28513fa2074257e56379aa9eb241eecde33fa46920fbad4459
4
- data.tar.gz: f1b76ea5f410097d31de6a35235a070f130057b637d362a71faa298d6eda79a0
3
+ metadata.gz: 2500782d665615534b203f408ce34b1a62bb7f20b1e1157b61407c430526cd70
4
+ data.tar.gz: 7efd370f76da93a58066a11d026818f4ce3567eee9eb023143e7c3f3a39f4a9a
5
5
  SHA512:
6
- metadata.gz: 8c83144243122e6b82c34bac96a4c11db2ec2e25638165bb3ec1b256c1ac660e5463f7c4e133e99e96d6d121ac348ce0b00e4bce40b3f65d00f174bb2c1fc68b
7
- data.tar.gz: 4ecbe18123fb2e2fb2e079ec07e301f70ddde3ee6fa5b8d0ef57f167ca170a4d786ef71d8d0fa6339ea1010c89e27314ae82e30f8c3cb3ceb1a1a010b8bcbf95
6
+ metadata.gz: 9d7c882dffaba7ce875458fea4995af5f4b86818694ab8774d90f983bd49c87f734e360e6ddf239a2937a5f7e672ec2c9b97855440c65d0f117e466d8fd56c0f
7
+ data.tar.gz: e918d56939e2bcbf36646a448d94fe1b72886363da5811fb41a01ca034590e4291e854acbdc583a3789f0a837cc0c6a3eff796d990d0e40db87ee0c532736fad
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.0] - 2023-06-14
4
+
5
+ - Add *provider_groups*, *avatar_url*, *deactivated_at* and *employee* to `#info`
6
+
7
+ ## [0.2.0] - 2023-04-04
8
+
9
+ - Fix issue with Azure payload (emails array changed to email string)
10
+ - Add first_name and last_name to `info`
11
+
3
12
  ## [0.1.7] - 2023-04-04
4
13
 
5
14
  - Change policy ID to allow signin and signup
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-infinum_azure (0.1.7)
4
+ omniauth-infinum_azure (0.3.0)
5
5
  omniauth-oauth2
6
6
 
7
7
  GEM
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omniauth
4
4
  module InfinumAzure
5
- VERSION = '0.1.7'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'time'
4
+
3
5
  module OmniAuth
4
6
  module Strategies
5
7
  class InfinumAzure < OmniAuth::Strategies::OAuth2
@@ -40,8 +42,14 @@ module OmniAuth
40
42
 
41
43
  info do
42
44
  {
43
- email: raw_info['emails'][0],
44
- name: raw_info['name']
45
+ email: raw_info['email'],
46
+ name: raw_info['name'],
47
+ first_name: raw_info['given_name'],
48
+ last_name: raw_info['family_name'],
49
+ provider_groups: raw_info['extension_userGroup'],
50
+ avatar_url: raw_info['extension_avatarUrl'],
51
+ deactivated_at: deactivated_at,
52
+ employee: employee
45
53
  }
46
54
  end
47
55
 
@@ -57,6 +65,16 @@ module OmniAuth
57
65
  def raw_info
58
66
  @raw_info ||= ::JWT.decode(access_token.token, nil, false).first
59
67
  end
68
+
69
+ private
70
+
71
+ def deactivated_at
72
+ raw_info['extension_deactivated'] == false ? nil : Time.now.utc
73
+ end
74
+
75
+ def employee
76
+ raw_info['extension_userGroup'].include?('employees')
77
+ end
60
78
  end
61
79
  end
62
80
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-infinum_azure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marko Ćilimković
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-04 00:00:00.000000000 Z
11
+ date: 2023-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler