omniauth-homeaway 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/.travis.yml +11 -4
- data/Appraisals +7 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +46 -38
- data/README.md +6 -5
- data/example/Gemfile +3 -1
- data/example/Gemfile.lock +22 -25
- data/example/homeaway_oauth_helper.rb +1 -4
- data/lib/omniauth/homeaway/version.rb +1 -1
- data/lib/omniauth/strategies/homeaway.rb +6 -0
- data/omniauth-homeaway.gemspec +7 -7
- data/spec/omniauth/strategies/homeaway_spec.rb +61 -28
- data/spec/support/shared_examples.rb +12 -12
- metadata +38 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fcb719968b13202223187906763122afd620b9d
|
4
|
+
data.tar.gz: f11a59fd7824606dc41586601481e35accd6e131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1125e4c081959fa67e216aa7b1590f637b4c249a2acb846801345eee3a2f913afccd04dcc5d03fa2f4f88ae8b2a4e2d45f46ef380415a460d37fc77ef5d51a14
|
7
|
+
data.tar.gz: 8aef6053b64ff7756766f5e62f6543dd979588c452504e63009aa3060d50c711761f22e63b96035cb7a0c80e57c9a5ad0c0c58177c505f421dba01785d93b4aa
|
data/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--
|
1
|
+
--color
|
data/.travis.yml
CHANGED
@@ -1,8 +1,15 @@
|
|
1
|
-
sudo:
|
2
|
-
|
1
|
+
sudo: required
|
2
|
+
dist: trusty
|
3
|
+
before_install:
|
4
|
+
- gem install bundler
|
5
|
+
- bundle install --jobs=3 --retry=3
|
6
|
+
- bundle binstub rake
|
3
7
|
rvm:
|
4
|
-
- 2.0
|
5
|
-
- 2.1
|
6
8
|
- 2.2
|
9
|
+
- 2.3
|
10
|
+
- 2.4
|
7
11
|
- ruby-head
|
8
12
|
- jruby
|
13
|
+
gemfile:
|
14
|
+
- gemfiles/omniauth-oauth2-1.3.gemfile
|
15
|
+
- gemfiles/omniauth-oauth2-1.4.gemfile
|
data/Appraisals
ADDED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,70 +1,78 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
omniauth-homeaway (0.
|
5
|
-
|
6
|
-
omniauth
|
4
|
+
omniauth-homeaway (0.2.0)
|
5
|
+
oauth2 (~> 1.3.0)
|
6
|
+
omniauth (~> 1.6)
|
7
|
+
omniauth-oauth2 (<= 1.4)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
appraisal (2.2.0)
|
13
|
+
bundler
|
14
|
+
rake
|
15
|
+
thor (>= 0.14.0)
|
16
|
+
ast (2.3.0)
|
17
|
+
diff-lcs (1.3)
|
18
|
+
faraday (0.11.0)
|
14
19
|
multipart-post (>= 1.2, < 3)
|
15
|
-
hashie (3.
|
16
|
-
jwt (1.5.
|
17
|
-
multi_json (1.
|
18
|
-
multi_xml (0.
|
20
|
+
hashie (3.5.5)
|
21
|
+
jwt (1.5.6)
|
22
|
+
multi_json (1.12.1)
|
23
|
+
multi_xml (0.6.0)
|
19
24
|
multipart-post (2.0.0)
|
20
|
-
oauth2 (1.1
|
21
|
-
faraday (>= 0.8, < 0.
|
22
|
-
jwt (~> 1.0
|
25
|
+
oauth2 (1.3.1)
|
26
|
+
faraday (>= 0.8, < 0.12)
|
27
|
+
jwt (~> 1.0)
|
23
28
|
multi_json (~> 1.3)
|
24
29
|
multi_xml (~> 0.5)
|
25
30
|
rack (>= 1.2, < 3)
|
26
|
-
omniauth (1.
|
27
|
-
hashie (>=
|
28
|
-
rack (>= 1.
|
29
|
-
omniauth-oauth2 (1.
|
31
|
+
omniauth (1.6.1)
|
32
|
+
hashie (>= 3.4.6, < 3.6.0)
|
33
|
+
rack (>= 1.6.2, < 3)
|
34
|
+
omniauth-oauth2 (1.4.0)
|
30
35
|
oauth2 (~> 1.0)
|
31
36
|
omniauth (~> 1.2)
|
32
|
-
parser (2.
|
37
|
+
parser (2.4.0.0)
|
33
38
|
ast (~> 2.2)
|
34
39
|
powerpack (0.1.1)
|
35
|
-
rack (
|
36
|
-
rainbow (2.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
rspec-
|
41
|
-
rspec-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
rack (2.0.1)
|
41
|
+
rainbow (2.2.2)
|
42
|
+
rake
|
43
|
+
rake (12.0.0)
|
44
|
+
rspec (3.5.0)
|
45
|
+
rspec-core (~> 3.5.0)
|
46
|
+
rspec-expectations (~> 3.5.0)
|
47
|
+
rspec-mocks (~> 3.5.0)
|
48
|
+
rspec-core (3.5.4)
|
49
|
+
rspec-support (~> 3.5.0)
|
50
|
+
rspec-expectations (3.5.0)
|
45
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
-
rspec-support (~> 3.
|
47
|
-
rspec-mocks (3.
|
52
|
+
rspec-support (~> 3.5.0)
|
53
|
+
rspec-mocks (3.5.0)
|
48
54
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
-
rspec-support (~> 3.
|
50
|
-
rspec-support (3.
|
51
|
-
rubocop (0.
|
52
|
-
parser (>= 2.3.
|
55
|
+
rspec-support (~> 3.5.0)
|
56
|
+
rspec-support (3.5.0)
|
57
|
+
rubocop (0.48.1)
|
58
|
+
parser (>= 2.3.3.1, < 3.0)
|
53
59
|
powerpack (~> 0.1)
|
54
60
|
rainbow (>= 1.99.1, < 3.0)
|
55
61
|
ruby-progressbar (~> 1.7)
|
56
|
-
unicode-display_width (~> 0.
|
57
|
-
ruby-progressbar (1.
|
58
|
-
|
62
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
63
|
+
ruby-progressbar (1.8.1)
|
64
|
+
thor (0.19.4)
|
65
|
+
unicode-display_width (1.2.1)
|
59
66
|
|
60
67
|
PLATFORMS
|
61
68
|
ruby
|
62
69
|
|
63
70
|
DEPENDENCIES
|
71
|
+
appraisal
|
64
72
|
omniauth-homeaway!
|
65
73
|
rake
|
66
74
|
rspec
|
67
75
|
rubocop
|
68
76
|
|
69
77
|
BUNDLED WITH
|
70
|
-
1.
|
78
|
+
1.14.6
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
[![Build
|
1
|
+
[![CI Build
|
2
|
+
Status](https://secure.travis-ci.org/BookingSync/omniauth-homeaway.png)](http://travis-ci.org/BookingSync/omniauth-homeaway)
|
2
3
|
|
3
4
|
# OmniAuth HomeAway
|
4
5
|
|
5
|
-
This is an OmniAuth
|
6
|
+
This is an OmniAuth strategy for authenticating to HomeAway. To
|
6
7
|
use it, you'll need to sign up for an OAuth2 Application ID and Secret
|
7
8
|
on the [HomeAway Application's Registration Page](https://www.homeaway.com/platform/).
|
8
9
|
|
@@ -18,7 +19,7 @@ Then `bundle install`.
|
|
18
19
|
|
19
20
|
## Usage
|
20
21
|
|
21
|
-
`OmniAuth::Strategies::HomeAway` is simply a Rack middleware. Read the OmniAuth
|
22
|
+
`OmniAuth::Strategies::HomeAway` is simply a Rack middleware. Read the OmniAuth docs for detailed instructions: https://github.com/intridea/omniauth.
|
22
23
|
|
23
24
|
Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
|
24
25
|
|
@@ -30,7 +31,7 @@ end
|
|
30
31
|
|
31
32
|
## Supported Rubies
|
32
33
|
|
33
|
-
OmniAuth BookingSync is tested under 2.
|
34
|
+
OmniAuth BookingSync is tested under 2.2, 2.3, 2.4, Ruby-head, JRuby.
|
34
35
|
|
35
36
|
[![CI Build
|
36
37
|
Status](https://secure.travis-ci.org/BookingSync/omniauth-homeaway.png)](http://travis-ci.org/BookingSync/omniauth-homeaway)
|
@@ -41,7 +42,7 @@ Status](https://secure.travis-ci.org/BookingSync/omniauth-homeaway.png)](http://
|
|
41
42
|
|
42
43
|
## License
|
43
44
|
|
44
|
-
Copyright (c) 2016 [BookingSync.com](
|
45
|
+
Copyright (c) 2016-2017 [BookingSync.com](https://www.bookingsync.com)
|
45
46
|
|
46
47
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
47
48
|
|
data/example/Gemfile
CHANGED
data/example/Gemfile.lock
CHANGED
@@ -1,48 +1,45 @@
|
|
1
|
-
PATH
|
2
|
-
remote: /Users/seb/Work/Websites/BookingSync/gems/omniauth-homeaway
|
3
|
-
specs:
|
4
|
-
omniauth-homeaway (0.1.0)
|
5
|
-
omniauth (~> 1.1)
|
6
|
-
omniauth-oauth2 (< 1.4)
|
7
|
-
|
8
1
|
GEM
|
2
|
+
remote: https://rubygems.org/
|
9
3
|
specs:
|
10
|
-
faraday (0.
|
4
|
+
faraday (0.11.0)
|
11
5
|
multipart-post (>= 1.2, < 3)
|
12
|
-
hashie (3.
|
13
|
-
json (1.
|
14
|
-
jwt (1.5.
|
15
|
-
multi_json (1.
|
16
|
-
multi_xml (0.
|
6
|
+
hashie (3.5.5)
|
7
|
+
json (2.1.0)
|
8
|
+
jwt (1.5.6)
|
9
|
+
multi_json (1.12.1)
|
10
|
+
multi_xml (0.6.0)
|
17
11
|
multipart-post (2.0.0)
|
18
|
-
oauth2 (1.1
|
19
|
-
faraday (>= 0.8, < 0.
|
20
|
-
jwt (~> 1.0
|
12
|
+
oauth2 (1.3.1)
|
13
|
+
faraday (>= 0.8, < 0.12)
|
14
|
+
jwt (~> 1.0)
|
21
15
|
multi_json (~> 1.3)
|
22
16
|
multi_xml (~> 0.5)
|
23
17
|
rack (>= 1.2, < 3)
|
24
|
-
omniauth (1.
|
25
|
-
hashie (>=
|
26
|
-
rack (>= 1.
|
18
|
+
omniauth (1.6.1)
|
19
|
+
hashie (>= 3.4.6, < 3.6.0)
|
20
|
+
rack (>= 1.6.2, < 3)
|
21
|
+
omniauth-homeaway (0.1.0)
|
22
|
+
omniauth (~> 1.1)
|
23
|
+
omniauth-oauth2 (< 1.4)
|
27
24
|
omniauth-oauth2 (1.3.1)
|
28
25
|
oauth2 (~> 1.0)
|
29
26
|
omniauth (~> 1.2)
|
30
|
-
rack (1.6.
|
27
|
+
rack (1.6.5)
|
31
28
|
rack-protection (1.5.3)
|
32
29
|
rack
|
33
|
-
sinatra (1.4.
|
34
|
-
rack (~> 1.
|
30
|
+
sinatra (1.4.8)
|
31
|
+
rack (~> 1.5)
|
35
32
|
rack-protection (~> 1.4)
|
36
33
|
tilt (>= 1.3, < 3)
|
37
|
-
tilt (2.0.
|
34
|
+
tilt (2.0.7)
|
38
35
|
|
39
36
|
PLATFORMS
|
40
37
|
ruby
|
41
38
|
|
42
39
|
DEPENDENCIES
|
43
40
|
json
|
44
|
-
omniauth-homeaway
|
41
|
+
omniauth-homeaway
|
45
42
|
sinatra
|
46
43
|
|
47
44
|
BUNDLED WITH
|
48
|
-
1.
|
45
|
+
1.14.6
|
@@ -4,11 +4,8 @@ require "omniauth-homeaway"
|
|
4
4
|
|
5
5
|
use Rack::Session::Cookie
|
6
6
|
|
7
|
-
# The *state* is ignored as HomeAway OAuth2 provider is currently not supporting it.
|
8
7
|
use OmniAuth::Builder do
|
9
|
-
provider :homeaway, ENV['HOMEAWAY_CLIENT_ID'], ENV['HOMEAWAY_CLIENT_SECRET']
|
10
|
-
provider_ignores_state: true
|
11
|
-
}
|
8
|
+
provider :homeaway, ENV['HOMEAWAY_CLIENT_ID'], ENV['HOMEAWAY_CLIENT_SECRET']
|
12
9
|
end
|
13
10
|
|
14
11
|
get "/" do
|
@@ -28,6 +28,12 @@ module OmniAuth
|
|
28
28
|
|
29
29
|
client.auth_code.get_token(verifier, { headers: { 'Authorization' => auth } })
|
30
30
|
end
|
31
|
+
|
32
|
+
# Fixes regression in omniauth-oauth2 v1.4.0 by
|
33
|
+
# https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7
|
34
|
+
def callback_url
|
35
|
+
options[:redirect_uri] || (full_host + script_name + callback_path)
|
36
|
+
end
|
31
37
|
end
|
32
38
|
end
|
33
39
|
end
|
data/omniauth-homeaway.gemspec
CHANGED
@@ -7,20 +7,20 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.authors = ["Sebastien Grosjean"]
|
8
8
|
gem.email = ["dev@bookingsync.com"]
|
9
9
|
gem.homepage = "https://github.com/bookingsync/omniauth-homeaway"
|
10
|
-
gem.summary = "An OmniAuth
|
11
|
-
gem.description = "An OmniAuth
|
10
|
+
gem.summary = "An OmniAuth strategy for HomeAway OAuth2 identification."
|
11
|
+
gem.description = "An OmniAuth strategy for HomeAway OAuth2 identification."
|
12
12
|
|
13
|
-
gem.executables = `git ls-files --
|
13
|
+
gem.executables = `git ls-files -- exe/*`.split("\n").map { |f| File.basename(f) }
|
14
14
|
gem.files = `git ls-files`.split("\n")
|
15
15
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
|
-
gem.add_dependency "omniauth", "~> 1.
|
19
|
-
|
20
|
-
|
21
|
-
gem.add_dependency "omniauth-oauth2", "< 1.4"
|
18
|
+
gem.add_dependency "omniauth", "~> 1.6"
|
19
|
+
gem.add_dependency "omniauth-oauth2", "<= 1.4"
|
20
|
+
gem.add_dependency "oauth2", "~> 1.3.0"
|
22
21
|
|
23
22
|
gem.add_development_dependency "rspec"
|
24
23
|
gem.add_development_dependency "rake"
|
25
24
|
gem.add_development_dependency "rubocop"
|
25
|
+
gem.add_development_dependency "appraisal"
|
26
26
|
end
|
@@ -9,7 +9,7 @@ describe OmniAuth::Strategies::HomeAway do
|
|
9
9
|
let(:request) { double("Request", params: {}, cookies: {}, env: {}) }
|
10
10
|
let(:options) { {} }
|
11
11
|
|
12
|
-
|
12
|
+
let(:strategy) do
|
13
13
|
OmniAuth::Strategies::HomeAway.new(nil, options).tap do |strategy|
|
14
14
|
allow(strategy).to receive(:request) { request }
|
15
15
|
end
|
@@ -17,67 +17,100 @@ describe OmniAuth::Strategies::HomeAway do
|
|
17
17
|
|
18
18
|
it_should_behave_like "an oauth2 strategy"
|
19
19
|
|
20
|
-
describe
|
20
|
+
describe "#client" do
|
21
21
|
it "has the correct site" do
|
22
|
-
expect(
|
22
|
+
expect(strategy.client.site).to eq("https://ws.homeaway.com/")
|
23
23
|
end
|
24
24
|
|
25
25
|
it "has the correct authorization url" do
|
26
|
-
expect(
|
26
|
+
expect(strategy.client.options[:authorize_url]).to eq("/oauth/authorize")
|
27
27
|
end
|
28
28
|
|
29
29
|
it "has the correct token url" do
|
30
|
-
expect(
|
30
|
+
expect(strategy.client.options[:token_url]).to eq("/oauth/token")
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
describe
|
34
|
+
describe "#callback_path" do
|
35
35
|
it "has the correct callback path" do
|
36
|
-
expect(
|
36
|
+
expect(strategy.callback_path).to eq("/auth/homeaway/callback")
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
describe
|
40
|
+
describe "#raw_info" do
|
41
41
|
it "fetches account info from public/me" do
|
42
|
-
allow(
|
42
|
+
allow(strategy).to receive(:access_token).and_return(double)
|
43
43
|
response = double(parsed: {
|
44
44
|
"firstName" => "Sebastien",
|
45
45
|
"lastName" => "Grosjean",
|
46
46
|
"emailAddress" => "dev@bookingsync.com"
|
47
47
|
})
|
48
|
-
expect(
|
49
|
-
expect(
|
50
|
-
expect(
|
51
|
-
expect(
|
48
|
+
expect(strategy.access_token).to receive(:get).with("/public/me").and_return(response)
|
49
|
+
expect(strategy.raw_info["firstName"]).to eq "Sebastien"
|
50
|
+
expect(strategy.raw_info["lastName"]).to eq "Grosjean"
|
51
|
+
expect(strategy.raw_info["emailAddress"]).to eq "dev@bookingsync.com"
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
describe
|
55
|
+
describe "#info" do
|
56
56
|
it "fetches account info from public/me" do
|
57
|
-
allow(
|
57
|
+
allow(strategy).to receive(:access_token).and_return(double)
|
58
58
|
response = double(parsed: {
|
59
59
|
"firstName" => "Sebastien",
|
60
60
|
"lastName" => "Grosjean",
|
61
61
|
"emailAddress" => "dev@bookingsync.com"
|
62
62
|
})
|
63
|
-
expect(
|
64
|
-
expect(
|
65
|
-
expect(
|
66
|
-
expect(
|
63
|
+
expect(strategy.access_token).to receive(:get).with("/public/me").and_return(response)
|
64
|
+
expect(strategy.info[:first_name]).to eq "Sebastien"
|
65
|
+
expect(strategy.info[:last_name]).to eq "Grosjean"
|
66
|
+
expect(strategy.info[:email_address]).to eq "dev@bookingsync.com"
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
70
|
describe "#build_access_token" do
|
71
71
|
it "authenticate the token request with Basic Auth" do
|
72
|
-
expect(
|
73
|
-
expect(
|
74
|
-
expect(
|
75
|
-
|
76
|
-
allow(
|
77
|
-
allow(
|
78
|
-
expect(
|
79
|
-
{ headers: {
|
80
|
-
|
72
|
+
expect(strategy).to receive(:request).and_return(double(params: { "code" => "CODE" }))
|
73
|
+
expect(strategy.options).to receive(:client_id).and_return("CLIENT_ID")
|
74
|
+
expect(strategy.options).to receive(:client_secret).and_return("CLIENT_SECRET")
|
75
|
+
|
76
|
+
allow(strategy).to receive(:client).and_return(double)
|
77
|
+
allow(strategy.client).to receive(:auth_code).and_return(double)
|
78
|
+
expect(strategy.client.auth_code).to receive(:get_token).with("CODE",
|
79
|
+
{ headers: { "Authorization" => "Basic Q0xJRU5UX0lEOkNMSUVOVF9TRUNSRVQ=" } })
|
80
|
+
strategy.build_access_token
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "#callback_url" do
|
85
|
+
let(:url_base) { "https://auth.example.com" }
|
86
|
+
|
87
|
+
before do
|
88
|
+
allow(request).to receive(:scheme).and_return("https")
|
89
|
+
allow(request).to receive(:url).and_return("#{url_base}/some/page?foo=bar")
|
90
|
+
|
91
|
+
allow(strategy).to receive(:script_name).and_return("") # as not to depend on Rack env
|
92
|
+
allow(strategy).to receive(:query_string).and_return("?foo=bar")
|
93
|
+
end
|
94
|
+
|
95
|
+
it "returns default callback url (omitting querystring)" do
|
96
|
+
expect(strategy.callback_url).to eq "#{url_base}/auth/homeaway/callback"
|
97
|
+
end
|
98
|
+
|
99
|
+
context "with custom callback path" do
|
100
|
+
let(:options) { { callback_path: "/auth/homeaway/done" } }
|
101
|
+
|
102
|
+
it "returns default callback url (omitting querystring)" do
|
103
|
+
expect(strategy.callback_url).to eq "#{url_base}/auth/homeaway/done"
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
context "with custom callback url" do
|
108
|
+
let(:url) { "https://auth.myapp.com/auth/homeaway/callback" }
|
109
|
+
let(:options) { { redirect_uri: url } }
|
110
|
+
|
111
|
+
it "returns url from redirect_uri option" do
|
112
|
+
expect(strategy.callback_url).to eq url
|
113
|
+
end
|
81
114
|
end
|
82
115
|
end
|
83
116
|
end
|
@@ -1,23 +1,23 @@
|
|
1
1
|
shared_examples "an oauth2 strategy" do
|
2
|
-
describe
|
2
|
+
describe "#client" do
|
3
3
|
let(:options) do
|
4
4
|
{ client_options: { "authorize_url" => "https://example.com" } }
|
5
5
|
end
|
6
6
|
|
7
7
|
it "is initialized with symbolized client_options" do
|
8
|
-
expect(
|
8
|
+
expect(strategy.client.options[:authorize_url]).to eq "https://example.com"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
describe
|
12
|
+
describe "#authorize_params" do
|
13
13
|
context "when passed as authorize_params" do
|
14
14
|
let(:options) do
|
15
15
|
{ authorize_params: { foo: "bar", baz: "zip" } }
|
16
16
|
end
|
17
17
|
|
18
18
|
it "includes any authorize params passed in the :authorize_params option" do
|
19
|
-
expect(
|
20
|
-
expect(
|
19
|
+
expect(strategy.authorize_params["foo"]).to eq("bar")
|
20
|
+
expect(strategy.authorize_params["baz"]).to eq("zip")
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -27,21 +27,21 @@ shared_examples "an oauth2 strategy" do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "includes top-level options that are marked as :authorize_options" do
|
30
|
-
expect(
|
31
|
-
expect(
|
30
|
+
expect(strategy.authorize_params["scope"]).to eq("bar")
|
31
|
+
expect(strategy.authorize_params["foo"]).to eq("baz")
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
describe
|
36
|
+
describe "#token_params" do
|
37
37
|
context "when passed as token_params" do
|
38
38
|
let(:options) do
|
39
39
|
{ token_params: { foo: "bar", baz: "zip" } }
|
40
40
|
end
|
41
41
|
|
42
42
|
it "includes any token params passed in the :token_params option" do
|
43
|
-
expect(
|
44
|
-
expect(
|
43
|
+
expect(strategy.token_params["foo"]).to eq("bar")
|
44
|
+
expect(strategy.token_params["baz"]).to eq("zip")
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -51,8 +51,8 @@ shared_examples "an oauth2 strategy" do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "includes top-level options that are marked as :token_options" do
|
54
|
-
expect(
|
55
|
-
expect(
|
54
|
+
expect(strategy.token_params["scope"]).to eq("bar")
|
55
|
+
expect(strategy.token_params["foo"]).to eq("baz")
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-homeaway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastien Grosjean
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -16,28 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: omniauth-oauth2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "<="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "<="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: oauth2
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.3.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.3.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rspec
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,7 +94,21 @@ dependencies:
|
|
80
94
|
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
|
-
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: appraisal
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: An OmniAuth strategy for HomeAway OAuth2 identification.
|
84
112
|
email:
|
85
113
|
- dev@bookingsync.com
|
86
114
|
executables: []
|
@@ -92,6 +120,7 @@ files:
|
|
92
120
|
- ".rubocop.yml"
|
93
121
|
- ".rubocop_todo.yml"
|
94
122
|
- ".travis.yml"
|
123
|
+
- Appraisals
|
95
124
|
- CHANGELOG.md
|
96
125
|
- Gemfile
|
97
126
|
- Gemfile.lock
|
@@ -129,10 +158,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
158
|
version: '0'
|
130
159
|
requirements: []
|
131
160
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.
|
161
|
+
rubygems_version: 2.5.1
|
133
162
|
signing_key:
|
134
163
|
specification_version: 4
|
135
|
-
summary: An OmniAuth
|
164
|
+
summary: An OmniAuth strategy for HomeAway OAuth2 identification.
|
136
165
|
test_files:
|
137
166
|
- spec/omniauth/strategies/homeaway_spec.rb
|
138
167
|
- spec/spec_helper.rb
|