omniauth-matique 0.1.1 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/rake.yml +24 -0
- data/.gitignore +0 -1
- data/.rubocop.yml +12 -0
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/.watchr +11 -9
- data/Gemfile +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +1 -2
- data/Rakefile +5 -5
- data/lib/omniauth-matique.rb +3 -1
- data/lib/omniauth-matique/version.rb +8 -1
- data/lib/omniauth/strategies/matique.rb +18 -13
- data/omniauth-matique.gemspec +5 -2
- data/test/matique_test.rb +2 -3
- data/test/oauth2strategy_test.rb +1 -0
- data/test/test_helper.rb +7 -3
- metadata +39 -11
- data/.travis.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 93e81786297f0571cc96ac931ac6a92585e75cdd12c0dcfcb083d20f0f26437b
|
4
|
+
data.tar.gz: ee4cf38472bf0256484d5431d09f909903b23e45e71690f630b4e44e004e751b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20f88245da0999fc8029546172fc685d64392bdba64f0695cb08caccc74c5b8b4fd9afc7ebf3ad2b910cfb26034ed17ea81ec92a29ad3d9727c02599f060d581
|
7
|
+
data.tar.gz: 4b1d6ca038cbd559497661ee84e5fbcfedd3865466595691c2663854f9a4fbf83fae4abb1070e8384203c1a6ff30e6585b1d7e598ab7a914384932753cce46c5
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Rake
|
2
|
+
|
3
|
+
#on: [push, pull_request]
|
4
|
+
on: [push]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
test:
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
# os: [ubuntu-latest, macos-latest]
|
12
|
+
os: [ubuntu-latest]
|
13
|
+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
14
|
+
# ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
|
15
|
+
ruby: [2.7]
|
16
|
+
runs-on: ${{ matrix.os }}
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
24
|
+
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails-
|
1
|
+
rails-6.1
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.7.2
|
data/.watchr
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
TESTING = %w[test]
|
1
2
|
HH = '#' * 22 unless defined?(HH)
|
2
3
|
H = '#' * 5 unless defined?(H)
|
3
4
|
|
@@ -16,33 +17,34 @@ end
|
|
16
17
|
|
17
18
|
def run_it(type, file)
|
18
19
|
case type
|
19
|
-
when 'test'; run %
|
20
|
-
when 'spec'; run %
|
20
|
+
when 'test'; run %(bundle exec ruby -I test #{file})
|
21
|
+
# when 'spec'; run %(rspec -X #{file})
|
21
22
|
else; puts "#{H} unknown type: #{type}, file: #{file}"
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
26
|
def run_all_tests
|
26
27
|
puts "\n#{HH} Running all tests #{HH}\n"
|
27
|
-
|
28
|
-
%w{spec}.each { |dir| run "rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
|
28
|
+
TESTING.each { |dir| run "bundle exec rake #{dir}" if File.exist?(dir) }
|
29
29
|
end
|
30
30
|
|
31
31
|
def run_matching_files(base)
|
32
32
|
base = base.split('_').first
|
33
|
-
|
33
|
+
TESTING.each { |type|
|
34
34
|
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
|
35
35
|
run_it type, files.join(' ') unless files.empty?
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
39
|
-
|
39
|
+
TESTING.each { |type|
|
40
40
|
watch("#{type}/#{type}_helper\.rb") { run_all_tests }
|
41
|
+
watch('lib/.*\.rb') { run_all_tests }
|
41
42
|
watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
|
42
43
|
}
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
|
45
|
+
%w[rb erb haml slim].each { |type|
|
46
|
+
watch(".*/(.*)\.#{type}") { |match|
|
47
|
+
run_matching_files(match[1])
|
46
48
|
}
|
47
49
|
}
|
48
50
|
|
data/Gemfile
CHANGED
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
Omniauth-Matique
|
2
2
|
================
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/omniauth-matique.svg)](https://badge.fury.io/rb/omniauth-matique)
|
4
|
-
[![Build Status](https://travis-ci.org/matique/omniauth-matique.png?branch=master)](https://travis-ci.org/matique/omniauth-matique)
|
5
4
|
|
6
5
|
# OmniAuth Matique Strategy
|
7
6
|
|
@@ -56,4 +55,4 @@ See also:
|
|
56
55
|
- http://codetheory.in/rails-devise-omniauth-sso/
|
57
56
|
- https://github.com/intridea/omniauth.git
|
58
57
|
|
59
|
-
Copyright (c)
|
58
|
+
Copyright (c) 2016..2019 Dittmar Krall, released under the MIT license.
|
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,5 +1,12 @@
|
|
1
|
+
# rubocop: disable all
|
2
|
+
|
1
3
|
module OmniAuth
|
2
4
|
module Matique
|
3
|
-
VERSION = '0.1.
|
5
|
+
VERSION = '0.1.8' # 2021-06-23
|
6
|
+
# VERSION = '0.1.7' # 2020-07-17
|
7
|
+
# VERSION = '0.1.6' # 2020-04-27
|
8
|
+
# VERSION = '0.1.5' # 2019-10-06
|
9
|
+
# VERSION = '0.1.4' # 2019-03-02
|
10
|
+
# VERSION = '0.1.3'
|
4
11
|
end
|
5
12
|
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
|
-
|
8
|
-
SITE = 'http://localhost:3010'
|
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
@@ -20,7 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
21
21
|
s.require_paths = ['lib']
|
22
22
|
|
23
|
-
s.add_development_dependency 'bundler'
|
24
|
-
s.add_development_dependency 'rake', '~>
|
23
|
+
s.add_development_dependency 'bundler'
|
24
|
+
s.add_development_dependency 'rake', '~> 13'
|
25
25
|
s.add_dependency 'omniauth-oauth2', '~> 1'
|
26
|
+
|
27
|
+
s.add_development_dependency 'minitest', '~> 5'
|
28
|
+
s.add_development_dependency 'mocha', '~> 1'
|
26
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/oauth2strategy_test.rb
CHANGED
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,43 +1,43 @@
|
|
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.8
|
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: 2021-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
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: '
|
26
|
+
version: '0'
|
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: '
|
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
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: mocha
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1'
|
55
83
|
description: " Strategy to authenticate with matique UG via OAuth2 in OmniAuth.\n"
|
56
84
|
email:
|
57
85
|
- dittmar.krall@matique.de
|
@@ -59,10 +87,11 @@ executables: []
|
|
59
87
|
extensions: []
|
60
88
|
extra_rdoc_files: []
|
61
89
|
files:
|
90
|
+
- ".github/workflows/rake.yml"
|
62
91
|
- ".gitignore"
|
92
|
+
- ".rubocop.yml"
|
63
93
|
- ".ruby-gemset"
|
64
94
|
- ".ruby-version"
|
65
|
-
- ".travis.yml"
|
66
95
|
- ".watchr"
|
67
96
|
- Gemfile
|
68
97
|
- MIT-LICENSE
|
@@ -95,8 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
124
|
- !ruby/object:Gem::Version
|
96
125
|
version: '0'
|
97
126
|
requirements: []
|
98
|
-
|
99
|
-
rubygems_version: 2.6.12
|
127
|
+
rubygems_version: 3.2.6
|
100
128
|
signing_key:
|
101
129
|
specification_version: 4
|
102
130
|
summary: OmniAuth strategy for matique
|
data/.travis.yml
DELETED