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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 980e0dc38689fb49ac61f868d081e8c167b4b5e3
4
- data.tar.gz: 5f986205dfec931feebba5dcc6c4052c8dc42243
2
+ SHA256:
3
+ metadata.gz: 93e81786297f0571cc96ac931ac6a92585e75cdd12c0dcfcb083d20f0f26437b
4
+ data.tar.gz: ee4cf38472bf0256484d5431d09f909903b23e45e71690f630b4e44e004e751b
5
5
  SHA512:
6
- metadata.gz: 6b767b4eb52be4f98c1a45f64c445ba0bedbb895c1dfb01511810ae62ca744a16bd4052cf965ced8ff963de5186a47bb6cad3e8195ceb63ca2fc37f550faf6a3
7
- data.tar.gz: 92375956494094a3704849d11ae41e80ec3b9530428b88a37afd04974c93185411619cf0f1e7ba10d81b4a7b3adad50372fb71b2dc908f00075df9f01511702a
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
@@ -4,4 +4,3 @@ coverage/
4
4
  *.gem
5
5
  *.log
6
6
  *.lock
7
- *.sqlite
data/.rubocop.yml ADDED
@@ -0,0 +1,12 @@
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/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- rails-5.1
1
+ rails-6.1
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.4.1
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 %Q{ruby -I"lib:test" -rubygems #{file}}
20
- when 'spec'; run %Q{rspec -X #{file}}
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
- %w{test}.each { |dir| run "rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
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
- %w{test spec}.each { |type|
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
- %w{test spec}.each { |type|
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
- %w{rb erb haml slim}.each { |type|
44
- watch("app/.*/.*\.#{type}") { |m|
45
- run_matching_files("#{m[0].split('/').at(2).split('.').first}")
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
@@ -1,10 +1,10 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- group :development, :test do
4
+ gem 'rails'
5
+
6
+ group :test do
5
7
  gem 'observr'
8
+ gem 'rubocop', require: false
6
9
  gem 'simplecov', require: false
7
- gem 'minitest'
8
- gem 'mocha'
9
- gem 'sqlite3'
10
10
  end
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2016-2017 Dittmar Krall http://matique.de
1
+ Copyright 2016-2021 Dittmar Krall www.matique.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,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) [Dittmar Krall], released under the MIT license.
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
- Rake::TestTask.new(:test) do |t|
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 = true
8
+ t.verbose = false
9
9
  end
10
10
 
11
- task :default => :test
11
+ task default: :test
@@ -1,2 +1,4 @@
1
- require "omniauth-matique/version"
1
+ # rubocop: disable all
2
+
3
+ require 'omniauth-matique/version'
2
4
  require 'omniauth/strategies/matique'
@@ -1,5 +1,12 @@
1
+ # rubocop: disable all
2
+
1
3
  module OmniAuth
2
4
  module Matique
3
- VERSION = '0.1.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
- # AuthUrl = ENV["HEROKU_AUTH_URL"] || "https://id.heroku.com"
7
- # SITE = 'https://login.matique.de'
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
- site: SITE,
13
- authorize_url: "#{SITE}/auth/#{STRATEGY}/authorize",
14
- token_url: "#{SITE}/auth/#{STRATEGY}/access_token"
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
- { 'email' => raw_info['email'] }
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
- { 'raw_info' => raw_info }
30
+ {raw_info: raw_info}
25
31
  end
26
32
 
27
33
  def raw_info
28
- @raw_info ||= access_token.get(
29
- "/auth/matique/user.json?oauth_token=#{access_token.token}").
30
- parsed || {}
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
@@ -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', '~> 1'
24
- s.add_development_dependency 'rake', '~> 12'
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['email']
49
- # coverage
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
@@ -15,6 +15,7 @@ describe OmniAuth::Strategies do
15
15
  end
16
16
 
17
17
  def strategy
18
+ @options ||= nil
18
19
  @strategy ||= begin
19
20
  args = [@client_id, @client_secret, @options].compact
20
21
  OmniAuth::Strategies::Matique.new(nil, *args).tap do |strategy|
data/test/test_helper.rb CHANGED
@@ -1,9 +1,13 @@
1
- require 'simplecov'
2
- SimpleCov.start
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/setup'
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.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: 2017-08-30 00:00:00.000000000 Z
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: '1'
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: '1'
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: '12'
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: '12'
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
- rubyforge_project:
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
@@ -1,15 +0,0 @@
1
- language: ruby
2
- sudo: false
3
-
4
- bundler_args: --without production
5
- before_install: gem update bundler --no-document
6
- script: 'bundle exec rake test'
7
-
8
- rvm:
9
- # - 2.0.0
10
- # - 2.2.3
11
- - 2.3.0
12
- - 2.4.1
13
-
14
- notifications:
15
- email: false