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 +4 -4
- data/.github/workflows/publish.yml +1 -1
- data/.github/workflows/tests.yml +4 -4
- data/.rubocop.yml +15 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +8 -7
- data/Guardfile +6 -6
- data/Rakefile +3 -3
- data/lib/omniauth/strategies/scalingo.rb +15 -15
- data/lib/omniauth-scalingo/version.rb +1 -1
- data/lib/omniauth-scalingo.rb +1 -1
- data/omniauth-scalingo.gemspec +18 -20
- data/spec/omniauth/strategies/scalingo_spec.rb +19 -19
- data/spec/spec_helper.rb +9 -10
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a4c50f2ee1e680e06c657f4955ebc84019cc97426c0ff2324826ad1263baee6
|
4
|
+
data.tar.gz: 1b8bf87c938f2d3b634f65048a736ccda2268dfa7292afa2d9d655de1a12bf39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 237deaba9192449384673211be0f8f562cf7f157f1eb8c22d2722785b8e87d3bffa3bbfad35d2175e27a96e0d555060290ca3e1c3b1221dafa4dc28d08d14647
|
7
|
+
data.tar.gz: e9c4ad3763c56dd7b8cdc27abcfe7705f9948d72b15832c520e801d6c277f2f0e7fb895eec03a27d1fc379b4fc17a60c24c7c3f84662787bc3a591a8c3000717
|
data/.github/workflows/tests.yml
CHANGED
@@ -11,10 +11,10 @@ jobs:
|
|
11
11
|
lint:
|
12
12
|
runs-on: ubuntu-latest
|
13
13
|
steps:
|
14
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v4
|
15
15
|
- uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
17
|
-
ruby-version:
|
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@
|
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
|
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
|
8
|
-
gem
|
9
|
-
gem
|
10
|
-
gem
|
11
|
-
gem
|
12
|
-
gem
|
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
|
1
|
+
guard "rspec", version: 2 do
|
2
2
|
watch(%r{^spec/.+_spec\.rb$})
|
3
|
-
watch(%r{^lib/(.+)\.rb$})
|
4
|
-
watch(
|
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
|
8
|
-
watch(
|
9
|
-
watch(
|
7
|
+
guard "bundler" do
|
8
|
+
watch("Gemfile")
|
9
|
+
watch("omniauth-scalingo.gemspec")
|
10
10
|
end
|
data/Rakefile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
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
|
-
:
|
8
|
-
:
|
9
|
-
:
|
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[
|
26
|
+
uid { raw_info["id"].to_s }
|
27
27
|
|
28
28
|
info do
|
29
29
|
{
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
{:
|
40
|
+
{raw_info: raw_info}
|
41
41
|
end
|
42
42
|
|
43
43
|
def raw_info
|
44
|
-
@raw_info ||= access_token.get(
|
44
|
+
@raw_info ||= access_token.get("/v1/users/self").parsed["user"]
|
45
45
|
end
|
46
46
|
|
47
47
|
def callback_url
|
48
|
-
full_host +
|
48
|
+
full_host + callback_path
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
OmniAuth.config.add_camelization
|
54
|
+
OmniAuth.config.add_camelization "scalingo", "Scalingo"
|
data/lib/omniauth-scalingo.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require "omniauth-scalingo/version"
|
2
|
-
require
|
2
|
+
require "omniauth/strategies/scalingo"
|
data/omniauth-scalingo.gemspec
CHANGED
@@ -1,32 +1,30 @@
|
|
1
|
-
|
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
|
6
|
-
gem.email
|
7
|
-
gem.description
|
8
|
-
gem.summary
|
9
|
-
gem.homepage
|
10
|
-
gem.license
|
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
|
20
|
-
gem.files
|
21
|
-
gem.
|
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
|
22
|
+
gem.version = OmniAuth::Scalingo::VERSION
|
25
23
|
|
26
|
-
gem.add_dependency
|
27
|
-
gem.add_dependency
|
28
|
-
gem.add_development_dependency
|
29
|
-
gem.add_development_dependency
|
30
|
-
gem.add_development_dependency
|
31
|
-
gem.add_development_dependency
|
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
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe OmniAuth::Strategies::Scalingo do
|
4
|
-
let(:access_token) { instance_double(
|
5
|
-
let(:parsed_response) {
|
6
|
-
let(:response) { instance_double(
|
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
|
17
|
-
it
|
18
|
-
expect(subject.options.client_options.site).to eq(
|
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
|
22
|
-
expect(subject.options.client_options.authorize_url).to eq(
|
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
|
26
|
-
expect(subject.options.client_options.token_url).to eq(
|
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
|
31
|
-
it
|
32
|
-
expect(access_token).to receive(:get).with(
|
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
|
38
|
-
it
|
39
|
-
allow(subject).to receive(:full_host).and_return(
|
40
|
-
allow(subject).to receive(:script_name).and_return(
|
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(
|
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(
|
2
|
-
$:.unshift File.expand_path(
|
3
|
-
require
|
1
|
+
$:.unshift File.expand_path("..", __FILE__)
|
2
|
+
$:.unshift File.expand_path("../../lib", __FILE__)
|
3
|
+
require "simplecov"
|
4
4
|
SimpleCov.start
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
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
|
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.
|
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
|