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 +5 -5
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/publish.yml +28 -0
- data/.github/workflows/tests.yml +34 -0
- 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 -16
- data/lib/omniauth-scalingo/version.rb +1 -1
- data/lib/omniauth-scalingo.rb +1 -1
- data/omniauth-scalingo.gemspec +24 -19
- data/spec/omniauth/strategies/scalingo_spec.rb +19 -19
- data/spec/spec_helper.rb +9 -10
- metadata +18 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
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
|
|
@@ -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
|
|
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,33 +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
|
-
access_token.
|
|
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 +
|
|
48
|
+
full_host + callback_path
|
|
50
49
|
end
|
|
51
50
|
end
|
|
52
51
|
end
|
|
53
52
|
end
|
|
54
53
|
|
|
55
|
-
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,25 +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
|
-
gem.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
22
|
+
gem.version = OmniAuth::Scalingo::VERSION
|
|
18
23
|
|
|
19
|
-
gem.add_dependency
|
|
20
|
-
gem.add_dependency
|
|
21
|
-
gem.add_development_dependency
|
|
22
|
-
gem.add_development_dependency
|
|
23
|
-
gem.add_development_dependency
|
|
24
|
-
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"
|
|
25
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,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
|
|
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:
|
|
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: '
|
|
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: '
|
|
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
|
-
|
|
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: []
|