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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93e81786297f0571cc96ac931ac6a92585e75cdd12c0dcfcb083d20f0f26437b
4
- data.tar.gz: ee4cf38472bf0256484d5431d09f909903b23e45e71690f630b4e44e004e751b
3
+ metadata.gz: 2ff258eb557b6d4a6eceb44d2073efdcdd3ffc9997675990fe803aaaed187bd4
4
+ data.tar.gz: f20fb629c55f2fb7b0d2b304cbb772a2c74336de8cee11c76ced561606ee88f5
5
5
  SHA512:
6
- metadata.gz: 20f88245da0999fc8029546172fc685d64392bdba64f0695cb08caccc74c5b8b4fd9afc7ebf3ad2b910cfb26034ed17ea81ec92a29ad3d9727c02599f060d581
7
- data.tar.gz: 4b1d6ca038cbd559497661ee84e5fbcfedd3865466595691c2663854f9a4fbf83fae4abb1070e8384203c1a6ff30e6585b1d7e598ab7a914384932753cce46c5
6
+ metadata.gz: 609e59d9bb6e58475faaaaf6f62e7e5c897b622b21e96e0925e51d3e67d2cf9d6ff7507f7bdcca669c130bea8c574001f9a9484630c6cefa7be2aee9a9f3da17
7
+ data.tar.gz: fa921839b9bbeaf6ccd0943784b5ecaab280c19c34c76ab34391bef88d145010f7733ceb3e249b207a8eebfc7bba4d047c9c5a36cf4043e2f6b7606299e502f2
@@ -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
- # 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 }}
11
+ ruby_version: [head, "3.4", "3.2"]
12
+ gemfile:
13
+ - Gemfile
14
+ runs-on: ubuntu-latest
17
15
 
18
16
  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
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
@@ -1,6 +1,7 @@
1
1
  .bundle/
2
2
  coverage/
3
+ .watchr
3
4
 
4
- *.gem
5
- *.log
6
- *.lock
5
+ **/*.gem
6
+ **/*.log
7
+ **/*.lock
data/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- rails-6.1
1
+ rails-8.0
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.2
1
+ ruby-3.4.4
data/Gemfile CHANGED
@@ -1,10 +1,13 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
  gemspec
3
3
 
4
- gem 'rails'
4
+ gem "rails"
5
5
 
6
6
  group :test do
7
- gem 'observr'
8
- gem 'rubocop', require: false
9
- gem 'simplecov', require: false
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
@@ -1,4 +1,4 @@
1
- Copyright 2016-2021 Dittmar Krall www.matique.com
1
+ Copyright (c) 2016-2025 Dittmar Krall (www.matiq.com)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,20 +1,24 @@
1
- Omniauth-Matique
2
- ================
3
- [![Gem Version](https://badge.fury.io/rb/omniauth-matique.svg)](https://badge.fury.io/rb/omniauth-matique)
1
+ # Omniauth-Matique
2
+
3
+ [![Gem Version](https://img.shields.io/gem/v/omniauth-matique?color=168AFE&logo=rubygems&logoColor=FE1616)](https://rubygems.org/gems/omniauth-matique)
4
+ [![Downloads](https://img.shields.io/gem/dt/omniauth-matique?color=168AFE&logo=rubygems&logoColor=FE1616)](https://rubygems.org/gems/omniauth-matique)
5
+ [![GitHub Build](https://img.shields.io/github/actions/workflow/status/matique/omniauth-matique/rake.yml?logo=github)](https://github.com/matique/omniauth-matique/actions/workflows/rake.yml)
6
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard)
7
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://choosealicense.com/licenses/mit/)
4
8
 
5
9
  # OmniAuth Matique Strategy
6
10
 
7
- Strategy to authenticate with matique UG via OAuth2 in OmniAuth.
11
+ Strategy to authenticate with matiq UG (haftungsbeschränkt)
12
+ via OAuth2 in OmniAuth.
8
13
 
9
14
  ## Installation
10
15
 
11
- Add to your `Gemfile`:
12
-
16
+ As usual:
13
17
  ```ruby
14
- gem 'omniauth-matique'
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
- Copyright (c) 2016..2019 Dittmar Krall, released under the MIT license.
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 'rake/testtask'
1
+ require "rake/testtask"
2
2
 
3
- desc 'Run the tests.'
3
+ desc "Run the tests."
4
4
  Rake::TestTask.new do |t|
5
- t.libs << 'lib'
6
- t.libs << 'test'
7
- t.pattern = 'test/**/*_test.rb'
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 'omniauth-oauth2'
3
+ require "omniauth-oauth2"
4
4
 
5
5
  module OmniAuth
6
6
  module Strategies
7
7
  class Matique < OmniAuth::Strategies::OAuth2
8
- # AUTH_URL = 'https://login.matique.de'
9
- AUTH_URL = ENV['AUTH_URL'] || 'http://localhost:3010'
10
- STRATEGY = 'matique'
8
+ AUTH_URL = ENV["AUTH_URL"] || "http://localhost:3010"
9
+ STRATEGY = "matique"
11
10
 
12
11
  option :client_options, {
13
- site: AUTH_URL,
12
+ site: AUTH_URL,
14
13
  authorize_url: "#{AUTH_URL}/auth/#{STRATEGY}/authorize",
15
- token_url: "#{AUTH_URL}/auth/#{STRATEGY}/access_token"
14
+ token_url: "#{AUTH_URL}/auth/#{STRATEGY}/access_token"
16
15
  }
17
16
 
18
- uid { raw_info['id'].to_s }
17
+ uid { raw_info["id"].to_s }
19
18
 
20
19
  info do
21
20
  {
22
- name: raw_info['name'],
23
- username: raw_info['username'],
24
- email: raw_info['email'],
25
- image: raw_info['avatar_url']
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 = '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'
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
@@ -1,29 +1,30 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path("../lib", __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'omniauth-matique/version'
3
+ require "omniauth-matique/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.name = 'omniauth-matique'
7
- s.version = OmniAuth::Matique::VERSION
8
- s.summary = 'OmniAuth strategy for matique'
9
- s.description = <<-'END'
10
- Strategy to authenticate with matique UG via OAuth2 in OmniAuth.
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 = ['Dittmar Krall']
13
- s.email = ['dittmar.krall@matique.de']
14
- s.homepage = 'https://github.com/matique/omniauth-matique'
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 = 'MIT'
17
- s.platform = Gem::Platform::RUBY
17
+ s.license = "MIT"
18
+ s.platform = Gem::Platform::RUBY
18
19
 
19
- s.files = `git ls-files -z`.split("\x0")
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.add_development_dependency 'bundler'
24
- s.add_development_dependency 'rake', '~> 13'
25
- s.add_dependency 'omniauth-oauth2', '~> 1'
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 'minitest', '~> 5'
28
- s.add_development_dependency 'mocha', '~> 1'
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 'test_helper'
2
- require 'omniauth-matique'
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) { OmniAuth::Strategies::Matique.new('KEY', 'SECRET',
8
+ let(:over) {
9
+ OmniAuth::Strategies::Matique.new("KEY", "SECRET",
9
10
  client_options: {
10
- site: 'S',
11
- authorize_url: 'A',
12
- token_url: 'T'
13
- }
14
- )
11
+ site: "S",
12
+ authorize_url: "A",
13
+ token_url: "T"
14
+ })
15
15
  }
16
16
 
17
- it 'Client has correct default client_options' do
18
- # site = "https://login.matique.de"
17
+ it "Client has correct default client_options" do
18
+ # site = "https://login.matiq.com"
19
19
  site = "http://localhost:3010"
20
- assert_equal "#{site}", strategy.client.site
20
+ assert_equal site.to_s, strategy.client.site
21
21
  assert_equal "#{site}/auth/matique/authorize",
22
- strategy.client.options[:authorize_url]
22
+ strategy.client.options[:authorize_url]
23
23
  assert_equal "#{site}/auth/matique/access_token",
24
- strategy.client.options[:token_url]
24
+ strategy.client.options[:token_url]
25
25
  end
26
26
 
27
27
  it "client options should be overwritable" do
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
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 'raw_info' do
33
+ describe "raw_info" do
34
34
  def setup
35
35
  super
36
36
  @raw_info ||= {
37
- 'email' => 'test@example.com',
38
- 'id' => '123'
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 'uid returns the id from raw_info' do
44
- assert_equal '123', strategy.uid
43
+ it "uid returns the id from raw_info" do
44
+ assert_equal "123", strategy.uid
45
45
  end
46
46
 
47
- it 'access email from the raw_info' do
48
- assert_equal 'test@example.com', strategy.info[:email]
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
@@ -1,17 +1,16 @@
1
1
  # adapted from gem omniauth-facebook/omniauth-clef
2
2
 
3
- require 'test_helper'
3
+ require "test_helper"
4
4
 
5
5
  describe OmniAuth::Strategies do
6
-
7
6
  def setup
8
- @request = stub('Request')
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 = '123'
14
- @client_secret = '53cr3tz'
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
- strategy.stubs(:request).returns(@request)
21
+ strategy.stubs(:request).returns(@request)
23
22
  end
24
23
  end
25
24
  end
26
25
 
27
26
  describe "ClientTests" do
28
- it 'should be initialized with symbolized client_options' do
29
- @options = { client_options: { 'authorize_url' => 'https://example.com' } }
30
- assert_equal 'https://example.com',
31
- strategy.client.options[:authorize_url]
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 'should include any authorize params passed in the :authorize_params option' do
37
- @options = { :authorize_params => { :foo => 'bar', :baz => 'zip' } }
38
- assert_equal 'bar', strategy.authorize_params['foo']
39
- assert_equal 'zip', strategy.authorize_params['baz']
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 'should include top-level options that are marked as :authorize_options' do
43
- @options = { :authorize_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
44
- assert_equal 'bar', strategy.authorize_params['scope']
45
- assert_equal 'baz', strategy.authorize_params['foo']
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 'should exclude top-level options that are not passed' do
49
- @options = { :authorize_options => [:bar] }
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 'bar', strategy.authorize_params
50
+ refute_has_key "bar", strategy.authorize_params
52
51
  end
53
52
  end
54
53
 
55
54
  describe "CSRFAuthorizeParamsTests" do
56
- it 'should store random state in the session when none is present in authorize or request params' do
57
- assert_includes strategy.authorize_params.keys, 'state'
58
- refute_empty strategy.authorize_params['state']
59
- refute_empty strategy.session['omniauth.state']
60
- assert_equal strategy.authorize_params['state'], strategy.session['omniauth.state']
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 'should not store state in the session when present in authorize params vs. a random one' do
64
- @options = { :authorize_params => { :state => 'bar' } }
65
- refute_empty strategy.authorize_params['state']
66
- refute_equal 'bar', strategy.authorize_params[:state]
67
- refute_empty strategy.session['omniauth.state']
68
- refute_equal 'bar', strategy.session['omniauth.state']
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 'should not store state in the session when present in request params vs. a random one' do
72
- @request.stubs(:params).returns({ 'state' => 'foo' })
73
- refute_empty strategy.authorize_params['state']
74
- refute_equal 'foo', strategy.authorize_params[:state]
75
- refute_empty strategy.session['omniauth.state']
76
- refute_equal 'foo', strategy.session['omniauth.state']
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 'should include any authorize params passed in the :token_params option' do
82
- @options = { :token_params => { :foo => 'bar', :baz => 'zip' } }
83
- assert_equal 'bar', strategy.token_params['foo']
84
- assert_equal 'zip', strategy.token_params['baz']
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 'should include top-level options that are marked as :token_options' do
88
- @options = { :token_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
89
- assert_equal 'bar', strategy.token_params['scope']
90
- assert_equal 'baz', strategy.token_params['foo']
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
@@ -1,12 +1,12 @@
1
1
  # inspired by omniauth-github, omniauth-clef and others
2
2
 
3
- require 'test_helper'
4
- require 'omniauth-matique'
3
+ require "test_helper"
4
+ require "omniauth-matique"
5
5
 
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' }
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 'performs a GET to https://...' do
18
- access_token.expects(:get).with(get_param).
19
- returns(stub_everything('OAuth2::Response'))
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 'returns a Hash' do
24
- raw_response = stub('Faraday::Response')
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({'Content-Type' => 'application/json' })
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 'thar', strategy.raw_info['ohai']
31
+ assert_equal "thar", strategy.raw_info["ohai"]
32
32
  end
33
33
 
34
- it 'returns an empty hash when the response is false' do
35
- oauth2_response = stub('OAuth2::Response', :parsed => false)
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['COVERAGE']
2
- require 'simplecov'
1
+ if ENV["COVERAGE"]
2
+ require "simplecov"
3
3
  SimpleCov.start do
4
- add_filter '/test/'
4
+ add_filter "/test/"
5
5
  end
6
6
  end
7
7
 
8
- require 'bundler/setup'
9
- require 'minitest/autorun'
10
- require 'mocha/minitest'
11
- require 'omniauth/strategies/matique'
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.8
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: 2021-06-23 00:00:00.000000000 Z
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
- - !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'
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@matique.de
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
- post_install_message:
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: '0'
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.2.6
128
- signing_key:
98
+ rubygems_version: 3.6.7
129
99
  specification_version: 4
130
- summary: OmniAuth strategy for matique
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
@@ -1,12 +0,0 @@
1
- inherit_from:
2
- - ~/configs/.rubocop.yml
3
-
4
- AllCops:
5
- NewCops: enable
6
- Include:
7
- - 'lib/**/*.rb'
8
- Exclude:
9
- - 'test/**/*'
10
-
11
- Layout/HashAlignment:
12
- Enabled: false
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