omniauth-matique 0.1.8 → 0.1.9
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 +4 -4
- data/.github/workflows/rake.yml +10 -8
- data/.gitignore +1 -0
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/Gemfile +5 -5
- data/MIT-LICENSE +3 -1
- data/README.md +14 -9
- data/Rakefile +5 -5
- data/lib/omniauth/strategies/matique.rb +10 -11
- data/lib/omniauth-matique/version.rb +7 -8
- data/omniauth-matique.gemspec +21 -20
- data/test/matique_test.rb +23 -23
- data/test/oauth2strategy_test.rb +46 -47
- data/test/raw_info_test.rb +15 -16
- data/test/test_helper.rb +7 -7
- metadata +11 -28
- data/.rubocop.yml +0 -12
- data/.watchr +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee4300f0314b4477302a48d487530ce1dad27752103a39cff0c881d1e1ff66eb
|
4
|
+
data.tar.gz: 8d29362a20a9a3b6b17fca715f717a60e560c298ba2c911303dc7a40f18d6fb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d968317c00c514c6835d711228152dd93e3e4727ce94a376c27811b0ea99ea46982a2d86f0eca1fdccd504eee8b8e5187747339c66c29fef0c8d8d48c81d780
|
7
|
+
data.tar.gz: 90e392e2191727806cc79af4bdee0de91a77e1f3be102d5d12662930718df383688963ef95a345793c87533ac8bcedd683ca61b9c3c1ab53cca8e041d1712cbc
|
data/.github/workflows/rake.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
# see also https://github.com/whitequark/parser/blob/master/.github/workflows/test.yml
|
1
2
|
name: Rake
|
2
3
|
|
3
|
-
#on: [push, pull_request]
|
4
4
|
on: [push]
|
5
5
|
|
6
6
|
jobs:
|
@@ -8,17 +8,19 @@ jobs:
|
|
8
8
|
strategy:
|
9
9
|
fail-fast: false
|
10
10
|
matrix:
|
11
|
-
# os: [ubuntu-latest, macos-latest]
|
12
11
|
os: [ubuntu-latest]
|
13
|
-
|
14
|
-
|
15
|
-
ruby: [2.7]
|
12
|
+
ruby: ["2.7", "3.0", "3.2", head]
|
13
|
+
test_command: ["bundle exec rake test"]
|
16
14
|
runs-on: ${{ matrix.os }}
|
17
15
|
|
18
16
|
steps:
|
19
|
-
- uses: actions/checkout@
|
17
|
+
- uses: actions/checkout@v3
|
20
18
|
- uses: ruby/setup-ruby@v1
|
21
19
|
with:
|
22
20
|
ruby-version: ${{ matrix.ruby }}
|
23
|
-
|
24
|
-
|
21
|
+
- name: Bundle install
|
22
|
+
run: |
|
23
|
+
bundle config path /home/runner/bundle
|
24
|
+
bundle install
|
25
|
+
bundle update
|
26
|
+
- run: ${{ matrix.test_command }}
|
data/.gitignore
CHANGED
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails-
|
1
|
+
rails-7.0
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-3.2.2
|
data/Gemfile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
gemspec
|
3
3
|
|
4
|
-
gem
|
4
|
+
gem "rails"
|
5
5
|
|
6
6
|
group :test do
|
7
|
-
gem
|
8
|
-
gem
|
9
|
-
gem
|
7
|
+
gem "observr"
|
8
|
+
gem "rubocop", require: false
|
9
|
+
gem "simplecov", require: false
|
10
10
|
end
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016-2023 Dittmar Krall (www.matiq.com)
|
2
4
|
|
3
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
6
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Omniauth-Matique
|
2
|
-
|
1
|
+
# Omniauth-Matique
|
2
|
+
|
3
3
|
[](https://badge.fury.io/rb/omniauth-matique)
|
4
4
|
|
5
5
|
# OmniAuth Matique Strategy
|
6
6
|
|
7
|
-
Strategy to authenticate with
|
7
|
+
Strategy to authenticate with matiq UG (haftungsbeschränkt)
|
8
|
+
via OAuth2 in OmniAuth.
|
8
9
|
|
9
10
|
## Installation
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
As usual:
|
13
13
|
```ruby
|
14
|
-
|
14
|
+
# Gemfile
|
15
|
+
gem "omniauth-matique"
|
15
16
|
```
|
16
|
-
|
17
|
-
Then `bundle install`.
|
17
|
+
and run "bundle install".
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
@@ -55,4 +55,9 @@ See also:
|
|
55
55
|
- http://codetheory.in/rails-devise-omniauth-sso/
|
56
56
|
- https://github.com/intridea/omniauth.git
|
57
57
|
|
58
|
-
|
58
|
+
## Miscellaneous
|
59
|
+
|
60
|
+
Copyright (c) 2016-2023 Dittmar Krall (www.matiq.com),
|
61
|
+
released under the MIT license:
|
62
|
+
|
63
|
+
* https://opensource.org/licenses/MIT
|
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require "rake/testtask"
|
2
2
|
|
3
|
-
desc
|
3
|
+
desc "Run the tests."
|
4
4
|
Rake::TestTask.new do |t|
|
5
|
-
t.libs <<
|
6
|
-
t.libs <<
|
7
|
-
t.pattern =
|
5
|
+
t.libs << "lib"
|
6
|
+
t.libs << "test"
|
7
|
+
t.pattern = "test/**/*_test.rb"
|
8
8
|
t.verbose = false
|
9
9
|
end
|
10
10
|
|
@@ -1,28 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "omniauth-oauth2"
|
4
4
|
|
5
5
|
module OmniAuth
|
6
6
|
module Strategies
|
7
7
|
class Matique < OmniAuth::Strategies::OAuth2
|
8
|
-
|
9
|
-
|
10
|
-
STRATEGY = 'matique'
|
8
|
+
AUTH_URL = ENV["AUTH_URL"] || "http://localhost:3010"
|
9
|
+
STRATEGY = "matique"
|
11
10
|
|
12
11
|
option :client_options, {
|
13
|
-
site:
|
12
|
+
site: AUTH_URL,
|
14
13
|
authorize_url: "#{AUTH_URL}/auth/#{STRATEGY}/authorize",
|
15
|
-
token_url:
|
14
|
+
token_url: "#{AUTH_URL}/auth/#{STRATEGY}/access_token"
|
16
15
|
}
|
17
16
|
|
18
|
-
uid { raw_info[
|
17
|
+
uid { raw_info["id"].to_s }
|
19
18
|
|
20
19
|
info do
|
21
20
|
{
|
22
|
-
name: raw_info[
|
23
|
-
username: raw_info[
|
24
|
-
email: raw_info[
|
25
|
-
image: raw_info[
|
21
|
+
name: raw_info["name"],
|
22
|
+
username: raw_info["username"],
|
23
|
+
email: raw_info["email"],
|
24
|
+
image: raw_info["avatar_url"]
|
26
25
|
}
|
27
26
|
end
|
28
27
|
|
@@ -1,12 +1,11 @@
|
|
1
|
-
# rubocop: disable all
|
2
|
-
|
3
1
|
module OmniAuth
|
4
2
|
module Matique
|
5
|
-
VERSION =
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
3
|
+
VERSION = "0.1.9" # 2023-04-25
|
4
|
+
# VERSION = "0.1.8" # 2021-06-23
|
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"
|
11
10
|
end
|
12
11
|
end
|
data/omniauth-matique.gemspec
CHANGED
@@ -1,29 +1,30 @@
|
|
1
|
-
lib = File.expand_path(
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require
|
3
|
+
require "omniauth-matique/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name
|
7
|
-
s.version
|
8
|
-
s.summary
|
9
|
-
s.description
|
10
|
-
Strategy to authenticate with
|
6
|
+
s.name = "omniauth-matique"
|
7
|
+
s.version = OmniAuth::Matique::VERSION
|
8
|
+
s.summary = "OmniAuth strategy for matiq"
|
9
|
+
s.description = <<-END
|
10
|
+
Strategy to authenticate with matiq UG (haftungsbeschränkt)
|
11
|
+
via OAuth2 in OmniAuth.
|
11
12
|
END
|
12
|
-
s.authors
|
13
|
-
s.email
|
14
|
-
s.homepage
|
13
|
+
s.authors = ["Dittmar Krall"]
|
14
|
+
s.email = ["dittmar.krall@matiq.com"]
|
15
|
+
s.homepage = "https://github.com/matique/omniauth-matique"
|
15
16
|
|
16
|
-
s.license
|
17
|
-
s.platform
|
17
|
+
s.license = "MIT"
|
18
|
+
s.platform = Gem::Platform::RUBY
|
18
19
|
|
19
|
-
s.
|
20
|
-
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
21
|
-
s.require_paths = ['lib']
|
20
|
+
s.metadata["source_code_uri"] = "https://github.com/matique/omniauth-matique"
|
22
21
|
|
23
|
-
s.
|
24
|
-
s.
|
25
|
-
s.add_dependency 'omniauth-oauth2', '~> 1'
|
22
|
+
s.files = `git ls-files -z`.split("\x0")
|
23
|
+
s.require_paths = ["lib"]
|
26
24
|
|
27
|
-
s.add_development_dependency
|
28
|
-
s.
|
25
|
+
s.add_development_dependency "rake", "~> 13"
|
26
|
+
s.add_dependency "omniauth-oauth2", "~> 1"
|
27
|
+
|
28
|
+
s.add_development_dependency "minitest", "~> 5"
|
29
|
+
s.add_development_dependency "mocha", "~> 1"
|
29
30
|
end
|
data/test/matique_test.rb
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "test_helper"
|
2
|
+
require "omniauth-matique"
|
3
3
|
|
4
4
|
# based on omniauth-github, omniauth-clef and others
|
5
5
|
|
6
6
|
describe OmniAuth::Strategies::Matique do
|
7
7
|
let(:strategy) { OmniAuth::Strategies::Matique.new({}) }
|
8
|
-
let(:over)
|
8
|
+
let(:over) {
|
9
|
+
OmniAuth::Strategies::Matique.new("KEY", "SECRET",
|
9
10
|
client_options: {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
}
|
14
|
-
)
|
11
|
+
site: "S",
|
12
|
+
authorize_url: "A",
|
13
|
+
token_url: "T"
|
14
|
+
})
|
15
15
|
}
|
16
16
|
|
17
|
-
it
|
18
|
-
# site = "https://login.
|
17
|
+
it "Client has correct default client_options" do
|
18
|
+
# site = "https://login.matiq.com"
|
19
19
|
site = "http://localhost:3010"
|
20
|
-
assert_equal
|
20
|
+
assert_equal site.to_s, strategy.client.site
|
21
21
|
assert_equal "#{site}/auth/matique/authorize",
|
22
|
-
|
22
|
+
strategy.client.options[:authorize_url]
|
23
23
|
assert_equal "#{site}/auth/matique/access_token",
|
24
|
-
|
24
|
+
strategy.client.options[:token_url]
|
25
25
|
end
|
26
26
|
|
27
27
|
it "client options should be overwritable" do
|
28
|
-
assert_equal
|
29
|
-
assert_equal
|
30
|
-
assert_equal
|
28
|
+
assert_equal "S", over.options.client_options.site
|
29
|
+
assert_equal "A", over.options.client_options.authorize_url
|
30
|
+
assert_equal "T", over.options.client_options.token_url
|
31
31
|
end
|
32
32
|
|
33
|
-
describe
|
33
|
+
describe "raw_info" do
|
34
34
|
def setup
|
35
35
|
super
|
36
36
|
@raw_info ||= {
|
37
|
-
|
38
|
-
|
37
|
+
"email" => "test@example.com",
|
38
|
+
"id" => "123"
|
39
39
|
}
|
40
40
|
strategy.stubs(:raw_info).returns(@raw_info)
|
41
41
|
end
|
42
42
|
|
43
|
-
it
|
44
|
-
assert_equal
|
43
|
+
it "uid returns the id from raw_info" do
|
44
|
+
assert_equal "123", strategy.uid
|
45
45
|
end
|
46
46
|
|
47
|
-
it
|
48
|
-
assert_equal
|
47
|
+
it "access email from the raw_info" do
|
48
|
+
assert_equal "test@example.com", strategy.info[:email]
|
49
49
|
refute_nil strategy.extra[:raw_info]
|
50
50
|
end
|
51
51
|
end
|
data/test/oauth2strategy_test.rb
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
# adapted from gem omniauth-facebook/omniauth-clef
|
2
2
|
|
3
|
-
require
|
3
|
+
require "test_helper"
|
4
4
|
|
5
5
|
describe OmniAuth::Strategies do
|
6
|
-
|
7
6
|
def setup
|
8
|
-
@request = stub(
|
7
|
+
@request = stub("Request")
|
9
8
|
@request.stubs(:params).returns({})
|
10
9
|
@request.stubs(:cookies).returns({})
|
11
10
|
@request.stubs(:env).returns({})
|
12
11
|
|
13
|
-
@client_id =
|
14
|
-
@client_secret =
|
12
|
+
@client_id = "123"
|
13
|
+
@client_secret = "53cr3tz"
|
15
14
|
end
|
16
15
|
|
17
16
|
def strategy
|
@@ -19,75 +18,75 @@ describe OmniAuth::Strategies do
|
|
19
18
|
@strategy ||= begin
|
20
19
|
args = [@client_id, @client_secret, @options].compact
|
21
20
|
OmniAuth::Strategies::Matique.new(nil, *args).tap do |strategy|
|
22
|
-
|
21
|
+
strategy.stubs(:request).returns(@request)
|
23
22
|
end
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
27
26
|
describe "ClientTests" do
|
28
|
-
it
|
29
|
-
@options = {
|
30
|
-
assert_equal
|
31
|
-
|
27
|
+
it "should be initialized with symbolized client_options" do
|
28
|
+
@options = {client_options: {"authorize_url" => "https://example.com"}}
|
29
|
+
assert_equal "https://example.com",
|
30
|
+
strategy.client.options[:authorize_url]
|
32
31
|
end
|
33
32
|
end
|
34
33
|
|
35
34
|
describe "AuthorizeParamsTests" do
|
36
|
-
it
|
37
|
-
@options = {
|
38
|
-
assert_equal
|
39
|
-
assert_equal
|
35
|
+
it "should include any authorize params passed in the :authorize_params option" do
|
36
|
+
@options = {authorize_params: {foo: "bar", baz: "zip"}}
|
37
|
+
assert_equal "bar", strategy.authorize_params["foo"]
|
38
|
+
assert_equal "zip", strategy.authorize_params["baz"]
|
40
39
|
end
|
41
40
|
|
42
|
-
it
|
43
|
-
@options = {
|
44
|
-
assert_equal
|
45
|
-
assert_equal
|
41
|
+
it "should include top-level options that are marked as :authorize_options" do
|
42
|
+
@options = {authorize_options: [:scope, :foo], scope: "bar", foo: "baz"}
|
43
|
+
assert_equal "bar", strategy.authorize_params["scope"]
|
44
|
+
assert_equal "baz", strategy.authorize_params["foo"]
|
46
45
|
end
|
47
|
-
|
48
|
-
it
|
49
|
-
@options = {
|
46
|
+
|
47
|
+
it "should exclude top-level options that are not passed" do
|
48
|
+
@options = {authorize_options: [:bar]}
|
50
49
|
refute_has_key :bar, strategy.authorize_params
|
51
|
-
refute_has_key
|
50
|
+
refute_has_key "bar", strategy.authorize_params
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
55
54
|
describe "CSRFAuthorizeParamsTests" do
|
56
|
-
it
|
57
|
-
assert_includes strategy.authorize_params.keys,
|
58
|
-
refute_empty strategy.authorize_params[
|
59
|
-
refute_empty strategy.session[
|
60
|
-
assert_equal strategy.authorize_params[
|
55
|
+
it "should store random state in the session when none is present in authorize or request params" do
|
56
|
+
assert_includes strategy.authorize_params.keys, "state"
|
57
|
+
refute_empty strategy.authorize_params["state"]
|
58
|
+
refute_empty strategy.session["omniauth.state"]
|
59
|
+
assert_equal strategy.authorize_params["state"], strategy.session["omniauth.state"]
|
61
60
|
end
|
62
61
|
|
63
|
-
it
|
64
|
-
@options = {
|
65
|
-
refute_empty strategy.authorize_params[
|
66
|
-
refute_equal
|
67
|
-
refute_empty strategy.session[
|
68
|
-
refute_equal
|
62
|
+
it "should not store state in the session when present in authorize params vs. a random one" do
|
63
|
+
@options = {authorize_params: {state: "bar"}}
|
64
|
+
refute_empty strategy.authorize_params["state"]
|
65
|
+
refute_equal "bar", strategy.authorize_params[:state]
|
66
|
+
refute_empty strategy.session["omniauth.state"]
|
67
|
+
refute_equal "bar", strategy.session["omniauth.state"]
|
69
68
|
end
|
70
69
|
|
71
|
-
it
|
72
|
-
@request.stubs(:params).returns({
|
73
|
-
refute_empty strategy.authorize_params[
|
74
|
-
refute_equal
|
75
|
-
refute_empty strategy.session[
|
76
|
-
refute_equal
|
70
|
+
it "should not store state in the session when present in request params vs. a random one" do
|
71
|
+
@request.stubs(:params).returns({"state" => "foo"})
|
72
|
+
refute_empty strategy.authorize_params["state"]
|
73
|
+
refute_equal "foo", strategy.authorize_params[:state]
|
74
|
+
refute_empty strategy.session["omniauth.state"]
|
75
|
+
refute_equal "foo", strategy.session["omniauth.state"]
|
77
76
|
end
|
78
77
|
end
|
79
78
|
|
80
79
|
describe "TokenParamsTests" do
|
81
|
-
it
|
82
|
-
@options = {
|
83
|
-
assert_equal
|
84
|
-
assert_equal
|
80
|
+
it "should include any authorize params passed in the :token_params option" do
|
81
|
+
@options = {token_params: {foo: "bar", baz: "zip"}}
|
82
|
+
assert_equal "bar", strategy.token_params["foo"]
|
83
|
+
assert_equal "zip", strategy.token_params["baz"]
|
85
84
|
end
|
86
85
|
|
87
|
-
it
|
88
|
-
@options = {
|
89
|
-
assert_equal
|
90
|
-
assert_equal
|
86
|
+
it "should include top-level options that are marked as :token_options" do
|
87
|
+
@options = {token_options: [:scope, :foo], scope: "bar", foo: "baz"}
|
88
|
+
assert_equal "bar", strategy.token_params["scope"]
|
89
|
+
assert_equal "baz", strategy.token_params["foo"]
|
91
90
|
end
|
92
91
|
end
|
93
92
|
end
|
data/test/raw_info_test.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# inspired by omniauth-github, omniauth-clef and others
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "test_helper"
|
4
|
+
require "omniauth-matique"
|
5
5
|
|
6
|
-
describe OmniAuth::Strategies::Matique,
|
7
|
-
let(:strategy)
|
8
|
-
let(:access_token) { stub(
|
9
|
-
let(:get_param)
|
6
|
+
describe OmniAuth::Strategies::Matique, "raw_info test" do
|
7
|
+
let(:strategy) { OmniAuth::Strategies::Matique.new({}) }
|
8
|
+
let(:access_token) { stub("OAuth2::AccessToken") }
|
9
|
+
let(:get_param) { "/auth/matique/user.json?oauth_token=123" }
|
10
10
|
|
11
11
|
def setup
|
12
12
|
super
|
@@ -14,28 +14,27 @@ describe OmniAuth::Strategies::Matique, 'raw_info test' do
|
|
14
14
|
access_token.stubs(:token).returns(123)
|
15
15
|
end
|
16
16
|
|
17
|
-
it
|
18
|
-
access_token.expects(:get).with(get_param)
|
19
|
-
returns(stub_everything(
|
17
|
+
it "performs a GET to https://..." do
|
18
|
+
access_token.expects(:get).with(get_param)
|
19
|
+
.returns(stub_everything("OAuth2::Response"))
|
20
20
|
strategy.raw_info
|
21
21
|
end
|
22
22
|
|
23
|
-
it
|
24
|
-
raw_response = stub(
|
23
|
+
it "returns a Hash" do
|
24
|
+
raw_response = stub("Faraday::Response")
|
25
25
|
raw_response.stubs(:body).returns('{ "ohai": "thar" }')
|
26
26
|
raw_response.stubs(:status).returns(200)
|
27
|
-
raw_response.stubs(:headers).returns({
|
27
|
+
raw_response.stubs(:headers).returns({"Content-Type" => "application/json"})
|
28
28
|
oauth2_response = OAuth2::Response.new(raw_response)
|
29
29
|
access_token.stubs(:get).with(get_param).returns(oauth2_response)
|
30
30
|
assert_kind_of Hash, strategy.raw_info
|
31
|
-
assert_equal
|
31
|
+
assert_equal "thar", strategy.raw_info["ohai"]
|
32
32
|
end
|
33
33
|
|
34
|
-
it
|
35
|
-
oauth2_response = stub(
|
34
|
+
it "returns an empty hash when the response is false" do
|
35
|
+
oauth2_response = stub("OAuth2::Response", parsed: false)
|
36
36
|
access_token.stubs(:get).with(get_param).returns(oauth2_response)
|
37
37
|
access_token.stubs(:get).with(get_param).returns(oauth2_response)
|
38
38
|
assert_kind_of Hash, strategy.raw_info
|
39
39
|
end
|
40
|
-
|
41
40
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
if ENV[
|
2
|
-
require
|
1
|
+
if ENV["COVERAGE"]
|
2
|
+
require "simplecov"
|
3
3
|
SimpleCov.start do
|
4
|
-
add_filter
|
4
|
+
add_filter "/test/"
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
8
|
+
require "bundler/setup"
|
9
|
+
require "minitest/autorun"
|
10
|
+
require "mocha/minitest"
|
11
|
+
require "omniauth/strategies/matique"
|
12
12
|
|
13
13
|
OmniAuth.config.test_mode = true
|
14
14
|
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
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.9
|
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: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,19 +66,19 @@ dependencies:
|
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '1'
|
83
|
-
description:
|
69
|
+
description: |2
|
70
|
+
Strategy to authenticate with matiq UG (haftungsbeschränkt)
|
71
|
+
via OAuth2 in OmniAuth.
|
84
72
|
email:
|
85
|
-
- dittmar.krall@
|
73
|
+
- dittmar.krall@matiq.com
|
86
74
|
executables: []
|
87
75
|
extensions: []
|
88
76
|
extra_rdoc_files: []
|
89
77
|
files:
|
90
78
|
- ".github/workflows/rake.yml"
|
91
79
|
- ".gitignore"
|
92
|
-
- ".rubocop.yml"
|
93
80
|
- ".ruby-gemset"
|
94
81
|
- ".ruby-version"
|
95
|
-
- ".watchr"
|
96
82
|
- Gemfile
|
97
83
|
- MIT-LICENSE
|
98
84
|
- README.md
|
@@ -108,7 +94,8 @@ files:
|
|
108
94
|
homepage: https://github.com/matique/omniauth-matique
|
109
95
|
licenses:
|
110
96
|
- MIT
|
111
|
-
metadata:
|
97
|
+
metadata:
|
98
|
+
source_code_uri: https://github.com/matique/omniauth-matique
|
112
99
|
post_install_message:
|
113
100
|
rdoc_options: []
|
114
101
|
require_paths:
|
@@ -124,12 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
111
|
- !ruby/object:Gem::Version
|
125
112
|
version: '0'
|
126
113
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
114
|
+
rubygems_version: 3.4.10
|
128
115
|
signing_key:
|
129
116
|
specification_version: 4
|
130
|
-
summary: OmniAuth strategy for
|
131
|
-
test_files:
|
132
|
-
- test/matique_test.rb
|
133
|
-
- test/oauth2strategy_test.rb
|
134
|
-
- test/raw_info_test.rb
|
135
|
-
- test/test_helper.rb
|
117
|
+
summary: OmniAuth strategy for matiq
|
118
|
+
test_files: []
|
data/.rubocop.yml
DELETED
data/.watchr
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
TESTING = %w[test]
|
2
|
-
HH = '#' * 22 unless defined?(HH)
|
3
|
-
H = '#' * 5 unless defined?(H)
|
4
|
-
|
5
|
-
def usage
|
6
|
-
puts <<-EOS
|
7
|
-
Ctrl-\\ or ctrl-4 Running all tests
|
8
|
-
Ctrl-C Exit
|
9
|
-
EOS
|
10
|
-
end
|
11
|
-
|
12
|
-
def run(cmd)
|
13
|
-
puts "#{HH} #{Time.now} #{HH}"
|
14
|
-
puts "#{H} #{cmd}"
|
15
|
-
system "/usr/bin/time --format '#{HH} Elapsed time %E' #{cmd}"
|
16
|
-
end
|
17
|
-
|
18
|
-
def run_it(type, file)
|
19
|
-
case type
|
20
|
-
when 'test'; run %(bundle exec ruby -I test #{file})
|
21
|
-
# when 'spec'; run %(rspec -X #{file})
|
22
|
-
else; puts "#{H} unknown type: #{type}, file: #{file}"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def run_all_tests
|
27
|
-
puts "\n#{HH} Running all tests #{HH}\n"
|
28
|
-
TESTING.each { |dir| run "bundle exec rake #{dir}" if File.exist?(dir) }
|
29
|
-
end
|
30
|
-
|
31
|
-
def run_matching_files(base)
|
32
|
-
base = base.split('_').first
|
33
|
-
TESTING.each { |type|
|
34
|
-
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
|
35
|
-
run_it type, files.join(' ') unless files.empty?
|
36
|
-
}
|
37
|
-
end
|
38
|
-
|
39
|
-
TESTING.each { |type|
|
40
|
-
watch("#{type}/#{type}_helper\.rb") { run_all_tests }
|
41
|
-
watch('lib/.*\.rb') { run_all_tests }
|
42
|
-
watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
|
43
|
-
}
|
44
|
-
|
45
|
-
%w[rb erb haml slim].each { |type|
|
46
|
-
watch(".*/(.*)\.#{type}") { |match|
|
47
|
-
run_matching_files(match[1])
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
# Ctrl-\ or ctrl-4
|
52
|
-
Signal.trap('QUIT') { run_all_tests }
|
53
|
-
# Ctrl-C
|
54
|
-
Signal.trap('INT') { abort("Interrupted\n") }
|
55
|
-
usage
|