omniauth-strategies-passthrough 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1398cb0a7204bd78703f0f4d2813f5e6b4c620a2f1fb9b3fbaa4ddfe6e0897ca
4
+ data.tar.gz: 20111ebdd39877d5e0a77e1bd4a1e80b1eaf877d36c5f56c52d74c7f2f67180f
5
+ SHA512:
6
+ metadata.gz: 16c343ab69a2d9198d7137eec3c216ae251b7ed476d1e0bdc063f7a31030b4f684d664bfc8d63278da7a0e2876a287b242663dacf3e99c4a3297665d04dd5edb
7
+ data.tar.gz: 1b112d768450f3c6593e68affc8966dc2a5be76b8a74ee4f23d16ba2cecc02baac7c84dde5b414259d0d3f5dfa81f39300940f74de8d3bd1f14707f017eba4c8
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # 1.0.0 (2023-07-30)
2
+
3
+
4
+ ### Features
5
+
6
+ * omniauth-strategies-passthrough ([#1](https://github.com/benmelz/omniauth-strategies-passthrough/issues/1)) ([2478e9f](https://github.com/benmelz/omniauth-strategies-passthrough/commit/2478e9f4d46bb97bc063163ebb326ec5d10ff816))
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 benmelz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,50 @@
1
+ = <tt>omniauth-strategies-passthrough</tt>
2
+
3
+ An OmniAuth strategy that passes request params straight through the middleware.
4
+
5
+ This strategy allows you to pass auth hash values directly to an auth endpoint and forwards them directly to your
6
+ callback(s). The end goal of this is to provide more flexibility when writing login helpers in development/test
7
+ environments while still utilizing your OmniAuth callback(s).
8
+
9
+ == Installation
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ bundle add omniauth-strategies-passthrough
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ gem install omniauth-strategies-passthrough
18
+
19
+ == Usage
20
+
21
+ Include the <tt>passthrough</tt> strategy in development/test environments as you would with any other OmniAuth
22
+ strategy. *NEVER* use it in a production environment.
23
+
24
+ Once included, any POST request to <tt>/auth/passthrough</tt> will pass through any <tt>uid</tt> and <tt>info</tt>
25
+ params to your omniauth callback.
26
+
27
+ # request
28
+ post '/auth/passthrough',
29
+ params: { uid: 'my-uid', info: { email: 'my-email@example.com', first_name: 'My', last_name: 'Name' } }
30
+
31
+ # callback
32
+ request.env['omniauth.auth'].uid # => 'my-uid'
33
+ request.env['omniauth.auth'].info.email # => 'my-email@example.com'
34
+ request.env['omniauth.auth'].info.first_name # => 'My'
35
+ request.env['omniauth.auth'].info.last_name # => 'Name'
36
+
37
+ == Development
38
+
39
+ * Run <tt>bin/setup</tt> to install dependencies.
40
+ * Run <tt>bin/rake appraisal spec</tt> to run the tests.
41
+ * Run <tt>bin/rake rubocop</tt> to run the linter.
42
+ * Run <tt>bin/console</tt> for an interactive prompt that will allow you to experiment.
43
+
44
+ == Contributing
45
+
46
+ Bug reports and pull requests are welcome on {GitHub}[https://github.com/benmelz/omniauth-strategies-passthrough].
47
+
48
+ == License
49
+
50
+ The gem is available as open source under the terms of the {MIT License}[https://opensource.org/licenses/MIT].
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Passthrough
6
+ VERSION = '1.0.0'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth'
4
+ require_relative 'passthrough/version'
5
+
6
+ module OmniAuth
7
+ module Strategies
8
+ # :include: README.rdoc
9
+ class Passthrough
10
+ include OmniAuth::Strategy
11
+
12
+ def request_phase
13
+ redirect(URI.parse(callback_url).tap { |uri| uri.query = Rack::Utils.build_nested_query(request.params) }.to_s)
14
+ end
15
+
16
+ uid { request.params['uid'] }
17
+ info { request.params['info'] || {} }
18
+ end
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-strategies-passthrough
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Benjamin Melz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-07-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.9'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
33
+ description: 'This strategy allows you to pass auth hash values directly to an auth
34
+ endpoint and forwards them directly to your callback(s). The end goal of this is
35
+ to provide more flexibility when writing login helpers in development/test environments
36
+ while still utilizing your OmniAuth callback(s). '
37
+ email:
38
+ - ben@melz.me
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - CHANGELOG.md
44
+ - LICENSE.md
45
+ - README.rdoc
46
+ - lib/omniauth/strategies/passthrough.rb
47
+ - lib/omniauth/strategies/passthrough/version.rb
48
+ homepage: https://github.com/benmelz/omniauth-strategies-passthrough
49
+ licenses:
50
+ - MIT
51
+ metadata:
52
+ homepage_uri: https://github.com/benmelz/omniauth-strategies-passthrough
53
+ source_code_uri: https://github.com/benmelz/omniauth-strategies-passthrough
54
+ changelog_uri: https://github.com/benmelz/omniauth-strategies-passthrough/blob/v1.0.0/CHANGELOG.md
55
+ rubygems_mfa_required: 'true'
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '3.0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubygems_version: 3.4.10
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: An OmniAuth strategy that passes request params straight through the middleware.
75
+ test_files: []