omniauth-matique 0.1.8 → 0.1.10
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 +19 -13
- data/.gitignore +4 -3
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/Gemfile +8 -5
- data/MIT-LICENSE +1 -1
- data/README.md +17 -10
- data/Rakefile +5 -5
- data/lib/omniauth/strategies/matique.rb +10 -11
- data/lib/omniauth-matique/version.rb +8 -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 +13 -47
- 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: 2ff258eb557b6d4a6eceb44d2073efdcdd3ffc9997675990fe803aaaed187bd4
|
4
|
+
data.tar.gz: f20fb629c55f2fb7b0d2b304cbb772a2c74336de8cee11c76ced561606ee88f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 609e59d9bb6e58475faaaaf6f62e7e5c897b622b21e96e0925e51d3e67d2cf9d6ff7507f7bdcca669c130bea8c574001f9a9484630c6cefa7be2aee9a9f3da17
|
7
|
+
data.tar.gz: fa921839b9bbeaf6ccd0943784b5ecaab280c19c34c76ab34391bef88d145010f7733ceb3e249b207a8eebfc7bba4d047c9c5a36cf4043e2f6b7606299e502f2
|
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,23 @@ jobs:
|
|
8
8
|
strategy:
|
9
9
|
fail-fast: false
|
10
10
|
matrix:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
ruby: [2.7]
|
16
|
-
runs-on: ${{ matrix.os }}
|
11
|
+
ruby_version: [head, "3.4", "3.2"]
|
12
|
+
gemfile:
|
13
|
+
- Gemfile
|
14
|
+
runs-on: ubuntu-latest
|
17
15
|
|
18
16
|
steps:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
- uses: actions/checkout@v4
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby_version }}
|
22
|
+
bundler-cache: true
|
23
|
+
- name: Bundle install
|
24
|
+
run: |
|
25
|
+
bundle config set frozen false
|
26
|
+
bundle config path /home/runner/bundle
|
27
|
+
bundle install
|
28
|
+
bundle update
|
29
|
+
- name: Build and test with Rake
|
30
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails-
|
1
|
+
rails-8.0
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-
|
1
|
+
ruby-3.4.4
|
data/Gemfile
CHANGED
@@ -1,10 +1,13 @@
|
|
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 "cuco"
|
8
|
+
gem "rubocop", require: false
|
9
|
+
gem "simplecov", require: false
|
10
|
+
gem "spring"
|
11
|
+
gem "sqlite3"
|
12
|
+
gem "mocha", require: false # for a sub-gem
|
10
13
|
end
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,20 +1,24 @@
|
|
1
|
-
Omniauth-Matique
|
2
|
-
|
3
|
-
[](https://rubygems.org/gems/omniauth-matique)
|
4
|
+
[](https://rubygems.org/gems/omniauth-matique)
|
5
|
+
[](https://github.com/matique/omniauth-matique/actions/workflows/rake.yml)
|
6
|
+
[](https://github.com/standardrb/standard)
|
7
|
+
[](http://choosealicense.com/licenses/mit/)
|
4
8
|
|
5
9
|
# OmniAuth Matique Strategy
|
6
10
|
|
7
|
-
Strategy to authenticate with
|
11
|
+
Strategy to authenticate with matiq UG (haftungsbeschränkt)
|
12
|
+
via OAuth2 in OmniAuth.
|
8
13
|
|
9
14
|
## Installation
|
10
15
|
|
11
|
-
|
12
|
-
|
16
|
+
As usual:
|
13
17
|
```ruby
|
14
|
-
|
18
|
+
# Gemfile
|
19
|
+
gem "omniauth-matique"
|
15
20
|
```
|
16
|
-
|
17
|
-
Then `bundle install`.
|
21
|
+
and run "bundle install".
|
18
22
|
|
19
23
|
## Usage
|
20
24
|
|
@@ -55,4 +59,7 @@ See also:
|
|
55
59
|
- http://codetheory.in/rails-devise-omniauth-sso/
|
56
60
|
- https://github.com/intridea/omniauth.git
|
57
61
|
|
58
|
-
|
62
|
+
## Miscellaneous
|
63
|
+
|
64
|
+
Copyright (c) 2016-2025 Dittmar Krall (www.matiq.com),
|
65
|
+
released under the [MIT license](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,12 @@
|
|
1
|
-
# rubocop: disable all
|
2
|
-
|
3
1
|
module OmniAuth
|
4
2
|
module Matique
|
5
|
-
VERSION =
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
3
|
+
VERSION = "0.1.10" # 2025-06-20
|
4
|
+
# VERSION = "0.1.9" # 2023-04-25
|
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"
|
11
11
|
end
|
12
12
|
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.
|
22
|
+
s.files = `git ls-files -z`.split("\x0")
|
23
|
+
s.require_paths = ["lib"]
|
24
|
+
s.required_ruby_version = "~> 3"
|
26
25
|
|
27
|
-
s.add_development_dependency
|
28
|
-
s.
|
26
|
+
s.add_development_dependency "rake", "~> 13"
|
27
|
+
s.add_dependency "omniauth-oauth2", "~> 1"
|
28
|
+
|
29
|
+
s.add_development_dependency "minitest", "~> 5"
|
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,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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
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
12
|
- !ruby/object:Gem::Dependency
|
28
13
|
name: rake
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,33 +51,19 @@ dependencies:
|
|
66
51
|
- - "~>"
|
67
52
|
- !ruby/object:Gem::Version
|
68
53
|
version: '5'
|
69
|
-
|
70
|
-
|
71
|
-
|
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'
|
83
|
-
description: " Strategy to authenticate with matique UG via OAuth2 in OmniAuth.\n"
|
54
|
+
description: |2
|
55
|
+
Strategy to authenticate with matiq UG (haftungsbeschränkt)
|
56
|
+
via OAuth2 in OmniAuth.
|
84
57
|
email:
|
85
|
-
- dittmar.krall@
|
58
|
+
- dittmar.krall@matiq.com
|
86
59
|
executables: []
|
87
60
|
extensions: []
|
88
61
|
extra_rdoc_files: []
|
89
62
|
files:
|
90
63
|
- ".github/workflows/rake.yml"
|
91
64
|
- ".gitignore"
|
92
|
-
- ".rubocop.yml"
|
93
65
|
- ".ruby-gemset"
|
94
66
|
- ".ruby-version"
|
95
|
-
- ".watchr"
|
96
67
|
- Gemfile
|
97
68
|
- MIT-LICENSE
|
98
69
|
- README.md
|
@@ -108,28 +79,23 @@ files:
|
|
108
79
|
homepage: https://github.com/matique/omniauth-matique
|
109
80
|
licenses:
|
110
81
|
- MIT
|
111
|
-
metadata:
|
112
|
-
|
82
|
+
metadata:
|
83
|
+
source_code_uri: https://github.com/matique/omniauth-matique
|
113
84
|
rdoc_options: []
|
114
85
|
require_paths:
|
115
86
|
- lib
|
116
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
117
88
|
requirements:
|
118
|
-
- - "
|
89
|
+
- - "~>"
|
119
90
|
- !ruby/object:Gem::Version
|
120
|
-
version: '
|
91
|
+
version: '3'
|
121
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
93
|
requirements:
|
123
94
|
- - ">="
|
124
95
|
- !ruby/object:Gem::Version
|
125
96
|
version: '0'
|
126
97
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
128
|
-
signing_key:
|
98
|
+
rubygems_version: 3.6.7
|
129
99
|
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
|
100
|
+
summary: OmniAuth strategy for matiq
|
101
|
+
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
|