omniauth-multipassword 0.4.2 → 2.0.1

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: d5f7c8a3656ca4686749bd2b4d273cc1460d39ba
4
- data.tar.gz: eb372de5e8f9ead660e3631e6b66c9c8ed34a158
2
+ SHA256:
3
+ metadata.gz: 22cda2cc2846bbe4d81087736f52e35f63c590595e6fc384006b0af8da14802f
4
+ data.tar.gz: 0600cb2dbafa41d13aeee34bda46ecb0263546489903aa68444d05126ade735c
5
5
  SHA512:
6
- metadata.gz: 513e554cf46d322762dfbff65e764aea532ff2986de7af99770d9f84383b336b63af43492a5a95b63cb853f53cdd0f2bf0f33e190550fa0898ef955657fe07a0
7
- data.tar.gz: c15f2b750cba4a41c170d2a983d74d8185665f3c0e70c44895ce268f7a1bdc54a1f7d713e8b7d1e5d58441ae9dd030e665b15f66bf6636ee98303b90f20ef5ad
6
+ metadata.gz: f3148c680d27dd56bae5325280e49670cd905d42d6e79cb668b01f0eb8951605bd27816233f3f55cef452c1a67215a94c6b25280dc6083eae3796c1eb12c2ce3
7
+ data.tar.gz: 6b48ab914cd47ff3b8b9641d52f1618050b5cafec8e1f171528eae6f7c8cbe909dd4095fbadc2b92caca6a9f25c002a06e9ab4ee837e8b504d1c031502772f26
data/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ [*]
7
+ indent_style = space
8
+ indent_size = 2
9
+ end_of_line = lf
10
+ charset = utf-8
11
+ trim_trailing_whitespace = true
12
+ insert_final_newline = true
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: maintenance-cache-clear
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 1 * *"
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ cache-clear:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: easimon/wipe-cache@v2
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: maintenance-workflow-cleanup
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 1 * *"
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ delete-workflow-runs:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: Mattraks/delete-workflow-runs@v2
13
+ with:
14
+ token: ${{ github.token }}
15
+ repository: ${{ github.repository }}
16
+ retain_days: 180
17
+ keep_minimum_runs: 50
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: test
3
+ on:
4
+ - push
5
+ - pull_request
6
+ - workflow_dispatch
7
+
8
+ jobs:
9
+ rspec:
10
+ name: "Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}"
11
+ runs-on: ubuntu-22.04
12
+
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ ruby:
17
+ - "3.3"
18
+ - "3.2"
19
+ - "3.1"
20
+ - "3.0"
21
+ - "2.7"
22
+ gemfile:
23
+ - omniauth_2.0
24
+ - omniauth_2.1
25
+
26
+ env:
27
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
28
+ BUNDLE_WITHOUT: development
29
+
30
+ steps:
31
+ - uses: actions/checkout@master
32
+ - uses: ruby/setup-ruby@v1
33
+ with:
34
+ ruby-version: ${{ matrix.ruby }}
35
+ bundler-cache: true
36
+ env:
37
+ BUNDLE_JOBS: 4
38
+ BUNDLE_RETRY: 3
39
+
40
+ - run: |
41
+ bundle exec rspec --color --format documentation
42
+
43
+ - uses: codecov/codecov-action@v4
44
+ with:
45
+ fail_ci_if_error: true
46
+ token: ${{ secrets.CODECOV_TOKEN }}
47
+
48
+ rubocop:
49
+ name: rubocop
50
+ runs-on: ubuntu-22.04
51
+
52
+ steps:
53
+ - uses: actions/checkout@master
54
+ - uses: ruby/setup-ruby@v1
55
+ with:
56
+ ruby-version: "3.3"
57
+ bundler-cache: true
58
+ env:
59
+ BUNDLE_JOBS: 4
60
+ BUNDLE_RETRY: 3
61
+
62
+ - run: bundle exec rubocop --parallel --fail-level E
data/.gitignore CHANGED
@@ -1,13 +1,13 @@
1
- *.gem
2
- *.rbc
1
+ _yardoc
3
2
  .bundle
4
3
  .config
5
4
  .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
5
+ *.gem
6
+ *.rbc
9
7
  coverage
10
8
  doc/
9
+ *.lock
10
+ InstalledFiles
11
11
  lib/bundler/man
12
12
  pkg
13
13
  rdoc
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --backtrace
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ inherit_gem:
2
+ rubocop-config: default.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: "2.7"
6
+ SuggestExtensions: False
7
+
8
+ Naming/FileName:
9
+ Exclude:
10
+ - lib/omniauth-multipassword.rb
data/Appraisals ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'omniauth-2.0' do
4
+ gem 'omniauth', '~> 2.0.0'
5
+ end
6
+
7
+ appraise 'omniauth-2.1' do
8
+ gem 'omniauth', '~> 2.1'
9
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # CHANGELOG
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Changelog](http://keepachangelog.com/).
5
+
6
+ ## [Unreleased]
7
+
8
+ ## [2.0.1] - 2024-07-20
9
+
10
+ ### Changed
11
+
12
+ - Version bump due to wrong tag
13
+
14
+ ## [2.0.0] - 2024-07-20
15
+
16
+ ### Added
17
+
18
+ - Add compatibility with newer Rack and OmniAuth 2.1+
19
+
20
+ ### Changed
21
+
22
+ - Updated strategy to OmniAuth >= 2.0
23
+ - Drop support for Ruby < 2.7
24
+
25
+ [Unreleased]: https://github.com/jgraichen/omniauth-multipassword/compare/v2.0.1...HEAD
26
+ [2.0.1]: https://github.com/jgraichen/omniauth-multipassword/compare/v2.0.0...v2.0.1
27
+ [2.0.0]: https://github.com/jgraichen/omniauth-multipassword/releases/tag/v2.0.0
data/Gemfile CHANGED
@@ -1,10 +1,24 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in omniauth-multipassword.gemspec
4
6
  gemspec
5
7
 
8
+ gem 'appraisal'
9
+
6
10
  gem 'rake'
7
- gem 'rack-test'
8
- gem 'rspec'
9
- gem 'simplecov'
10
- gem "codeclimate-test-reporter"
11
+ gem 'rake-release'
12
+
13
+ group :test do
14
+ gem 'rack-test'
15
+
16
+ gem 'rspec', '~> 3.0'
17
+
18
+ gem 'simplecov'
19
+ gem 'simplecov-cobertura'
20
+ end
21
+
22
+ group :development do
23
+ gem 'rubocop-config', github: 'jgraichen/rubocop-config', ref: 'v12'
24
+ end
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
- require 'bundler/gem_tasks'
1
+ # frozen_string_literal: true
2
+
3
+ require 'rake/release'
2
4
  require 'rspec/core/rake_task'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
@@ -0,0 +1,21 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rake"
7
+ gem "rake-release"
8
+ gem "omniauth", "~> 2.0.0"
9
+
10
+ group :test do
11
+ gem "rack-test"
12
+ gem "rspec", "~> 3.0"
13
+ gem "simplecov"
14
+ gem "simplecov-cobertura"
15
+ end
16
+
17
+ group :development do
18
+ gem "rubocop-config", github: "jgraichen/rubocop-config", ref: "v12"
19
+ end
20
+
21
+ gemspec path: "../"
@@ -0,0 +1,21 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rake"
7
+ gem "rake-release"
8
+ gem "omniauth", "~> 2.1"
9
+
10
+ group :test do
11
+ gem "rack-test"
12
+ gem "rspec", "~> 3.0"
13
+ gem "simplecov"
14
+ gem "simplecov-cobertura"
15
+ end
16
+
17
+ group :development do
18
+ gem "rubocop-config", github: "jgraichen/rubocop-config", ref: "v12"
19
+ end
20
+
21
+ gemspec path: "../"
@@ -1,25 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OmniAuth
2
4
  module MultiPassword
3
5
  module Base
4
6
  def self.included(base)
5
7
  base.class_eval do
6
- option :title, "Restricted Access"
7
- option :fields, [ :username, :password ]
8
+ option :title, 'Restricted Access'
9
+ option :fields, %i[username password]
8
10
 
9
- uid { username }
11
+ uid { username }
10
12
  end
11
13
  end
12
14
 
13
15
  def username_id
14
- options[:fields][0] || "username"
16
+ options.dig(:fields, 0) || 'username'
15
17
  end
16
18
 
17
19
  def password_id
18
- options[:fields][1] || "password"
20
+ options.dig(:fields, 1) || 'password'
19
21
  end
20
22
 
21
23
  def username
22
- @username || request[username_id].to_s
24
+ @username || request.params[username_id.to_s].to_s
23
25
  end
24
26
 
25
27
  def init_authenticator(request, env, username)
@@ -29,7 +31,7 @@ module OmniAuth
29
31
  end
30
32
 
31
33
  def callback_phase
32
- if authenticate(username, request[password_id])
34
+ if authenticate(username, request.params[password_id.to_s])
33
35
  super
34
36
  else
35
37
  fail!(:invalid_credentials)
@@ -37,11 +39,18 @@ module OmniAuth
37
39
  end
38
40
 
39
41
  def request_phase
40
- OmniAuth::Form.build(:title => options.title, :url => callback_url) do |f|
41
- f.text_field "Username", username_id
42
- f.password_field "Password", password_id
42
+ OmniAuth::Form.build(title: options.title, url: callback_url) do |f|
43
+ f.text_field 'Username', username_id
44
+ f.password_field 'Password', password_id
43
45
  end.to_response
44
46
  end
47
+
48
+ def other_phase
49
+ # OmniAuth, by default, disables "GET" requests for security reasons.
50
+ # This effectively disables showing a password form on a GET request to
51
+ # the `request_phase`. Instead, we hook the GET requests here.
52
+ request_phase if on_request_path?
53
+ end
45
54
  end
46
55
  end
47
56
  end
@@ -1,13 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Omniauth
2
4
  module Multipassword
3
5
  module VERSION
4
- MAJOR = 0
5
- MINOR = 4
6
- PATCH = 2
6
+ MAJOR = 2
7
+ MINOR = 0
8
+ PATCH = 1
7
9
  STAGE = nil
8
10
 
9
11
  def self.to_s
10
- [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join '.'
12
+ [MAJOR, MINOR, PATCH, STAGE].compact.join '.'
11
13
  end
12
14
  end
13
15
  end
@@ -1,5 +1,7 @@
1
- require "omniauth"
2
- require "omniauth/multipassword/base"
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth'
4
+ require 'omniauth/multipassword/base'
3
5
 
4
6
  module OmniAuth
5
7
  module Strategies
@@ -8,12 +10,16 @@ module OmniAuth
8
10
  include OmniAuth::MultiPassword::Base
9
11
 
10
12
  def initialize(app, *args, &block)
11
- super(app, *args) do end
13
+ super(app, *args) do
14
+ # Do pass an empty block, as otherwise the captured block would be
15
+ # passed to `super`, but this needs to be evaluate inside this
16
+ # middleware, not omniauth's Rack builder instance.
17
+ end
12
18
 
13
- if block.arity == 0
14
- instance_eval &block
19
+ if block.arity.zero?
20
+ instance_eval(&block)
15
21
  else
16
- block.call self
22
+ yield self
17
23
  end
18
24
  end
19
25
 
@@ -25,25 +31,25 @@ module OmniAuth
25
31
  def authenticator(klass, *args, &block)
26
32
  unless klass.is_a?(Class)
27
33
  begin
28
- klass = OmniAuth::Strategies.const_get("#{OmniAuth::Utils.camelize(klass.to_s)}")
34
+ klass = OmniAuth::Strategies.const_get(OmniAuth::Utils.camelize(klass.to_s).to_s)
29
35
  rescue NameError
30
- raise LoadError, "Could not find matching strategy for #{klass.inspect}." +
31
- "You may need to install an additional gem (such as omniauth-#{klass})."
36
+ raise LoadError.new("Could not find matching strategy for #{klass.inspect}." \
37
+ "You may need to install an additional gem (such as omniauth-#{klass}).")
32
38
  end
33
39
  end
34
40
 
35
41
  args << block if block
36
42
  @authenticators ||= []
37
- @authenticators << [ klass, args ]
43
+ @authenticators << [klass, args]
38
44
  end
39
45
 
40
46
  def callback_phase
41
- username = request[username_id].to_s
42
- password = request[password_id].to_s
47
+ username = request.params[username_id.to_s].to_s
48
+ password = request.params[password_id.to_s].to_s
43
49
  if authenticate(username, password)
44
50
  super
45
51
  else
46
- return fail!(:invalid_credentials)
52
+ fail!(:invalid_credentials)
47
53
  end
48
54
  end
49
55
 
@@ -52,11 +58,9 @@ module OmniAuth
52
58
  begin
53
59
  @authenticator = auth[0].new @app, *auth[1]
54
60
  @authenticator.init_authenticator(@request, @env, username)
55
- if @authenticator.authenticate(username, password)
56
- return true
57
- end
61
+ return true if @authenticator.authenticate(username, password)
58
62
  rescue Error => e
59
- OmniAuth.logger.warn "OmniAuth ERR >>> " + e
63
+ OmniAuth.logger.warn "OmniAuth ERR >>> #{e}"
60
64
  end
61
65
  @authenticator = nil
62
66
  end
@@ -65,6 +69,7 @@ module OmniAuth
65
69
 
66
70
  def name
67
71
  return @authenticator.name if @authenticator
72
+
68
73
  super
69
74
  end
70
75
 
@@ -1,3 +1,5 @@
1
- require "omniauth/multipassword/base"
2
- require "omniauth/multipassword/version"
3
- require "omniauth/strategies/multi_password"
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth/multipassword/base'
4
+ require 'omniauth/multipassword/version'
5
+ require 'omniauth/strategies/multi_password'
@@ -1,20 +1,25 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/omniauth/multipassword/version', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path('lib/omniauth/multipassword/version', __dir__)
3
4
 
4
5
  Gem::Specification.new do |gem|
5
- gem.authors = ["Jan Graichen"]
6
- gem.email = ["jg@altimos.de"]
7
- gem.description = "A OmniAuth strategy to authenticate using different passwort strategies."
8
- gem.summary = "A OmniAuth strategy to authenticate using different passwort strategies."
9
- gem.homepage = "https://github.com/jgraichen/omniauth-multipassword"
6
+ gem.name = 'omniauth-multipassword'
7
+ gem.version = Omniauth::Multipassword::VERSION
8
+ gem.authors = ['Jan Graichen']
9
+ gem.email = ['jgraichen@altimos.de']
10
+ gem.description = 'A OmniAuth strategy to authenticate using different passwort strategies.'
11
+ gem.summary = 'A OmniAuth strategy to authenticate using different passwort strategies.'
12
+ gem.homepage = 'https://github.com/jgraichen/omniauth-multipassword'
10
13
  gem.license = 'MIT'
11
14
 
12
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
15
+ gem.required_ruby_version = '>= 2.7'
16
+ gem.metadata = {
17
+ 'rubygems_mfa_required' => 'true',
18
+ }
19
+
20
+ gem.executables = `git ls-files -- bin/*`.split("\n").map {|f| File.basename(f) }
13
21
  gem.files = `git ls-files`.split("\n")
14
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
- gem.name = "omniauth-multipassword"
16
- gem.require_paths = ["lib"]
17
- gem.version = Omniauth::Multipassword::VERSION
22
+ gem.require_paths = ['lib']
18
23
 
19
- gem.add_dependency 'omniauth', '~> 1.0'
24
+ gem.add_dependency 'omniauth', '~> 2.0'
20
25
  end
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "local>jgraichen/renovate-config"
5
+ ]
6
+ }
@@ -1,48 +1,40 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'rack/test'
3
5
 
4
- describe OmniAuth::MultiPassword::Base do
5
- let(:app) { double 'app' }
6
- let(:args) { [] }
7
- let(:block) { nil }
8
-
9
- class OmniAuth::Strategy::OneTest
10
- include OmniAuth::Strategy
11
- include OmniAuth::MultiPassword::Base
12
-
13
- def authenticate(username, password)
14
- username == 'john' && password == 'secret'
15
- end
16
- end
17
-
6
+ describe OmniAuth::MultiPassword::Base do # rubocop:disable RSpec/SpecFilePathFormat subject { strategy }
7
+ let(:app) { instance_double(Proc) }
18
8
  let(:strategy) do
19
- OmniAuth::Strategy::OneTest.new(app, *args, &block)
9
+ OmniAuth::Strategies::OneTest.new(app, *args, &block)
20
10
  end
21
-
22
- subject { strategy }
11
+ let(:args) { [] }
12
+ let(:block) { nil }
23
13
 
24
14
  describe '#username_id' do
25
- subject { strategy.username_id }
15
+ subject(:username_id) { strategy.username_id }
26
16
 
27
17
  it 'defaults to :username' do
28
- is_expected.to eq :username
18
+ expect(username_id).to eq :username
29
19
  end
30
20
 
31
21
  context 'when configured' do
32
- let(:args) { [{fields: [:user, :pass]}] }
22
+ let(:args) { [{fields: %i[user pass]}] }
23
+
33
24
  it { is_expected.to eq :user }
34
25
  end
35
26
  end
36
27
 
37
28
  describe '#password_id' do
38
- subject { strategy.password_id }
29
+ subject(:password_id) { strategy.password_id }
39
30
 
40
31
  it 'defaults to :password' do
41
- is_expected.to eq :password
32
+ expect(password_id).to eq :password
42
33
  end
43
34
 
44
35
  context 'when configured' do
45
- let(:args) { [{fields: [:user, :pass]}] }
36
+ let(:args) { [{fields: %i[user pass]}] }
37
+
46
38
  it { is_expected.to eq :pass }
47
39
  end
48
40
  end
@@ -51,11 +43,11 @@ describe OmniAuth::MultiPassword::Base do
51
43
  include Rack::Test::Methods
52
44
 
53
45
  let(:app) do
54
- Rack::Builder.new {
46
+ Rack::Builder.new do
55
47
  use OmniAuth::Test::PhonySession
56
48
  use OmniAuth::Strategies::OneTest
57
49
  run ->(env) { [404, {'Content-Type' => 'text/plain'}, [env.key?('omniauth.auth').to_s]] }
58
- }.to_app
50
+ end.to_app
59
51
  end
60
52
 
61
53
  it 'shows login FORM' do
@@ -1,36 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'rack/test'
3
5
 
4
- describe OmniAuth::Strategies::MultiPassword do
6
+ describe OmniAuth::Strategies::MultiPassword do # rubocop:disable RSpec/SpecFilePathFormat
5
7
  include Rack::Test::Methods
6
8
 
7
- class OmniAuth::Strategies::OneTest
8
- include OmniAuth::Strategy
9
- include OmniAuth::MultiPassword::Base
10
-
11
- def authenticate(username, password)
12
- username == 'john' && password == 'secret'
13
- end
14
- end
15
-
16
- class OmniAuth::Strategies::TwoTest
17
- include OmniAuth::Strategy
18
- include OmniAuth::MultiPassword::Base
19
-
20
- def authenticate(username, password)
21
- username == 'jane' && password == '1234'
22
- end
23
- end
24
-
25
9
  let(:app) do
26
- Rack::Builder.new {
10
+ Rack::Builder.new do
27
11
  use OmniAuth::Test::PhonySession
28
12
  use OmniAuth::Strategies::MultiPassword do
29
13
  authenticator :one_test
30
14
  authenticator :two_test
31
15
  end
32
16
  run ->(env) { [404, {'Content-Type' => 'text/plain'}, [env['omniauth.auth']['uid'].to_s]] }
33
- }.to_app
17
+ end.to_app
34
18
  end
35
19
 
36
20
  it 'shows login FORM' do
@@ -41,17 +25,20 @@ describe OmniAuth::Strategies::MultiPassword do
41
25
 
42
26
  it 'redirect on all failed strategies' do
43
27
  post '/auth/multipassword/callback', username: 'paul', password: 'wrong'
28
+
44
29
  expect(last_response).to be_redirect
45
30
  expect(last_response.headers['Location']).to eq '/auth/failure?message=invalid_credentials&strategy=multipassword'
46
31
  end
47
32
 
48
33
  it 'authenticates john' do
49
34
  post '/auth/multipassword/callback', username: 'john', password: 'secret'
35
+
50
36
  expect(last_response.body).to eq 'john'
51
37
  end
52
38
 
53
39
  it 'authenticates jane' do
54
40
  post '/auth/multipassword/callback', username: 'jane', password: '1234'
41
+
55
42
  expect(last_response.body).to eq 'jane'
56
43
  end
57
44
  end
data/spec/spec_helper.rb CHANGED
@@ -1,30 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec'
4
+
2
5
  require 'simplecov'
6
+ require 'simplecov-cobertura'
3
7
 
4
- if ENV['CI'] || (defined?(:RUBY_ENGINE) && RUBY_ENGINE != 'rbx')
5
- begin
6
- require 'codeclimate-test-reporter'
7
- CodeClimate::TestReporter.start
8
- rescue LoadError
9
- end
10
- SimpleCov.start
8
+ SimpleCov.start do
9
+ add_filter 'spec'
11
10
  end
12
11
 
13
- require 'omniauth-multipassword'
14
-
15
- Dir[File.expand_path('spec/support/**/*.rb')].each {|f| require f }
16
-
17
- # Disable omniauth logger
18
- class NullLogger < Logger
19
- def initialize(*args)
20
- end
12
+ SimpleCov.formatters = [
13
+ SimpleCov::Formatter::HTMLFormatter,
14
+ SimpleCov::Formatter::CoberturaFormatter,
15
+ ]
21
16
 
22
- def add(*args, &block)
23
- end
24
- end
17
+ require 'omniauth-multipassword'
25
18
 
26
- OmniAuth.config.logger = NullLogger.new
19
+ Dir[File.expand_path('spec/support/**/*.rb')].sort.each {|f| require f }
27
20
 
28
21
  RSpec.configure do |config|
29
22
  config.order = 'random'
23
+
24
+ config.before do
25
+ OmniAuth.config.logger = Logger.new(IO::NULL)
26
+ end
30
27
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class OneTest
6
+ include OmniAuth::Strategy
7
+ include OmniAuth::MultiPassword::Base
8
+
9
+ def authenticate(username, password)
10
+ username == 'john' && password == 'secret'
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ module OmniAuth
17
+ module Strategies
18
+ class TwoTest
19
+ include OmniAuth::Strategy
20
+ include OmniAuth::MultiPassword::Base
21
+
22
+ def authenticate(username, password)
23
+ username == 'jane' && password == '1234'
24
+ end
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-multipassword
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-18 00:00:00.000000000 Z
11
+ date: 2024-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -16,40 +16,52 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.0'
20
20
  type: :runtime
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.0'
26
+ version: '2.0'
27
27
  description: A OmniAuth strategy to authenticate using different passwort strategies.
28
28
  email:
29
- - jg@altimos.de
29
+ - jgraichen@altimos.de
30
30
  executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - ".editorconfig"
35
+ - ".github/workflows/maintenance-cache-wipe.yml"
36
+ - ".github/workflows/maintenance-workflow-cleanup.yml"
37
+ - ".github/workflows/test.yml"
34
38
  - ".gitignore"
35
- - ".travis.yml"
39
+ - ".rspec"
40
+ - ".rubocop.yml"
41
+ - Appraisals
42
+ - CHANGELOG.md
36
43
  - Gemfile
37
44
  - LICENSE
38
45
  - README.md
39
46
  - Rakefile
47
+ - gemfiles/omniauth_2.0.gemfile
48
+ - gemfiles/omniauth_2.1.gemfile
40
49
  - lib/omniauth-multipassword.rb
41
50
  - lib/omniauth/multipassword/base.rb
42
51
  - lib/omniauth/multipassword/version.rb
43
52
  - lib/omniauth/strategies/multi_password.rb
44
53
  - omniauth-multipassword.gemspec
54
+ - renovate.json
45
55
  - spec/omniauth/multipassword/base_spec.rb
46
56
  - spec/omniauth/strategy/multi_password_spec.rb
47
57
  - spec/spec_helper.rb
58
+ - spec/support/strategies.rb
48
59
  homepage: https://github.com/jgraichen/omniauth-multipassword
49
60
  licenses:
50
61
  - MIT
51
- metadata: {}
52
- post_install_message:
62
+ metadata:
63
+ rubygems_mfa_required: 'true'
64
+ post_install_message:
53
65
  rdoc_options: []
54
66
  require_paths:
55
67
  - lib
@@ -57,16 +69,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
69
  requirements:
58
70
  - - ">="
59
71
  - !ruby/object:Gem::Version
60
- version: '0'
72
+ version: '2.7'
61
73
  required_rubygems_version: !ruby/object:Gem::Requirement
62
74
  requirements:
63
75
  - - ">="
64
76
  - !ruby/object:Gem::Version
65
77
  version: '0'
66
78
  requirements: []
67
- rubyforge_project:
68
- rubygems_version: 2.4.6
69
- signing_key:
79
+ rubygems_version: 3.5.11
80
+ signing_key:
70
81
  specification_version: 4
71
82
  summary: A OmniAuth strategy to authenticate using different passwort strategies.
72
83
  test_files: []
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - '2.1'
6
- - '2.0'
7
- - 1.9.3
8
- - jruby
9
- - rbx-2