omniauth-infinum_id 1.1.0 → 1.2.1

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
- SHA256:
3
- metadata.gz: 5df7e0d044bddd2bada745532374e15474d4df2beaac14a428ebedf639d781a9
4
- data.tar.gz: 67233c9d173a0c90dd7a9691d3ab0f377da36a79868c95debe0c677cec68d22d
2
+ SHA1:
3
+ metadata.gz: af0e0754168c4a545fd2c8fe585f1e6aa7ac5e47
4
+ data.tar.gz: ab886d589021da83912cd684f0d0b10da9f98226
5
5
  SHA512:
6
- metadata.gz: 875353c72c60cff51a7c35f57d47a558fab8d5d129f3709e086e644152b8e39dac5979f6a0cca839a4311b6fa3139f4bbfd8db1f92ebe05be8f6c3b8ac64fd5e
7
- data.tar.gz: 5dbf24eee95ac1a304d1b0bea0d6fac853db9002bfc09581f235139d903ae47ca3d039e1977ce40b06389f449f0af88b143b26a8796a224435f9a44f0affafee
6
+ metadata.gz: 4f3f8e96a4c3c364a7463d6bf0ee7501b18405562332a2eb48dec84f06be3e7c878df1fc1d6f6b22dbac542015bb96c4a42acdd3fe856274e6bc6e6e0137fd84
7
+ data.tar.gz: 19172c5afce3b47abc4b955b0e66946afee90669175be169661adfebb5a773f4cf0a02ab0dbcb547902da6ad081867285fe6be42eef547904edb43b177f99035
@@ -1,56 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-infinum_id (1.1.0)
4
+ omniauth-infinum_id (1.2.1)
5
5
  omniauth-oauth2
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- diff-lcs (1.3)
11
- faraday (0.15.4)
10
+ diff-lcs (1.4.4)
11
+ faraday (1.0.1)
12
12
  multipart-post (>= 1.2, < 3)
13
- hashie (3.6.0)
14
- jwt (2.2.1)
15
- multi_json (1.13.1)
13
+ hashie (4.1.0)
14
+ jwt (2.2.2)
15
+ multi_json (1.15.0)
16
16
  multi_xml (0.6.0)
17
17
  multipart-post (2.1.1)
18
- oauth2 (1.4.1)
19
- faraday (>= 0.8, < 0.16.0)
18
+ oauth2 (1.4.4)
19
+ faraday (>= 0.8, < 2.0)
20
20
  jwt (>= 1.0, < 3.0)
21
21
  multi_json (~> 1.3)
22
22
  multi_xml (~> 0.5)
23
23
  rack (>= 1.2, < 3)
24
- omniauth (1.9.0)
25
- hashie (>= 3.4.6, < 3.7.0)
24
+ omniauth (1.9.1)
25
+ hashie (>= 3.4.6)
26
26
  rack (>= 1.6.2, < 3)
27
- omniauth-oauth2 (1.6.0)
28
- oauth2 (~> 1.1)
27
+ omniauth-oauth2 (1.7.0)
28
+ oauth2 (~> 1.4)
29
29
  omniauth (~> 1.9)
30
- rack (2.0.7)
31
- rake (10.5.0)
32
- rspec (3.8.0)
33
- rspec-core (~> 3.8.0)
34
- rspec-expectations (~> 3.8.0)
35
- rspec-mocks (~> 3.8.0)
36
- rspec-core (3.8.0)
37
- rspec-support (~> 3.8.0)
38
- rspec-expectations (3.8.2)
30
+ rack (2.2.3)
31
+ rake (13.0.1)
32
+ rspec (3.9.0)
33
+ rspec-core (~> 3.9.0)
34
+ rspec-expectations (~> 3.9.0)
35
+ rspec-mocks (~> 3.9.0)
36
+ rspec-core (3.9.2)
37
+ rspec-support (~> 3.9.3)
38
+ rspec-expectations (3.9.2)
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.8.0)
41
- rspec-mocks (3.8.0)
40
+ rspec-support (~> 3.9.0)
41
+ rspec-mocks (3.9.1)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.8.0)
44
- rspec-support (3.8.0)
43
+ rspec-support (~> 3.9.0)
44
+ rspec-support (3.9.3)
45
45
 
46
46
  PLATFORMS
47
47
  ruby
48
48
 
49
49
  DEPENDENCIES
50
- bundler (~> 1.16)
50
+ bundler (~> 2.1)
51
51
  omniauth-infinum_id!
52
- rake (~> 10.0)
52
+ rake (~> 13.0)
53
53
  rspec (~> 3.0)
54
54
 
55
55
  BUNDLED WITH
56
- 1.17.3
56
+ 2.1.4
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Omniauth::InfinumId
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/infinum_id`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Strategy to authenticate with [InfinumID](https://github.com/infinum/rails-infinum-id) via OAuth2 in OmniAuth.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ This gem is being used inside [infinum_id-engine](https://github.com/infinum/rails-infinum-id-engine).
6
6
 
7
7
  ## Installation
8
8
 
@@ -22,7 +22,41 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ Name of the strategy is `infinum_id`.
26
+
27
+ Initialize omniauth inside devise:
28
+
29
+ ```ruby
30
+ # config/initializers/devise.rb
31
+
32
+ config.omniauth(
33
+ :infinum_id,
34
+ 'InfinumID_client_id',
35
+ 'InfinumID_client_secret',
36
+ client_options: { site: 'InfinumID_url' }
37
+ )
38
+ ```
39
+
40
+ When user is authenticated via omniauth, strategy will parse users info into following:
41
+
42
+ ```ruby
43
+ {
44
+ "provider" => "infinum_id",
45
+ "uid" => 17, # ID_OF_USER_ON_INFINUM_ID_SERVER
46
+ "info" =>
47
+ {
48
+ "email" => 'mirko.mirkec@infinum.hr',
49
+ "first_name" => 'Mirko',
50
+ "last_name" => 'Mirkec',
51
+ "slack_username" => 'mmirkec',
52
+ "time_zone" => 'Zagreb', # Name of time zone
53
+ "deactivated_at" => nil, # DateTime when user was deactivated or nil if it's not
54
+ "avatar_url" => nil # Remote url to user profile picture
55
+ }
56
+ }
57
+ ```
58
+
59
+ Lastly, callback method should be created with same name as strategy, in this case `infinum_id`, inside `OmniauthCallbackController`. In this method user should be authenticated and signed in.
26
60
 
27
61
  ## Development
28
62
 
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module InfinumId
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.1'
4
4
  end
5
5
  end
@@ -17,7 +17,8 @@ module OmniAuth
17
17
  slack_username: raw_info['slack_username'],
18
18
  time_zone: raw_info['time_zone'],
19
19
  deactivated_at: raw_info['deactivated_at'],
20
- avatar_url: raw_info['avatar_url']
20
+ avatar_url: raw_info['avatar_url'],
21
+ employee: raw_info['employee']
21
22
  }
22
23
  end
23
24
 
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ['lib']
33
33
 
34
- spec.add_development_dependency 'bundler', '~> 1.16'
35
- spec.add_development_dependency 'rake', '~> 10.0'
34
+ spec.add_development_dependency 'bundler', '~> 2.1'
35
+ spec.add_development_dependency 'rake', '~> 13.0'
36
36
  spec.add_development_dependency 'rspec', '~> 3.0'
37
37
 
38
38
  spec.add_dependency 'omniauth-oauth2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-infinum_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dajana Jeroncic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-12 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '2.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.7.6
113
+ rubygems_version: 2.6.11
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Write a short summary, because RubyGems requires one.