omniauth-mlh 0.4.2 → 1.0.1
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 +5 -2
- data/.github/workflows/gem-push.yml +30 -0
- data/.github/workflows/test.yml +30 -0
- data/.rubocop.yml +28 -0
- data/.travis.yml +1 -1
- data/CONTRIBUTING.md +27 -0
- data/Gemfile +2 -0
- data/README.md +5 -8
- data/Rakefile +6 -2
- data/lib/omniauth/strategies/mlh.rb +13 -5
- data/lib/omniauth-mlh/version.rb +3 -5
- data/lib/omniauth_mlh.rb +4 -0
- data/omniauth-mlh.gemspec +22 -17
- data/spec/omni_auth/mlh_spec.rb +39 -0
- data/spec/spec_helper.rb +7 -4
- data/spec/support/shared_examples.rb +17 -10
- metadata +72 -30
- data/.ruby-version +0 -1
- data/lib/omniauth-mlh.rb +0 -3
- data/spec/omniauth/mlh_spec.rb +0 -36
checksums.yaml
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: a8a63e3530dc45956b6373c50995939ce8ea698a3118c473a0a5d497fb75ed55
|
|
4
|
+
data.tar.gz: 14a9fa6f3ee6eb9d26b4496fe0678f17aa805eaf1b15457cc13f172e698ada6e
|
|
2
5
|
SHA512:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 525b5b9983beda5ed9c922e451430f7c6ead1d3ce508fddfd6f2616eab46de12772540d4252a1db6ed632b39a6b388ce35dbb3ba28ef108633f7e38bd3a73102
|
|
7
|
+
data.tar.gz: 9ec5f8644840ceeb01267be362bf26f7cec1e36853611c718ffe46b9a2e48fb9b6c0804c242c65f8612dfde7da80915bbd5d940bcee63c06e6dcf1a25c47ac12
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Push Gem
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
name: Build + Publish
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- name: Set up Ruby 3.2
|
|
16
|
+
uses: ruby/setup-ruby@v1
|
|
17
|
+
with:
|
|
18
|
+
ruby-version: '3.2'
|
|
19
|
+
bundler-cache: true
|
|
20
|
+
|
|
21
|
+
- name: Publish to RubyGems
|
|
22
|
+
run: |
|
|
23
|
+
mkdir -p $HOME/.gem
|
|
24
|
+
touch $HOME/.gem/credentials
|
|
25
|
+
chmod 0600 $HOME/.gem/credentials
|
|
26
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
|
27
|
+
gem build *.gemspec
|
|
28
|
+
gem push *.gem
|
|
29
|
+
env:
|
|
30
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- 'main'
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- 'main'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
ruby: ['2.7', '3.2']
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v2
|
|
19
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
|
20
|
+
uses: ruby/setup-ruby@v1
|
|
21
|
+
with:
|
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: |
|
|
25
|
+
gem install bundler
|
|
26
|
+
bundle install
|
|
27
|
+
- name: Run Spec
|
|
28
|
+
run: bundle exec rake spec
|
|
29
|
+
- name: Run Rubocop
|
|
30
|
+
run: bundle exec rake rubocop
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require:
|
|
2
|
+
- rubocop-rspec
|
|
3
|
+
- rubocop-performance
|
|
4
|
+
|
|
5
|
+
AllCops:
|
|
6
|
+
# Ruby 2.7 is the MINIMUM Ruby version supported
|
|
7
|
+
TargetRubyVersion: '2.7.0'
|
|
8
|
+
Exclude:
|
|
9
|
+
- vendor/**/*
|
|
10
|
+
|
|
11
|
+
Style/WordArray:
|
|
12
|
+
Description: Force arrays of words to use bracket notation instead of %w
|
|
13
|
+
EnforcedStyle: brackets
|
|
14
|
+
Enabled: true
|
|
15
|
+
|
|
16
|
+
Style/SymbolArray:
|
|
17
|
+
Description: Force symbol arrays to use bracket notation instead of %i
|
|
18
|
+
EnforcedStyle: brackets
|
|
19
|
+
Enabled: true
|
|
20
|
+
|
|
21
|
+
Style/RegexpLiteral:
|
|
22
|
+
Description: Allow forward slashes within regular expressions
|
|
23
|
+
AllowInnerSlashes: true
|
|
24
|
+
Enabled: true
|
|
25
|
+
|
|
26
|
+
RSpec/MultipleExpectations:
|
|
27
|
+
Description: Allow tests to contain multiple expectations
|
|
28
|
+
Enabled: false
|
data/.travis.yml
CHANGED
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Contributing Guidelines
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to omniauth-mlh.
|
|
4
|
+
|
|
5
|
+
## Contributor Checklist
|
|
6
|
+
|
|
7
|
+
- Fork the Repo ( https://github.com/mlh/omniauth-mlh/fork )
|
|
8
|
+
- Create your feature branch (`git checkout -b my-new-feature`)
|
|
9
|
+
- Commit your changes (`git commit -am 'Add some feature'`)
|
|
10
|
+
- Push to the branch (`git push origin my-new-feature`)
|
|
11
|
+
- Create a new Pull Request
|
|
12
|
+
|
|
13
|
+
### Running tests
|
|
14
|
+
|
|
15
|
+
Following command can be used to run the test
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
$ bundle exec rake spec
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Code quality tools
|
|
22
|
+
|
|
23
|
+
Code quality is enforced across the entire gem with Rubocop:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
$ bundle exec rubocop
|
|
27
|
+
```
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# MLH/
|
|
1
|
+
# MLH/omniauth-mlh
|
|
2
2
|
|
|
3
|
-
[](https://github.com/MLH/omniauth-mlh/actions/workflows/test.yml)
|
|
4
4
|
|
|
5
5
|
This is the official [OmniAuth](https://github.com/omniauth/omniauth) strategy for
|
|
6
6
|
authenticating with [MyMLH](https://my.mlh.io). To use it, you'll need to
|
|
@@ -12,7 +12,8 @@ Once you have done so, you can follow the instructions below:
|
|
|
12
12
|
|
|
13
13
|
## Requirements
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
This Gem requires your Ruby version to be at least `2.2.0`, which is set
|
|
16
|
+
downstream by [Omniauth](https://github.com/omniauth/omniauth/blob/master/omniauth.gemspec#L22).
|
|
16
17
|
|
|
17
18
|
## Installation
|
|
18
19
|
|
|
@@ -50,11 +51,7 @@ end
|
|
|
50
51
|
|
|
51
52
|
## Contributing
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
55
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
56
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
|
57
|
-
5. Create a new Pull Request
|
|
54
|
+
For guidance on setting up a development environment and how to make a contribution to omniauth-mlh, see the [contributing guidelines](https://github.com/MLH/omniauth-mlh/blob/main/CONTRIBUTING.md).
|
|
58
55
|
|
|
59
56
|
## Credit
|
|
60
57
|
|
data/Rakefile
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env rake
|
|
2
|
-
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'bundler/gem_tasks'
|
|
3
5
|
require 'rspec/core/rake_task'
|
|
6
|
+
require 'rubocop/rake_task'
|
|
4
7
|
|
|
5
8
|
RSpec::Core::RakeTask.new
|
|
9
|
+
RuboCop::RakeTask.new
|
|
6
10
|
|
|
7
11
|
desc 'Run specs'
|
|
8
|
-
task :
|
|
12
|
+
task default: :spec
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'omniauth-oauth2'
|
|
2
4
|
require 'ostruct'
|
|
3
5
|
|
|
4
6
|
module OmniAuth
|
|
5
7
|
module Strategies
|
|
6
|
-
class MLH < OmniAuth::Strategies::OAuth2
|
|
8
|
+
class MLH < OmniAuth::Strategies::OAuth2 # :nodoc:
|
|
7
9
|
option :name, :mlh
|
|
8
10
|
|
|
9
11
|
option :client_options, {
|
|
10
|
-
:
|
|
11
|
-
:
|
|
12
|
-
:
|
|
12
|
+
site: 'https://my.mlh.io',
|
|
13
|
+
authorize_url: 'oauth/authorize',
|
|
14
|
+
token_url: 'oauth/token'
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
uid { data[:id] }
|
|
@@ -35,10 +37,16 @@ module OmniAuth
|
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
def data
|
|
38
|
-
@data ||=
|
|
40
|
+
@data ||= begin
|
|
41
|
+
access_token.get('/api/v3/user.json').parsed.deep_symbolize_keys[:data]
|
|
42
|
+
rescue StandardError
|
|
43
|
+
{}
|
|
44
|
+
end
|
|
39
45
|
end
|
|
40
46
|
end
|
|
41
47
|
end
|
|
42
48
|
end
|
|
43
49
|
|
|
44
50
|
OmniAuth.config.add_camelization 'mlh', 'MLH'
|
|
51
|
+
OmniAuth.config.allowed_request_methods = [:post, :get]
|
|
52
|
+
OmniAuth.config.silence_get_warning = true
|
data/lib/omniauth-mlh/version.rb
CHANGED
data/lib/omniauth_mlh.rb
ADDED
data/omniauth-mlh.gemspec
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
|
|
4
6
|
require 'omniauth-mlh/version'
|
|
5
7
|
|
|
6
8
|
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name =
|
|
9
|
+
spec.name = 'omniauth-mlh'
|
|
8
10
|
spec.version = OmniAuth::MLH::VERSION
|
|
9
|
-
spec.authors = [
|
|
10
|
-
spec.email = [
|
|
11
|
+
spec.authors = ['Major League Hacking (MLH)']
|
|
12
|
+
spec.email = ['hi@mlh.io']
|
|
11
13
|
|
|
12
|
-
spec.summary =
|
|
13
|
-
spec.description =
|
|
14
|
-
spec.homepage =
|
|
15
|
-
spec.license =
|
|
14
|
+
spec.summary = 'Official OmniAuth strategy for MyMLH.'
|
|
15
|
+
spec.description = 'Official OmniAuth strategy for MyMLH.'
|
|
16
|
+
spec.homepage = 'http://github.com/mlh/omniauth-mlh'
|
|
17
|
+
spec.license = 'MIT'
|
|
16
18
|
|
|
17
|
-
spec.required_ruby_version = '>= 2.
|
|
19
|
+
spec.required_ruby_version = '>= 2.7.0'
|
|
18
20
|
|
|
19
|
-
spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
21
|
+
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
|
20
22
|
spec.files = `git ls-files`.split("\n")
|
|
21
23
|
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
22
|
-
spec.require_paths = [
|
|
24
|
+
spec.require_paths = ['lib']
|
|
23
25
|
|
|
24
|
-
spec.add_dependency '
|
|
25
|
-
spec.add_dependency 'omniauth
|
|
26
|
-
spec.add_dependency '
|
|
26
|
+
spec.add_dependency 'oauth2', '~> 2.0.9'
|
|
27
|
+
spec.add_dependency 'omniauth', '~> 2.1.1'
|
|
28
|
+
spec.add_dependency 'omniauth-oauth2', '~> 1.8.0'
|
|
27
29
|
|
|
28
|
-
spec.add_development_dependency 'rspec', '~> 2.7'
|
|
29
|
-
spec.add_development_dependency 'rake', '~> 10.5'
|
|
30
30
|
spec.add_development_dependency 'rack-test'
|
|
31
|
+
spec.add_development_dependency 'rake', '~> 12.3.3'
|
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.10'
|
|
33
|
+
spec.add_development_dependency 'rubocop', '~> 1.0'
|
|
34
|
+
spec.add_development_dependency 'rubocop-performance'
|
|
35
|
+
spec.add_development_dependency 'rubocop-rspec'
|
|
31
36
|
spec.add_development_dependency 'simplecov'
|
|
32
37
|
spec.add_development_dependency 'webmock'
|
|
33
38
|
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
describe OmniAuth::MLH do
|
|
6
|
+
subject(:omniauth_mlh) do
|
|
7
|
+
# The instance variable @options is being used to pass options to the subject of the shared examples
|
|
8
|
+
OmniAuth::Strategies::MLH.new(nil, @options || {}) # rubocop:disable RSpec/InstanceVariable
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it_behaves_like 'an oauth2 strategy'
|
|
12
|
+
|
|
13
|
+
describe '#client' do
|
|
14
|
+
it 'has correct MyMLH site' do
|
|
15
|
+
expect(omniauth_mlh.client.site).to eq('https://my.mlh.io')
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'has correct authorize url' do
|
|
19
|
+
expect(omniauth_mlh.client.options[:authorize_url]).to eq('oauth/authorize')
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it 'has correct token url' do
|
|
23
|
+
expect(omniauth_mlh.client.options[:token_url]).to eq('oauth/token')
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it 'runs the setup block if passed one' do
|
|
27
|
+
counter = ''
|
|
28
|
+
@options = { setup: proc { |_env| counter = 'ok' } }
|
|
29
|
+
omniauth_mlh.setup_phase
|
|
30
|
+
expect(counter).to eq('ok')
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe '#callback_path' do
|
|
35
|
+
it 'has the correct callback path' do
|
|
36
|
+
expect(omniauth_mlh.callback_path).to eq('/auth/mlh/callback')
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
|
|
2
4
|
|
|
3
5
|
require 'simplecov'
|
|
4
6
|
SimpleCov.start
|
|
@@ -8,13 +10,14 @@ require 'rspec'
|
|
|
8
10
|
require 'rack/test'
|
|
9
11
|
require 'webmock/rspec'
|
|
10
12
|
require 'omniauth'
|
|
11
|
-
require '
|
|
12
|
-
|
|
13
|
+
require 'omniauth_mlh'
|
|
14
|
+
|
|
15
|
+
Dir[File.expand_path('support/**/*', __dir__)].sort.each { |f| require f }
|
|
13
16
|
|
|
14
17
|
RSpec.configure do |config|
|
|
15
18
|
config.include WebMock::API
|
|
16
19
|
config.include Rack::Test::Methods
|
|
17
|
-
config.extend OmniAuth::Test::StrategyMacros, :
|
|
20
|
+
config.extend OmniAuth::Test::StrategyMacros, type: :strategy
|
|
18
21
|
|
|
19
22
|
OmniAuth.config.test_mode = true
|
|
20
23
|
end
|
|
@@ -1,37 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Credit: https://github.com/datariot/omniauth-paypal/blob/master/spec/support/shared_examples.rb
|
|
2
4
|
# NOTE it would be useful if this lived in omniauth-oauth2 eventually
|
|
3
5
|
|
|
4
6
|
shared_examples 'an oauth2 strategy' do
|
|
5
7
|
describe '#client' do
|
|
6
|
-
it '
|
|
7
|
-
@options = { :
|
|
8
|
+
it 'is initialized with symbolized client_options' do
|
|
9
|
+
@options = { client_options: { 'authorize_url' => 'https://example.com' } }
|
|
10
|
+
|
|
8
11
|
expect(subject.client.options[:authorize_url]).to eq('https://example.com')
|
|
9
12
|
end
|
|
10
13
|
end
|
|
11
14
|
|
|
12
15
|
describe '#authorize_params' do
|
|
13
|
-
it '
|
|
14
|
-
@options = { :
|
|
16
|
+
it 'includes any authorize params passed in the :authorize_params option' do
|
|
17
|
+
@options = { authorize_params: { foo: 'bar', baz: 'zip' } }
|
|
18
|
+
|
|
15
19
|
expect(subject.authorize_params['foo']).to eq('bar')
|
|
16
20
|
expect(subject.authorize_params['baz']).to eq('zip')
|
|
17
21
|
end
|
|
18
22
|
|
|
19
|
-
it '
|
|
20
|
-
@options = { :
|
|
23
|
+
it 'includes top-level options that are marked as :authorize_options' do
|
|
24
|
+
@options = { authorize_options: ['scope', 'foo'], scope: 'bar', foo: 'baz' }
|
|
25
|
+
|
|
21
26
|
expect(subject.authorize_params['scope']).to eq('bar')
|
|
22
27
|
expect(subject.authorize_params['foo']).to eq('baz')
|
|
23
28
|
end
|
|
24
29
|
end
|
|
25
30
|
|
|
26
31
|
describe '#token_params' do
|
|
27
|
-
it '
|
|
28
|
-
@options = { :
|
|
32
|
+
it 'includes any token params passed in the :token_params option' do
|
|
33
|
+
@options = { token_params: { foo: 'bar', baz: 'zip' } }
|
|
34
|
+
|
|
29
35
|
expect(subject.token_params['foo']).to eq('bar')
|
|
30
36
|
expect(subject.token_params['baz']).to eq('zip')
|
|
31
37
|
end
|
|
32
38
|
|
|
33
|
-
it '
|
|
34
|
-
@options = { :
|
|
39
|
+
it 'includes top-level options that are marked as :token_options' do
|
|
40
|
+
@options = { token_options: [:scope, :foo], scope: 'bar', foo: 'baz' }
|
|
41
|
+
|
|
35
42
|
expect(subject.token_params['scope']).to eq('bar')
|
|
36
43
|
expect(subject.token_params['foo']).to eq('baz')
|
|
37
44
|
end
|
metadata
CHANGED
|
@@ -1,87 +1,129 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-mlh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
autorequire:
|
|
7
|
+
- Major League Hacking (MLH)
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: oauth2
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 2.0.9
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 2.0.9
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
name: omniauth
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
|
16
30
|
requirements:
|
|
17
31
|
- - "~>"
|
|
18
32
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
33
|
+
version: 2.1.1
|
|
20
34
|
type: :runtime
|
|
21
35
|
prerelease: false
|
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
37
|
requirements:
|
|
24
38
|
- - "~>"
|
|
25
39
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
40
|
+
version: 2.1.1
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: omniauth-oauth2
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
30
44
|
requirements:
|
|
31
45
|
- - "~>"
|
|
32
46
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 1.
|
|
47
|
+
version: 1.8.0
|
|
34
48
|
type: :runtime
|
|
35
49
|
prerelease: false
|
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
51
|
requirements:
|
|
38
52
|
- - "~>"
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 1.
|
|
54
|
+
version: 1.8.0
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
56
|
+
name: rack-test
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
44
58
|
requirements:
|
|
45
59
|
- - ">="
|
|
46
60
|
- !ruby/object:Gem::Version
|
|
47
61
|
version: '0'
|
|
48
|
-
type: :
|
|
62
|
+
type: :development
|
|
49
63
|
prerelease: false
|
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
65
|
requirements:
|
|
52
66
|
- - ">="
|
|
53
67
|
- !ruby/object:Gem::Version
|
|
54
68
|
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rake
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 12.3.3
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 12.3.3
|
|
55
83
|
- !ruby/object:Gem::Dependency
|
|
56
84
|
name: rspec
|
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
|
58
86
|
requirements:
|
|
59
87
|
- - "~>"
|
|
60
88
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
89
|
+
version: '3.10'
|
|
62
90
|
type: :development
|
|
63
91
|
prerelease: false
|
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
93
|
requirements:
|
|
66
94
|
- - "~>"
|
|
67
95
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
96
|
+
version: '3.10'
|
|
69
97
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
98
|
+
name: rubocop
|
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
|
72
100
|
requirements:
|
|
73
101
|
- - "~>"
|
|
74
102
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
103
|
+
version: '1.0'
|
|
76
104
|
type: :development
|
|
77
105
|
prerelease: false
|
|
78
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
107
|
requirements:
|
|
80
108
|
- - "~>"
|
|
81
109
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
110
|
+
version: '1.0'
|
|
83
111
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
112
|
+
name: rubocop-performance
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: rubocop-rspec
|
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
|
86
128
|
requirements:
|
|
87
129
|
- - ">="
|
|
@@ -122,33 +164,36 @@ dependencies:
|
|
|
122
164
|
- - ">="
|
|
123
165
|
- !ruby/object:Gem::Version
|
|
124
166
|
version: '0'
|
|
125
|
-
description: Official OmniAuth strategy for
|
|
167
|
+
description: Official OmniAuth strategy for MyMLH.
|
|
126
168
|
email:
|
|
127
|
-
-
|
|
169
|
+
- hi@mlh.io
|
|
128
170
|
executables: []
|
|
129
171
|
extensions: []
|
|
130
172
|
extra_rdoc_files: []
|
|
131
173
|
files:
|
|
174
|
+
- ".github/workflows/gem-push.yml"
|
|
175
|
+
- ".github/workflows/test.yml"
|
|
132
176
|
- ".gitignore"
|
|
133
177
|
- ".rspec"
|
|
134
|
-
- ".
|
|
178
|
+
- ".rubocop.yml"
|
|
135
179
|
- ".travis.yml"
|
|
180
|
+
- CONTRIBUTING.md
|
|
136
181
|
- Gemfile
|
|
137
182
|
- LICENSE.txt
|
|
138
183
|
- README.md
|
|
139
184
|
- Rakefile
|
|
140
|
-
- lib/omniauth-mlh.rb
|
|
141
185
|
- lib/omniauth-mlh/version.rb
|
|
142
186
|
- lib/omniauth/strategies/mlh.rb
|
|
187
|
+
- lib/omniauth_mlh.rb
|
|
143
188
|
- omniauth-mlh.gemspec
|
|
144
|
-
- spec/
|
|
189
|
+
- spec/omni_auth/mlh_spec.rb
|
|
145
190
|
- spec/spec_helper.rb
|
|
146
191
|
- spec/support/shared_examples.rb
|
|
147
192
|
homepage: http://github.com/mlh/omniauth-mlh
|
|
148
193
|
licenses:
|
|
149
194
|
- MIT
|
|
150
195
|
metadata: {}
|
|
151
|
-
post_install_message:
|
|
196
|
+
post_install_message:
|
|
152
197
|
rdoc_options: []
|
|
153
198
|
require_paths:
|
|
154
199
|
- lib
|
|
@@ -156,18 +201,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
156
201
|
requirements:
|
|
157
202
|
- - ">="
|
|
158
203
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: 2.
|
|
204
|
+
version: 2.7.0
|
|
160
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
206
|
requirements:
|
|
162
207
|
- - ">="
|
|
163
208
|
- !ruby/object:Gem::Version
|
|
164
209
|
version: '0'
|
|
165
210
|
requirements: []
|
|
166
|
-
rubygems_version: 3.
|
|
167
|
-
signing_key:
|
|
211
|
+
rubygems_version: 3.4.10
|
|
212
|
+
signing_key:
|
|
168
213
|
specification_version: 4
|
|
169
|
-
summary: Official OmniAuth strategy for
|
|
170
|
-
test_files:
|
|
171
|
-
- spec/omniauth/mlh_spec.rb
|
|
172
|
-
- spec/spec_helper.rb
|
|
173
|
-
- spec/support/shared_examples.rb
|
|
214
|
+
summary: Official OmniAuth strategy for MyMLH.
|
|
215
|
+
test_files: []
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.2.4
|
data/lib/omniauth-mlh.rb
DELETED
data/spec/omniauth/mlh_spec.rb
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe OmniAuth::MLH do
|
|
4
|
-
subject do
|
|
5
|
-
OmniAuth::Strategies::MLH.new(nil, @options || {})
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
it_should_behave_like 'an oauth2 strategy'
|
|
9
|
-
|
|
10
|
-
describe '#client' do
|
|
11
|
-
it 'has correct MyMLH site' do
|
|
12
|
-
expect(subject.client.site).to eq('https://my.mlh.io')
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
it 'has correct authorize url' do
|
|
16
|
-
expect(subject.client.options[:authorize_url]).to eq('/oauth/authorize')
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it 'has correct token url' do
|
|
20
|
-
expect(subject.client.options[:token_url]).to eq('/oauth/token')
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it 'runs the setup block if passed one' do
|
|
24
|
-
counter = ''
|
|
25
|
-
@options = { :setup => Proc.new { |env| counter = 'ok' } }
|
|
26
|
-
subject.setup_phase
|
|
27
|
-
expect(counter).to eq("ok")
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
describe '#callback_path' do
|
|
32
|
-
it "has the correct callback path" do
|
|
33
|
-
expect(subject.callback_path).to eq('/auth/mlh/callback')
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|