omniauth-scalingo 2.0.0 → 2.1.0

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
2
  SHA256:
3
- metadata.gz: 9d4a96aa3d0b5f12d5a58c8ae4d420a3c5ec46ac029a1d53e49da20d428aa92a
4
- data.tar.gz: 9182e414b03518a06e999ed5dedb9f251a2faade96c650f5a624aa8131703754
3
+ metadata.gz: 5a4c50f2ee1e680e06c657f4955ebc84019cc97426c0ff2324826ad1263baee6
4
+ data.tar.gz: 1b8bf87c938f2d3b634f65048a736ccda2268dfa7292afa2d9d655de1a12bf39
5
5
  SHA512:
6
- metadata.gz: 4232df838bd8fd4f771b50265def26244a7ad10ffe1b7bf8b82dd4d453a5863a72a0aa441ddbd0df5a77e977a4542dceb2858e5eeec94aa87522a4b3d2d53e20
7
- data.tar.gz: 5673499fd12c0614ae860cdf97a80fabcb05de8d71051b20c046b0f52d2470b407892249e2b52fa9c037ecfc1ac67f2bf6d0f4c9cdbad228b45cd63cb296edac
6
+ metadata.gz: 237deaba9192449384673211be0f8f562cf7f157f1eb8c22d2722785b8e87d3bffa3bbfad35d2175e27a96e0d555060290ca3e1c3b1221dafa4dc28d08d14647
7
+ data.tar.gz: e9c4ad3763c56dd7b8cdc27abcfe7705f9948d72b15832c520e801d6c277f2f0e7fb895eec03a27d1fc379b4fc17a60c24c7c3f84662787bc3a591a8c3000717
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v4
14
14
  - name: Set up Ruby
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
@@ -11,10 +11,10 @@ jobs:
11
11
  lint:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v4
15
15
  - uses: ruby/setup-ruby@v1
16
16
  with:
17
- ruby-version: 3.0
17
+ ruby-version: 2.7
18
18
  bundler-cache: true
19
19
  - name: RuboCop checks
20
20
  run: bundle exec rubocop
@@ -23,9 +23,9 @@ jobs:
23
23
  runs-on: ubuntu-latest
24
24
  strategy:
25
25
  matrix:
26
- ruby-version: ['2.7', '3.0', '3.1']
26
+ ruby-version: ['2.7', '3.0', '3.1', '3.2']
27
27
  steps:
28
- - uses: actions/checkout@v2
28
+ - uses: actions/checkout@v4
29
29
  - uses: ruby/setup-ruby@v1
30
30
  with:
31
31
  ruby-version: ${{ matrix.ruby-version }}
data/.rubocop.yml ADDED
@@ -0,0 +1,15 @@
1
+ require:
2
+ - standard
3
+ - standard-custom
4
+ - standard-performance
5
+ - rubocop-performance
6
+
7
+ inherit_gem:
8
+ standard: config/base.yml
9
+ standard-custom: config/base.yml
10
+ standard-performance: config/base.yml
11
+
12
+ AllCops:
13
+ TargetRubyVersion: 2.7
14
+ SuggestExtensions: false
15
+ NewCops: enable
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ ### Unreleased
2
+
3
+ ### 2.1.0
4
+
5
+ * chore: added ruby 3.2 to the matrix of supported versions
6
+ * chore: linted the codebase with https://github.com/standardrb/standard
7
+ * tests: restored CI to a working state
8
+ * bugfix: fixed handling of `script_name` following the bump to omniauth 2.0
9
+
10
+ ### 2.0.0
11
+
12
+ * Major change: bumps omniauth from 1.5 to 2.0 due to https://github.com/advisories/GHSA-ww4x-rwq6-qpgf
data/Gemfile CHANGED
@@ -1,13 +1,14 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in omniauth-scalingo.gemspec
4
4
  gemspec
5
5
 
6
6
  group :development, :test do
7
- gem 'guard'
8
- gem 'guard-rspec'
9
- gem 'guard-bundler'
10
- gem 'rb-fsevent'
11
- gem 'growl'
12
- gem 'rake'
7
+ gem "guard"
8
+ gem "guard-rspec"
9
+ gem "guard-bundler"
10
+ gem "rb-fsevent"
11
+ gem "growl"
12
+ gem "rake"
13
+ gem "standard", "~> 1.31"
13
14
  end
data/Guardfile CHANGED
@@ -1,10 +1,10 @@
1
- guard 'rspec', :version => 2 do
1
+ guard "rspec", version: 2 do
2
2
  watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
- watch('spec/spec_helper.rb') { "spec" }
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
+ watch("spec/spec_helper.rb") { "spec" }
5
5
  end
6
6
 
7
- guard 'bundler' do
8
- watch('Gemfile')
9
- watch('omniauth-scalingo.gemspec')
7
+ guard "bundler" do
8
+ watch("Gemfile")
9
+ watch("omniauth-scalingo.gemspec")
10
10
  end
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
- require 'rspec/core/rake_task'
3
+ require "rspec/core/rake_task"
4
4
 
5
5
  RSpec::Core::RakeTask.new
6
6
 
7
- desc 'Run specs'
8
- task :default => :spec
7
+ desc "Run specs"
8
+ task default: :spec
@@ -1,12 +1,12 @@
1
- require 'omniauth-oauth2'
1
+ require "omniauth-oauth2"
2
2
 
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Scalingo < OmniAuth::Strategies::OAuth2
6
6
  option :client_options, {
7
- :site => 'https://auth.scalingo.com',
8
- :authorize_url => 'https://auth.scalingo.com/oauth/authorize',
9
- :token_url => 'https://auth.scalingo.com/oauth/token'
7
+ site: "https://auth.scalingo.com",
8
+ authorize_url: "https://auth.scalingo.com/oauth/authorize",
9
+ token_url: "https://auth.scalingo.com/oauth/token"
10
10
  }
11
11
 
12
12
  def request_phase
@@ -23,32 +23,32 @@ module OmniAuth
23
23
  end
24
24
  end
25
25
 
26
- uid { raw_info['id'].to_s }
26
+ uid { raw_info["id"].to_s }
27
27
 
28
28
  info do
29
29
  {
30
- 'uuid' => raw_info['id'],
31
- 'username' => raw_info['username'],
32
- 'email' => raw_info['email'],
33
- 'first_name' => raw_info['first_name'],
34
- 'last_name' => raw_info['last_name'],
35
- 'flags' => raw_info['flags'],
30
+ "uuid" => raw_info["id"],
31
+ "username" => raw_info["username"],
32
+ "email" => raw_info["email"],
33
+ "first_name" => raw_info["first_name"],
34
+ "last_name" => raw_info["last_name"],
35
+ "flags" => raw_info["flags"]
36
36
  }
37
37
  end
38
38
 
39
39
  extra do
40
- {:raw_info => raw_info}
40
+ {raw_info: raw_info}
41
41
  end
42
42
 
43
43
  def raw_info
44
- @raw_info ||= access_token.get('/v1/users/self').parsed['user']
44
+ @raw_info ||= access_token.get("/v1/users/self").parsed["user"]
45
45
  end
46
46
 
47
47
  def callback_url
48
- full_host + script_name + callback_path
48
+ full_host + callback_path
49
49
  end
50
50
  end
51
51
  end
52
52
  end
53
53
 
54
- OmniAuth.config.add_camelization 'scalingo', 'Scalingo'
54
+ OmniAuth.config.add_camelization "scalingo", "Scalingo"
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Scalingo
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -1,2 +1,2 @@
1
1
  require "omniauth-scalingo/version"
2
- require 'omniauth/strategies/scalingo'
2
+ require "omniauth/strategies/scalingo"
@@ -1,32 +1,30 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/omniauth-scalingo/version', __FILE__)
1
+ require File.expand_path("../lib/omniauth-scalingo/version", __FILE__)
3
2
 
4
3
  Gem::Specification.new do |gem|
5
- gem.authors = ["Léo Unbekandt", "Kevin Soltysiak"]
6
- gem.email = ["leo@scalingo.com", "kevin@scalingo.com"]
7
- gem.description = %q{Official OmniAuth strategy for Scalingo.}
8
- gem.summary = %q{Official OmniAuth strategy for Scalingo.}
9
- gem.homepage = "https://github.com/Scalingo/omniauth-scalingo"
10
- gem.license = "MIT"
4
+ gem.authors = ["Léo Unbekandt", "Kevin Soltysiak"]
5
+ gem.email = ["leo@scalingo.com", "kevin@scalingo.com"]
6
+ gem.description = "Official OmniAuth strategy for Scalingo."
7
+ gem.summary = "Official OmniAuth strategy for Scalingo."
8
+ gem.homepage = "https://github.com/Scalingo/omniauth-scalingo"
9
+ gem.license = "MIT"
11
10
 
12
11
  gem.metadata = {
13
12
  "bug_tracker_uri" => "https://github.com/Scalingo/omniauth-scalingo/issues",
14
13
  "documentation_uri" => "https://github.com/Scalingo/omniauth-scalingo",
15
14
  "homepage_uri" => "https://github.com/Scalingo/omniauth-scalingo",
16
- "source_code_uri" => "https://github.com/Scalingo/omniauth-scalingo",
15
+ "source_code_uri" => "https://github.com/Scalingo/omniauth-scalingo"
17
16
  }
18
17
 
19
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
- gem.files = `git ls-files`.split("\n")
21
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
- gem.name = "omniauth-scalingo"
18
+ gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
19
+ gem.files = `git ls-files`.split("\n")
20
+ gem.name = "omniauth-scalingo"
23
21
  gem.require_paths = ["lib"]
24
- gem.version = OmniAuth::Scalingo::VERSION
22
+ gem.version = OmniAuth::Scalingo::VERSION
25
23
 
26
- gem.add_dependency 'omniauth', '~> 2.0'
27
- gem.add_dependency 'omniauth-oauth2', '>= 1.4.0', '< 2.0'
28
- gem.add_development_dependency 'rspec', '~> 3.5'
29
- gem.add_development_dependency 'rack-test'
30
- gem.add_development_dependency 'simplecov'
31
- gem.add_development_dependency 'webmock'
24
+ gem.add_dependency "omniauth", "~> 2.0"
25
+ gem.add_dependency "omniauth-oauth2", ">= 1.4.0", "< 2.0"
26
+ gem.add_development_dependency "rspec", "~> 3.5"
27
+ gem.add_development_dependency "rack-test"
28
+ gem.add_development_dependency "simplecov"
29
+ gem.add_development_dependency "webmock"
32
30
  end
@@ -1,9 +1,9 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe OmniAuth::Strategies::Scalingo do
4
- let(:access_token) { instance_double('AccessToken', :options => {}) }
5
- let(:parsed_response) { instance_double('ParsedResponse') }
6
- let(:response) { instance_double('Response', :parsed => parsed_response) }
4
+ let(:access_token) { instance_double("AccessToken", options: {}) }
5
+ let(:parsed_response) { instance_spy("ParsedResponse") }
6
+ let(:response) { instance_double("Response", parsed: parsed_response) }
7
7
 
8
8
  subject do
9
9
  OmniAuth::Strategies::Scalingo.new({})
@@ -13,33 +13,33 @@ describe OmniAuth::Strategies::Scalingo do
13
13
  allow(subject).to receive(:access_token).and_return(access_token)
14
14
  end
15
15
 
16
- context 'client options' do
17
- it 'should have correct site' do
18
- expect(subject.options.client_options.site).to eq('https://auth.scalingo.com')
16
+ context "client options" do
17
+ it "should have correct site" do
18
+ expect(subject.options.client_options.site).to eq("https://auth.scalingo.com")
19
19
  end
20
20
 
21
- it 'should have correct authorize url' do
22
- expect(subject.options.client_options.authorize_url).to eq('https://auth.scalingo.com/oauth/authorize')
21
+ it "should have correct authorize url" do
22
+ expect(subject.options.client_options.authorize_url).to eq("https://auth.scalingo.com/oauth/authorize")
23
23
  end
24
24
 
25
- it 'should have correct token url' do
26
- expect(subject.options.client_options.token_url).to eq('https://auth.scalingo.com/oauth/token')
25
+ it "should have correct token url" do
26
+ expect(subject.options.client_options.token_url).to eq("https://auth.scalingo.com/oauth/token")
27
27
  end
28
28
  end
29
29
 
30
- context '#raw_info' do
31
- it 'should use relative paths' do
32
- expect(access_token).to receive(:get).with('user').and_return(response)
30
+ context "#raw_info" do
31
+ it "should use relative paths" do
32
+ expect(access_token).to receive(:get).with("/v1/users/self").and_return(response)
33
33
  expect(subject.raw_info).to eq(parsed_response)
34
34
  end
35
35
  end
36
36
 
37
- describe '#callback_url' do
38
- it 'is a combination of host, script name, and callback path' do
39
- allow(subject).to receive(:full_host).and_return('https://example.com')
40
- allow(subject).to receive(:script_name).and_return('/sub_uri')
37
+ describe "#callback_url" do
38
+ it "is a combination of host, script name, and callback path" do
39
+ allow(subject).to receive(:full_host).and_return("https://example.com")
40
+ allow(subject).to receive(:script_name).and_return("/sub_uri")
41
41
 
42
- expect(subject.callback_url).to eq('https://example.com/sub_uri/auth/scalingo/callback')
42
+ expect(subject.callback_url).to eq("https://example.com/sub_uri/auth/scalingo/callback")
43
43
  end
44
44
  end
45
45
  end
data/spec/spec_helper.rb CHANGED
@@ -1,16 +1,15 @@
1
- $:.unshift File.expand_path('..', __FILE__)
2
- $:.unshift File.expand_path('../../lib', __FILE__)
3
- require 'simplecov'
1
+ $:.unshift File.expand_path("..", __FILE__)
2
+ $:.unshift File.expand_path("../../lib", __FILE__)
3
+ require "simplecov"
4
4
  SimpleCov.start
5
- require 'rspec'
6
- require 'rack/test'
7
- require 'webmock/rspec'
8
- require 'omniauth'
9
- require 'omniauth-scalingo'
5
+ require "rspec"
6
+ require "rack/test"
7
+ require "webmock/rspec"
8
+ require "omniauth"
9
+ require "omniauth-scalingo"
10
10
 
11
11
  RSpec.configure do |config|
12
12
  config.include WebMock::API
13
13
  config.include Rack::Test::Methods
14
- config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
14
+ config.extend OmniAuth::Test::StrategyMacros, type: :strategy
15
15
  end
16
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-scalingo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Léo Unbekandt
@@ -114,6 +114,8 @@ files:
114
114
  - ".github/workflows/tests.yml"
115
115
  - ".gitignore"
116
116
  - ".rspec"
117
+ - ".rubocop.yml"
118
+ - CHANGELOG.md
117
119
  - Gemfile
118
120
  - Guardfile
119
121
  - LICENSE.txt