omniauth-scalingo 1.0.0 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 591861fd8ed10256e73e45730c6d86a8c604a892
4
- data.tar.gz: c29d583cb2ed0445ba67f5f3d51ae2fc97adec32
2
+ SHA256:
3
+ metadata.gz: 5a4c50f2ee1e680e06c657f4955ebc84019cc97426c0ff2324826ad1263baee6
4
+ data.tar.gz: 1b8bf87c938f2d3b634f65048a736ccda2268dfa7292afa2d9d655de1a12bf39
5
5
  SHA512:
6
- metadata.gz: ad73fca9c7fa395a02f1db4bc41b8332d426941b41e8f4d511d1333ff3d18dd01c7dbb5452651f6c598f4cddf95eaba505517c48bcd7f5f687d00ad8c7b3a407
7
- data.tar.gz: 519d7aeb2fe53bd2bb793c77d724f75066a1bafef26f1aae94775fc4f15fe01be2b44db750c03e7eda60387f182108ab7e86b27b7d5b03164bb1488fcccf86f9
6
+ metadata.gz: 237deaba9192449384673211be0f8f562cf7f157f1eb8c22d2722785b8e87d3bffa3bbfad35d2175e27a96e0d555060290ca3e1c3b1221dafa4dc28d08d14647
7
+ data.tar.gz: e9c4ad3763c56dd7b8cdc27abcfe7705f9948d72b15832c520e801d6c277f2f0e7fb895eec03a27d1fc379b4fc17a60c24c7c3f84662787bc3a591a8c3000717
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
7
+ reviewers:
8
+ - "ksol"
@@ -0,0 +1,28 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types: [created]
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Set up Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: 3.0
18
+ bundler-cache: true
19
+ - name: Publish to RubyGems
20
+ run: |
21
+ mkdir -p $HOME/.gem
22
+ touch $HOME/.gem/credentials
23
+ chmod 0600 $HOME/.gem/credentials
24
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
25
+ gem build *.gemspec
26
+ gem push *.gem
27
+ env:
28
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
@@ -0,0 +1,34 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches: [ master ]
7
+ pull_request:
8
+ branches: [ master ]
9
+
10
+ jobs:
11
+ lint:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: 2.7
18
+ bundler-cache: true
19
+ - name: RuboCop checks
20
+ run: bundle exec rubocop
21
+
22
+ test:
23
+ runs-on: ubuntu-latest
24
+ strategy:
25
+ matrix:
26
+ ruby-version: ['2.7', '3.0', '3.1', '3.2']
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby-version }}
32
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
+ - name: Run tests
34
+ run: bundle exec rake
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,33 +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, :all_emails => emails}
40
+ {raw_info: raw_info}
41
41
  end
42
42
 
43
43
  def raw_info
44
- access_token.options[:mode] = :query
45
- @raw_info ||= access_token.get('user').parsed
44
+ @raw_info ||= access_token.get("/v1/users/self").parsed["user"]
46
45
  end
47
46
 
48
47
  def callback_url
49
- full_host + script_name + callback_path
48
+ full_host + callback_path
50
49
  end
51
50
  end
52
51
  end
53
52
  end
54
53
 
55
- 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 = "1.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,25 +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"]
6
- gem.email = ["leo@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
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
13
- gem.files = `git ls-files`.split("\n")
14
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
- gem.name = "omniauth-scalingo"
11
+ gem.metadata = {
12
+ "bug_tracker_uri" => "https://github.com/Scalingo/omniauth-scalingo/issues",
13
+ "documentation_uri" => "https://github.com/Scalingo/omniauth-scalingo",
14
+ "homepage_uri" => "https://github.com/Scalingo/omniauth-scalingo",
15
+ "source_code_uri" => "https://github.com/Scalingo/omniauth-scalingo"
16
+ }
17
+
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"
16
21
  gem.require_paths = ["lib"]
17
- gem.version = OmniAuth::Scalingo::VERSION
22
+ gem.version = OmniAuth::Scalingo::VERSION
18
23
 
19
- gem.add_dependency 'omniauth', '~> 1.5'
20
- gem.add_dependency 'omniauth-oauth2', '>= 1.4.0', '< 2.0'
21
- gem.add_development_dependency 'rspec', '~> 3.5'
22
- gem.add_development_dependency 'rack-test'
23
- gem.add_development_dependency 'simplecov'
24
- 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"
25
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,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-scalingo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Léo Unbekandt
8
+ - Kevin Soltysiak
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
12
+ date: 2023-11-03 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: omniauth
@@ -16,14 +17,14 @@ dependencies:
16
17
  requirements:
17
18
  - - "~>"
18
19
  - !ruby/object:Gem::Version
19
- version: '1.5'
20
+ version: '2.0'
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
25
  - - "~>"
25
26
  - !ruby/object:Gem::Version
26
- version: '1.5'
27
+ version: '2.0'
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: omniauth-oauth2
29
30
  requirement: !ruby/object:Gem::Requirement
@@ -103,12 +104,18 @@ dependencies:
103
104
  description: Official OmniAuth strategy for Scalingo.
104
105
  email:
105
106
  - leo@scalingo.com
107
+ - kevin@scalingo.com
106
108
  executables: []
107
109
  extensions: []
108
110
  extra_rdoc_files: []
109
111
  files:
112
+ - ".github/dependabot.yml"
113
+ - ".github/workflows/publish.yml"
114
+ - ".github/workflows/tests.yml"
110
115
  - ".gitignore"
111
116
  - ".rspec"
117
+ - ".rubocop.yml"
118
+ - CHANGELOG.md
112
119
  - Gemfile
113
120
  - Guardfile
114
121
  - LICENSE.txt
@@ -123,7 +130,11 @@ files:
123
130
  homepage: https://github.com/Scalingo/omniauth-scalingo
124
131
  licenses:
125
132
  - MIT
126
- metadata: {}
133
+ metadata:
134
+ bug_tracker_uri: https://github.com/Scalingo/omniauth-scalingo/issues
135
+ documentation_uri: https://github.com/Scalingo/omniauth-scalingo
136
+ homepage_uri: https://github.com/Scalingo/omniauth-scalingo
137
+ source_code_uri: https://github.com/Scalingo/omniauth-scalingo
127
138
  post_install_message:
128
139
  rdoc_options: []
129
140
  require_paths:
@@ -139,11 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
150
  - !ruby/object:Gem::Version
140
151
  version: '0'
141
152
  requirements: []
142
- rubyforge_project:
143
- rubygems_version: 2.6.13
153
+ rubygems_version: 3.4.10
144
154
  signing_key:
145
155
  specification_version: 4
146
156
  summary: Official OmniAuth strategy for Scalingo.
147
- test_files:
148
- - spec/omniauth/strategies/scalingo_spec.rb
149
- - spec/spec_helper.rb
157
+ test_files: []