omniauth-bike-index 1.0.3 → 1.0.4
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/.travis.yml +2 -2
- data/Gemfile +4 -3
- data/Rakefile +3 -3
- data/lib/omniauth-bike-index.rb +2 -2
- data/lib/omniauth/bike_index/version.rb +1 -1
- data/lib/omniauth/strategies/bike_index.rb +6 -2
- data/omniauth-bike-index.gemspec +18 -19
- data/spec/app.rb +19 -19
- data/spec/omniauth/strategies/bike_index_spec.rb +13 -14
- data/spec/spec_helper.rb +6 -6
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ed476813826660c5afabb02e43fc77d9a423ed63dd9eeeb0864c2fd256876a46
|
4
|
+
data.tar.gz: 161e4b546c49eaa0e54728593d3d597e1ec0372374615d9a9fed19e5d4256083
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b19d2b3b2d040381ddba62e61ce7db388f54396958353f8c48f07597864fcf35c446aaf3948f83a48769910add600f91186f67c9a28322a62e576e0fd43a8742
|
7
|
+
data.tar.gz: 990b71281d87975209be63f652e261fb24d2ec304c3b0217e1dc98ef1f7604a1f0f48bfd2ce177bc6f14b98fa90fc45a89106ebe6917080f642aa29029377f00
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/omniauth-bike-index.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "omniauth/bike_index/version"
|
2
|
+
require "omniauth/strategies/bike_index"
|
@@ -17,7 +17,7 @@ module OmniAuth
|
|
17
17
|
"secondary_emails" => raw_info["user"]["secondary_emails"],
|
18
18
|
"name" => raw_info["user"]["name"],
|
19
19
|
"twitter" => raw_info["user"]["twitter"],
|
20
|
-
"image" => raw_info["user"]["image"]
|
20
|
+
"image" => raw_info["user"]["image"]
|
21
21
|
)
|
22
22
|
end
|
23
23
|
|
@@ -32,7 +32,11 @@ module OmniAuth
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def request_phase
|
35
|
-
options[:authorize_params] = {
|
35
|
+
options[:authorize_params] = {
|
36
|
+
scope: (options["scope"] || DEFAULT_SCOPE),
|
37
|
+
partner: options["partner"],
|
38
|
+
unauthenticated_redirect: options["unauthenticated_redirect"]
|
39
|
+
}
|
36
40
|
super
|
37
41
|
end
|
38
42
|
|
data/omniauth-bike-index.gemspec
CHANGED
@@ -1,25 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'omniauth/bike_index/version'
|
1
|
+
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
2
|
+
require "omniauth/bike_index/version"
|
4
3
|
|
5
4
|
Gem::Specification.new do |s|
|
6
|
-
s.name
|
7
|
-
s.version
|
8
|
-
s.authors
|
9
|
-
s.email
|
10
|
-
s.summary
|
11
|
-
s.description
|
12
|
-
s.homepage
|
13
|
-
s.license
|
5
|
+
s.name = "omniauth-bike-index"
|
6
|
+
s.version = OmniAuth::BikeIndex::VERSION
|
7
|
+
s.authors = ["Seth Herr"]
|
8
|
+
s.email = ["seth@bikeidnex.org"]
|
9
|
+
s.summary = "Bike Index strategy for OmniAuth"
|
10
|
+
s.description = "Bike Index strategy for OmniAuth v1.2"
|
11
|
+
s.homepage = "https://github.com/bikeindex/omniauth-bike-index"
|
12
|
+
s.license = "MIT"
|
14
13
|
|
15
|
-
s.files
|
16
|
-
s.test_files
|
17
|
-
s.executables
|
18
|
-
s.require_paths = [
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
19
18
|
|
20
|
-
s.add_runtime_dependency
|
21
|
-
s.add_runtime_dependency
|
19
|
+
s.add_runtime_dependency "omniauth", "~> 1.2"
|
20
|
+
s.add_runtime_dependency "omniauth-oauth2", "~> 1.1"
|
22
21
|
|
23
|
-
s.add_development_dependency
|
24
|
-
s.add_development_dependency
|
22
|
+
s.add_development_dependency "dotenv", "~> 0"
|
23
|
+
s.add_development_dependency "sinatra", "~> 0"
|
25
24
|
end
|
data/spec/app.rb
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path(
|
2
|
-
$LOAD_PATH.unshift File.expand_path(
|
1
|
+
$LOAD_PATH.unshift File.expand_path("..", __FILE__)
|
2
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
4
|
+
require "dotenv"
|
5
|
+
require "sinatra"
|
6
|
+
require "omniauth"
|
7
|
+
require "omniauth-bike-index"
|
8
8
|
|
9
9
|
Dotenv.load
|
10
10
|
|
11
|
-
use Rack::Session::Cookie, :
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
11
|
+
use Rack::Session::Cookie, key: "key",
|
12
|
+
domain: "localhost",
|
13
|
+
path: "/",
|
14
|
+
expire_after: 14_400,
|
15
|
+
secret: "secret"
|
16
16
|
|
17
17
|
use OmniAuth::Builder do
|
18
|
-
provider :bike_index, ENV[
|
18
|
+
provider :bike_index, ENV["CLIENT_ID"], ENV["CLIENT_SECRET"], scope: "access_profile"
|
19
19
|
end
|
20
20
|
|
21
|
-
get
|
21
|
+
get "/" do
|
22
22
|
<<-HTML
|
23
23
|
<a href='/auth/bikeindex'>Sign in with Bike Index</a>
|
24
24
|
HTML
|
25
25
|
end
|
26
26
|
|
27
|
-
get
|
28
|
-
env[
|
27
|
+
get "/auth/failure" do
|
28
|
+
env["omniauth.error"].to_s
|
29
29
|
end
|
30
30
|
|
31
|
-
get
|
32
|
-
auth = request.env[
|
31
|
+
get "/auth/:name/callback" do
|
32
|
+
auth = request.env["omniauth.auth"]
|
33
33
|
|
34
|
-
puts %
|
34
|
+
puts %(
|
35
35
|
>> UID
|
36
36
|
#{auth.uid.inspect}
|
37
37
|
|
@@ -45,5 +45,5 @@ get '/auth/:name/callback' do
|
|
45
45
|
#{auth.extra.inspect}
|
46
46
|
)
|
47
47
|
|
48
|
-
|
48
|
+
"Check logs for user information."
|
49
49
|
end
|
@@ -1,33 +1,32 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe OmniAuth::Strategies::BikeIndex do
|
4
4
|
subject do
|
5
5
|
@subject ||= begin
|
6
|
-
args = [
|
6
|
+
args = ["client_id", "client_secret", @options || {}].compact
|
7
7
|
OmniAuth::Strategies::BikeIndex.new(*args)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
context
|
12
|
-
it
|
11
|
+
context "client options" do
|
12
|
+
it "has correct name" do
|
13
13
|
expect(subject.options.name).to eq(:bike_index)
|
14
14
|
end
|
15
15
|
|
16
|
-
it
|
17
|
-
expect(subject.options.client_options.site).to eq(
|
16
|
+
it "has correct site" do
|
17
|
+
expect(subject.options.client_options.site).to eq("https://bikeindex.org")
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
21
|
-
expect(subject.options.client_options.authorize_url).to eq(
|
20
|
+
it "has correct authorize url" do
|
21
|
+
expect(subject.options.client_options.authorize_url).to eq("/oauth/authorize")
|
22
22
|
end
|
23
|
-
|
24
23
|
end
|
25
24
|
|
26
|
-
context
|
27
|
-
it "gets log in" do
|
28
|
-
app = lambda{|env| [200, {}, ["Hello World."]]}
|
29
|
-
OmniAuth::Strategies::Developer.new(app).options.uid_field
|
30
|
-
OmniAuth::Strategies::Developer.new(app, :
|
25
|
+
context "figuring stuff out" do
|
26
|
+
it "gets log in" do
|
27
|
+
app = lambda { |env| [200, {}, ["Hello World."]] }
|
28
|
+
OmniAuth::Strategies::Developer.new(app).options.uid_field # => :email
|
29
|
+
OmniAuth::Strategies::Developer.new(app, uid_field: :name).options.uid_field # => :name
|
31
30
|
end
|
32
31
|
end
|
33
32
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path(
|
2
|
-
$LOAD_PATH.unshift File.expand_path(
|
1
|
+
$LOAD_PATH.unshift File.expand_path("..", __FILE__)
|
2
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
4
|
+
require "rspec"
|
5
|
+
require "omniauth"
|
6
|
+
require "omniauth-bike-index"
|
7
7
|
|
8
8
|
RSpec.configure do |config|
|
9
|
-
config.extend OmniAuth::Test::StrategyMacros, :
|
9
|
+
config.extend OmniAuth::Test::StrategyMacros, type: :strategy
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-bike-index
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Herr
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -89,7 +89,7 @@ homepage: https://github.com/bikeindex/omniauth-bike-index
|
|
89
89
|
licenses:
|
90
90
|
- MIT
|
91
91
|
metadata: {}
|
92
|
-
post_install_message:
|
92
|
+
post_install_message:
|
93
93
|
rdoc_options: []
|
94
94
|
require_paths:
|
95
95
|
- lib
|
@@ -104,9 +104,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
|
-
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
109
|
-
signing_key:
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 2.7.6.2
|
109
|
+
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Bike Index strategy for OmniAuth
|
112
112
|
test_files:
|