omniauth-multipassword 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +36 -0
- data/.github/workflows/test.yml +3 -3
- data/.markdownlint.yml +26 -0
- data/CHANGELOG.md +8 -1
- data/Gemfile +2 -2
- data/README.md +29 -16
- data/lib/omniauth/multipassword/base.rb +5 -1
- data/lib/omniauth/multipassword/version.rb +2 -2
- data/spec/omniauth/multipassword/base_spec.rb +8 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db4e255ccd2a90d205d8ad9b0a6aea7456e4af42d9d30ad88bcd32b59b5619b9
|
4
|
+
data.tar.gz: acce514c49e0fe34f39ce6161a9bb4277720d5af0dfb10056726c3c7761b235a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8830e6455ecc2205409219603966056d9a99ee4b9cf556216c77113e0f323c6df78993d4631b96066d179bf16d3deedd225c04eb4c20b218cd2c7df574e1e7e6
|
7
|
+
data.tar.gz: 858305c757402a42b61d0cf90b493b1a82f0d928e5ec3991c78ca56aa27edbf5caab08b169eb6e463960ada74030d3a5e30bf182f3c4c706ac9edc4143b270b7
|
@@ -0,0 +1,36 @@
|
|
1
|
+
name: release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- v*
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
rubygems:
|
10
|
+
if: github.repository == 'jgraichen/omniauth-multipassword'
|
11
|
+
runs-on: ubuntu-24.04
|
12
|
+
|
13
|
+
permissions:
|
14
|
+
contents: write
|
15
|
+
id-token: write
|
16
|
+
|
17
|
+
env:
|
18
|
+
BUNDLE_JOBS: 4
|
19
|
+
BUNDLE_RETRY: 10
|
20
|
+
BUNDLE_WITHOUT: development test
|
21
|
+
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v4
|
24
|
+
|
25
|
+
- uses: ruby/setup-ruby@v1
|
26
|
+
with:
|
27
|
+
ruby-version: ruby
|
28
|
+
bundler-cache: true
|
29
|
+
|
30
|
+
- uses: rubygems/release-gem@v1
|
31
|
+
|
32
|
+
- uses: taiki-e/create-gh-release-action@v1
|
33
|
+
with:
|
34
|
+
changelog: CHANGELOG.md
|
35
|
+
draft: true
|
36
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
data/.github/workflows/test.yml
CHANGED
@@ -8,7 +8,7 @@ on:
|
|
8
8
|
jobs:
|
9
9
|
rspec:
|
10
10
|
name: "Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}"
|
11
|
-
runs-on: ubuntu-
|
11
|
+
runs-on: ubuntu-24.04
|
12
12
|
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
@@ -47,13 +47,13 @@ jobs:
|
|
47
47
|
|
48
48
|
rubocop:
|
49
49
|
name: rubocop
|
50
|
-
runs-on: ubuntu-
|
50
|
+
runs-on: ubuntu-24.04
|
51
51
|
|
52
52
|
steps:
|
53
53
|
- uses: actions/checkout@master
|
54
54
|
- uses: ruby/setup-ruby@v1
|
55
55
|
with:
|
56
|
-
ruby-version: "3.3"
|
56
|
+
ruby-version: "3.3.5"
|
57
57
|
bundler-cache: true
|
58
58
|
env:
|
59
59
|
BUNDLE_JOBS: 4
|
data/.markdownlint.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# markdownlint config
|
2
|
+
|
3
|
+
# The CHANGELOG contains duplicated headers by design
|
4
|
+
MD024: false
|
5
|
+
|
6
|
+
# MD013/line-length: disable line length for all. We prefer lines as
|
7
|
+
# long as paragraph with in-editor line breaks.
|
8
|
+
MD013: false
|
9
|
+
|
10
|
+
# MD033/no-inline-html: allow often need tags
|
11
|
+
MD033:
|
12
|
+
allowed_elements:
|
13
|
+
- code
|
14
|
+
- dd
|
15
|
+
- dl
|
16
|
+
- dt
|
17
|
+
- figcaption
|
18
|
+
- figure
|
19
|
+
|
20
|
+
# MD046/code-block-style: code block style conflicting with
|
21
|
+
# admonitions...
|
22
|
+
MD046: false
|
23
|
+
|
24
|
+
# MD048/code-fence-style: code fence style
|
25
|
+
MD048:
|
26
|
+
style: backtick
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.1.0] - 2024-11-06
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
|
12
|
+
- Pass GET requests to the app if not on the request path by @larskanis
|
13
|
+
|
8
14
|
## [2.0.1] - 2024-07-20
|
9
15
|
|
10
16
|
### Changed
|
@@ -22,6 +28,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
|
|
22
28
|
- Updated strategy to OmniAuth >= 2.0
|
23
29
|
- Drop support for Ruby < 2.7
|
24
30
|
|
25
|
-
[Unreleased]: https://github.com/jgraichen/omniauth-multipassword/compare/v2.
|
31
|
+
[Unreleased]: https://github.com/jgraichen/omniauth-multipassword/compare/v2.1.1...HEAD
|
32
|
+
[2.1.0]: https://github.com/jgraichen/omniauth-multipassword/compare/v2.0.1...v2.1.0
|
26
33
|
[2.0.1]: https://github.com/jgraichen/omniauth-multipassword/compare/v2.0.0...v2.0.1
|
27
34
|
[2.0.0]: https://github.com/jgraichen/omniauth-multipassword/releases/tag/v2.0.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,32 +1,39 @@
|
|
1
1
|
# Omniauth::Multipassword
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/omniauth-multipassword?logo=ruby)](https://rubygems.org/gems/omniauth-multipassword)
|
4
|
+
[![Workflow Status](https://img.shields.io/github/actions/workflow/status/jgraichen/omniauth-multipassword/test.yml?logo=github)](https://github.com/jgraichen/omniauth-multipassword/actions)
|
5
|
+
[![Test Coverage](https://img.shields.io/codecov/c/github/jgraichen/omniauth-multipassword?logo=codecov&logoColor=white)](https://app.codecov.io/gh/jgraichen/omniauth-multipassword)
|
4
6
|
[![Code Climate](https://codeclimate.com/github/jgraichen/omniauth-multipassword/badges/gpa.svg)](https://codeclimate.com/github/jgraichen/omniauth-multipassword)
|
5
|
-
[![Test Coverage](https://codeclimate.com/github/jgraichen/omniauth-multipassword/badges/coverage.svg)](https://codeclimate.com/github/jgraichen/omniauth-multipassword/coverage)
|
6
7
|
|
7
8
|
**omniauth-multipassword** is a [OmniAuth](https://github.com/intridea/omniauth)
|
8
9
|
strategy that allows to authenticate again different password strategies at once.
|
9
10
|
|
10
|
-
|
11
11
|
## Installation
|
12
12
|
|
13
13
|
Add this line to your application's Gemfile:
|
14
14
|
|
15
|
-
|
15
|
+
```ruby
|
16
|
+
gem 'omniauth-multipassword'
|
17
|
+
```
|
16
18
|
|
17
19
|
Add multipassword compatible omniauth strategies you want to use:
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
+
```ruby
|
22
|
+
gem 'omniauth-internal'
|
23
|
+
gem 'omniauth-kerberos'
|
24
|
+
```
|
21
25
|
|
22
26
|
And then execute:
|
23
27
|
|
24
|
-
|
28
|
+
```console
|
29
|
+
bundle
|
30
|
+
```
|
25
31
|
|
26
32
|
Or install it yourself as:
|
27
33
|
|
28
|
-
|
29
|
-
|
34
|
+
```console
|
35
|
+
gem install omniauth-multipassword
|
36
|
+
```
|
30
37
|
|
31
38
|
## Usage
|
32
39
|
|
@@ -37,26 +44,32 @@ Rails.application.config.middleware.use OmniAuth::Strategies::MultiPassword, fie
|
|
37
44
|
end
|
38
45
|
```
|
39
46
|
|
40
|
-
|
41
47
|
## Options
|
42
48
|
|
43
|
-
|
49
|
+
<dl>
|
50
|
+
<dt><code>title</code></dt>
|
51
|
+
<dd>
|
52
|
+
|
44
53
|
The title text shown on default login form.
|
45
54
|
(default: `"Restricted Access"`)
|
46
55
|
|
47
|
-
|
56
|
+
</dd>
|
57
|
+
<dt><code>fields</code></dt>
|
58
|
+
<dd>
|
59
|
+
|
48
60
|
The request parameter names to fetch username and password.
|
49
61
|
(default: `[ "username", "password" ]`)
|
50
62
|
|
63
|
+
</dd>
|
64
|
+
</dl>
|
51
65
|
|
52
66
|
### Compatible Strategies
|
53
67
|
|
54
|
-
|
55
|
-
|
56
|
-
|
68
|
+
- [omniauth-internal](https://github.com/jgraichen/omniauth-internal)
|
69
|
+
- [omniauth-kerberos](https://github.com/jgraichen/omniauth-kerberos)
|
57
70
|
|
58
71
|
## License
|
59
72
|
|
60
73
|
[MIT License](http://www.opensource.org/licenses/mit-license.php)
|
61
74
|
|
62
|
-
Copyright
|
75
|
+
Copyright © 2012, Jan Graichen
|
@@ -49,7 +49,11 @@ module OmniAuth
|
|
49
49
|
# OmniAuth, by default, disables "GET" requests for security reasons.
|
50
50
|
# This effectively disables showing a password form on a GET request to
|
51
51
|
# the `request_phase`. Instead, we hook the GET requests here.
|
52
|
-
|
52
|
+
if on_request_path?
|
53
|
+
request_phase
|
54
|
+
else
|
55
|
+
call_app!
|
56
|
+
end
|
53
57
|
end
|
54
58
|
end
|
55
59
|
end
|
@@ -46,6 +46,9 @@ describe OmniAuth::MultiPassword::Base do # rubocop:disable RSpec/SpecFilePathFo
|
|
46
46
|
Rack::Builder.new do
|
47
47
|
use OmniAuth::Test::PhonySession
|
48
48
|
use OmniAuth::Strategies::OneTest
|
49
|
+
map '/app-ok' do
|
50
|
+
run ->(env) { [200, {'Content-Type' => 'text/plain'}, ['OK']] }
|
51
|
+
end
|
49
52
|
run ->(env) { [404, {'Content-Type' => 'text/plain'}, [env.key?('omniauth.auth').to_s]] }
|
50
53
|
end.to_app
|
51
54
|
end
|
@@ -66,5 +69,10 @@ describe OmniAuth::MultiPassword::Base do # rubocop:disable RSpec/SpecFilePathFo
|
|
66
69
|
post '/auth/onetest/callback', username: 'john', password: 'secret'
|
67
70
|
expect(last_response.body).to eq 'true'
|
68
71
|
end
|
72
|
+
|
73
|
+
it 'shows app page' do
|
74
|
+
get '/app-ok'
|
75
|
+
expect(last_response.body).to eq 'OK'
|
76
|
+
end
|
69
77
|
end
|
70
78
|
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: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -34,8 +34,10 @@ files:
|
|
34
34
|
- ".editorconfig"
|
35
35
|
- ".github/workflows/maintenance-cache-wipe.yml"
|
36
36
|
- ".github/workflows/maintenance-workflow-cleanup.yml"
|
37
|
+
- ".github/workflows/release.yml"
|
37
38
|
- ".github/workflows/test.yml"
|
38
39
|
- ".gitignore"
|
40
|
+
- ".markdownlint.yml"
|
39
41
|
- ".rspec"
|
40
42
|
- ".rubocop.yml"
|
41
43
|
- Appraisals
|
@@ -76,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
78
|
- !ruby/object:Gem::Version
|
77
79
|
version: '0'
|
78
80
|
requirements: []
|
79
|
-
rubygems_version: 3.5.
|
81
|
+
rubygems_version: 3.5.22
|
80
82
|
signing_key:
|
81
83
|
specification_version: 4
|
82
84
|
summary: A OmniAuth strategy to authenticate using different passwort strategies.
|