omniauth-matique 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -0
- data/.ruby-version +1 -1
- data/.travis.yml +4 -2
- data/.watchr +6 -13
- data/Gemfile +5 -1
- data/MIT-LICENSE +1 -1
- data/Rakefile +5 -5
- data/lib/omniauth-matique.rb +3 -1
- data/lib/omniauth-matique/version.rb +7 -3
- data/lib/omniauth/strategies/matique.rb +18 -13
- data/omniauth-matique.gemspec +3 -5
- data/test/matique_test.rb +2 -3
- data/test/test_helper.rb +7 -3
- metadata +14 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e48cb0b561ff78279781e9b5cef8619f4167cf4d631cfe3b8bf8c6f1c9a65343
|
4
|
+
data.tar.gz: 2e843cc7a3f4ac5226e722dadec8bb13d816b6b35044315193dc41a9031f7ae4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36f3b583714621b43fc2019c8c944b2ac166dd240635d0e1bb4b520b609ae4a4b50d56ba9b35d972e896b20ddb0264c71f0357e2127ebf5d8554dcfa1ca94ef5
|
7
|
+
data.tar.gz: 20fef38023b607218daaa159e6f9bc39f71700639f6c3c635f9979bd0fbc21d555425e61cd72621fe21be4812d6d79862ab191eeb3ee5092beca0aa30e028ac6
|
data/.rubocop.yml
ADDED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.6.
|
1
|
+
ruby-2.6.6
|
data/.travis.yml
CHANGED
@@ -6,14 +6,16 @@ bundler_args: --without production
|
|
6
6
|
script: 'bundle exec rake test'
|
7
7
|
|
8
8
|
rvm:
|
9
|
-
- 2.6.
|
9
|
+
- 2.6.6
|
10
|
+
# - 2.6.5
|
11
|
+
# - 2.6.4
|
10
12
|
# - 2.6.3
|
11
13
|
# - 2.6.1
|
12
14
|
# - 2.5.1
|
13
15
|
# - 2.4.1
|
14
16
|
# - 2.3.0
|
15
17
|
# - 2.2.3
|
16
|
-
- 2.0.0
|
18
|
+
# - 2.0.0
|
17
19
|
|
18
20
|
notifications:
|
19
21
|
email: false
|
data/.watchr
CHANGED
@@ -16,37 +16,30 @@ end
|
|
16
16
|
|
17
17
|
def run_it(type, file)
|
18
18
|
case type
|
19
|
-
when 'test'; run %
|
20
|
-
# when '
|
21
|
-
when 'spec'; run %Q{rspec -X #{file}}
|
19
|
+
when 'test'; run %(ruby -I test #{file})
|
20
|
+
# when 'spec'; run %(rspec -X #{file})
|
22
21
|
else; puts "#{H} unknown type: #{type}, file: #{file}"
|
23
22
|
end
|
24
23
|
end
|
25
24
|
|
26
25
|
def run_all_tests
|
27
26
|
puts "\n#{HH} Running all tests #{HH}\n"
|
28
|
-
|
29
|
-
%w{test}.each { |dir| run "rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
|
30
|
-
%w{spec}.each { |dir| run "rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
|
27
|
+
%w[test spec].each { |dir| run "rake #{dir}" if File.exist?(dir) }
|
31
28
|
end
|
32
29
|
|
33
30
|
def run_matching_files(base)
|
34
31
|
base = base.split('_').first
|
35
|
-
%w
|
32
|
+
%w[test spec].each { |type|
|
36
33
|
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
|
37
34
|
run_it type, files.join(' ') unless files.empty?
|
38
35
|
}
|
39
36
|
end
|
40
37
|
|
41
|
-
%w
|
38
|
+
%w[test spec].each { |type|
|
42
39
|
watch("#{type}/#{type}_helper\.rb") { run_all_tests }
|
40
|
+
watch('lib/.*\.rb') { run_all_tests }
|
43
41
|
watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
|
44
42
|
}
|
45
|
-
%w{rb erb haml slim}.each { |type|
|
46
|
-
watch("app/.*/(.*)\.#{type}") { |match|
|
47
|
-
run_matching_files(match[1])
|
48
|
-
}
|
49
|
-
}
|
50
43
|
|
51
44
|
# Ctrl-\ or ctrl-4
|
52
45
|
Signal.trap('QUIT') { run_all_tests }
|
data/Gemfile
CHANGED
data/MIT-LICENSE
CHANGED
data/Rakefile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
require 'bundler/gem_tasks'
|
3
1
|
require 'rake/testtask'
|
4
2
|
|
5
|
-
|
3
|
+
desc 'Run the tests.'
|
4
|
+
Rake::TestTask.new do |t|
|
5
|
+
t.libs << 'lib'
|
6
6
|
t.libs << 'test'
|
7
7
|
t.pattern = 'test/**/*_test.rb'
|
8
|
-
t.verbose =
|
8
|
+
t.verbose = false
|
9
9
|
end
|
10
10
|
|
11
|
-
task :
|
11
|
+
task default: :test
|
data/lib/omniauth-matique.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
# rubocop: disable all
|
2
|
+
|
1
3
|
module OmniAuth
|
2
4
|
module Matique
|
3
|
-
VERSION = '0.1.
|
4
|
-
#
|
5
|
-
#
|
5
|
+
VERSION = '0.1.7' # 2020-07-17
|
6
|
+
# VERSION = '0.1.6' # 2020-04-27
|
7
|
+
# VERSION = '0.1.5' # 2019-10-06
|
8
|
+
# VERSION = '0.1.4' # 2019-03-02
|
9
|
+
# VERSION = '0.1.3'
|
6
10
|
end
|
7
11
|
end
|
@@ -1,35 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'omniauth-oauth2'
|
2
4
|
|
3
5
|
module OmniAuth
|
4
6
|
module Strategies
|
5
7
|
class Matique < OmniAuth::Strategies::OAuth2
|
6
|
-
#
|
7
|
-
AUTH_URL = ENV[
|
8
|
-
# AUTH_URL = 'https://login.matique.de'
|
8
|
+
# AUTH_URL = 'https://login.matique.de'
|
9
|
+
AUTH_URL = ENV['AUTH_URL'] || 'http://localhost:3010'
|
9
10
|
STRATEGY = 'matique'
|
10
11
|
|
11
12
|
option :client_options, {
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
site: AUTH_URL,
|
14
|
+
authorize_url: "#{AUTH_URL}/auth/#{STRATEGY}/authorize",
|
15
|
+
token_url: "#{AUTH_URL}/auth/#{STRATEGY}/access_token"
|
15
16
|
}
|
16
17
|
|
17
|
-
uid { raw_info['id'] }
|
18
|
+
uid { raw_info['id'].to_s }
|
18
19
|
|
19
20
|
info do
|
20
|
-
|
21
|
+
{
|
22
|
+
name: raw_info['name'],
|
23
|
+
username: raw_info['username'],
|
24
|
+
email: raw_info['email'],
|
25
|
+
image: raw_info['avatar_url']
|
26
|
+
}
|
21
27
|
end
|
22
28
|
|
23
29
|
extra do
|
24
|
-
|
30
|
+
{raw_info: raw_info}
|
25
31
|
end
|
26
32
|
|
27
33
|
def raw_info
|
28
|
-
|
29
|
-
|
30
|
-
|
34
|
+
@raw_info ||= access_token.get(
|
35
|
+
"/auth/matique/user.json?oauth_token=#{access_token.token}"
|
36
|
+
).parsed || {}
|
31
37
|
end
|
32
|
-
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
data/omniauth-matique.gemspec
CHANGED
@@ -21,11 +21,9 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.require_paths = ['lib']
|
22
22
|
|
23
23
|
s.add_development_dependency 'bundler'
|
24
|
-
s.add_development_dependency 'rake', '~>
|
24
|
+
s.add_development_dependency 'rake', '~> 13'
|
25
25
|
s.add_dependency 'omniauth-oauth2', '~> 1'
|
26
26
|
|
27
|
-
s.add_development_dependency 'minitest'
|
28
|
-
s.add_development_dependency 'mocha'
|
29
|
-
s.add_development_dependency 'simplecov'
|
30
|
-
s.add_development_dependency 'sqlite3'
|
27
|
+
s.add_development_dependency 'minitest', '~> 5'
|
28
|
+
s.add_development_dependency 'mocha', '~> 1'
|
31
29
|
end
|
data/test/matique_test.rb
CHANGED
@@ -45,9 +45,8 @@ describe OmniAuth::Strategies::Matique do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'access email from the raw_info' do
|
48
|
-
assert_equal 'test@example.com', strategy.info[
|
49
|
-
|
50
|
-
refute_nil strategy.extra['raw_info']
|
48
|
+
assert_equal 'test@example.com', strategy.info[:email]
|
49
|
+
refute_nil strategy.extra[:raw_info]
|
51
50
|
end
|
52
51
|
end
|
53
52
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
if ENV['COVERAGE']
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start do
|
4
|
+
add_filter '/test/'
|
5
|
+
end
|
6
|
+
end
|
3
7
|
|
4
8
|
require 'bundler/setup'
|
5
9
|
require 'minitest/autorun'
|
6
|
-
require 'mocha/
|
10
|
+
require 'mocha/minitest'
|
7
11
|
require 'omniauth/strategies/matique'
|
8
12
|
|
9
13
|
OmniAuth.config.test_mode = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-matique
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13'
|
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: '
|
40
|
+
version: '13'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: omniauth-oauth2
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,58 +56,30 @@ dependencies:
|
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mocha
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: simplecov
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: sqlite3
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
73
|
+
- - "~>"
|
102
74
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
75
|
+
version: '1'
|
104
76
|
type: :development
|
105
77
|
prerelease: false
|
106
78
|
version_requirements: !ruby/object:Gem::Requirement
|
107
79
|
requirements:
|
108
|
-
- - "
|
80
|
+
- - "~>"
|
109
81
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
82
|
+
version: '1'
|
111
83
|
description: " Strategy to authenticate with matique UG via OAuth2 in OmniAuth.\n"
|
112
84
|
email:
|
113
85
|
- dittmar.krall@matique.de
|
@@ -116,6 +88,7 @@ extensions: []
|
|
116
88
|
extra_rdoc_files: []
|
117
89
|
files:
|
118
90
|
- ".gitignore"
|
91
|
+
- ".rubocop.yml"
|
119
92
|
- ".ruby-gemset"
|
120
93
|
- ".ruby-version"
|
121
94
|
- ".travis.yml"
|
@@ -151,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
124
|
- !ruby/object:Gem::Version
|
152
125
|
version: '0'
|
153
126
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
127
|
+
rubygems_version: 3.1.4
|
155
128
|
signing_key:
|
156
129
|
specification_version: 4
|
157
130
|
summary: OmniAuth strategy for matique
|