omniauth-ebay-oauth 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63b08f5bc58f7bcbd504a7df25e2e3e3b481ec6c7037687db000a509f842f0b7
4
- data.tar.gz: 488137afb6cb43361a9dc79b1744d28f934456bd6c1df7baef34889f076858ce
3
+ metadata.gz: c9f4f01cdc95d969a4571571eb407395429b687d33e468992c7b3af0728f2be8
4
+ data.tar.gz: 7b1636011c2e893cf2e49f623c1ba1ac2d17b598bf7f27a7574babfc95fc4ac1
5
5
  SHA512:
6
- metadata.gz: 8663fc799309d225632263e635338ea641d11081ed220c025591174e56cb6731b8d15551cb44f937ef846273bb53783f69293070930720f674dbe34cec663d99
7
- data.tar.gz: 7ee548e2de5933b0ea22621e4049da2909da9e00400a06f88096df72dc577be4f508cd2985206f5f6be34c809b7e57aeb4a126021c143be20f1c40b73258cb53
6
+ metadata.gz: 06a7581035f2fae8322d7bafbbb4ad49eb42365226cb6868550d256b797c3f25d14e7401bf2b98b8bcf0b33b8d59764c4642d7a8405b6302ceca2a9b87399bdb
7
+ data.tar.gz: af416600b1db5b2ad02e0f65ddd96ffbb14c2c48e75a0255b696bcfe08c5f2658ec5a2e0771a4620637ffab93c844a03beb8755b6cb9771b862fe8d14f83ce23
@@ -1,7 +1,8 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.3.6
5
- - 2.4.3
6
- - 2.5.0
7
- before_install: gem install bundler -v 1.16.1
4
+ - 2.3.8
5
+ - 2.4.6
6
+ - 2.5.5
7
+ - 2.6.2
8
+ before_install: gem install bundler -v "~> 2.0"
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.5.0] - 2019-04-04
8
+
9
+ ### Added
10
+
11
+ - Added `prompt` option to allow login under different credentials. @Envek
12
+
13
+ See [Getting user consent](https://developer.ebay.com/api-docs/static/oauth-consent-request.html) documentation page for details.
14
+
7
15
  ## [0.4.0] - 2018-08-10
8
16
 
9
17
  ### Changed
data/README.md CHANGED
@@ -20,15 +20,15 @@ This gem implements authorization with OAuth method while currently available ge
20
20
 
21
21
  __What is the difference? Access tokens!__
22
22
 
23
- With Auth'n'auth you will get a single token which you can use to access old eBay XML APIs (Trading API, etc.)
23
+ With Auth'n'auth you will get a single token which you can use to access only old eBay XML APIs (Trading API, etc.)
24
24
 
25
25
  With OAuth, you will get a pair of access and refresh tokens which can be used to access new eBay REST APIs (Buy API, Sell API, etc.)
26
26
 
27
- However, you can use new OAuth tokens to access old APIs by providing an access token in (not yet) documented HTTP header `X-EBAY-API-IAF-TOKEN` (like this gem uses it to obtain information about an authenticated user from Trading API).
27
+ However, you can use new OAuth tokens to access old APIs too by providing an access token in HTTP header `X-EBAY-API-IAF-TOKEN`. This is documented in eBay developer program website: [Using OAuth with the eBay traditional APIs](https://developer.ebay.com/api-docs/static/oauth-trad-apis.html#Implemen).
28
28
 
29
- If you plan to use only old APIs, you can look at [ebay_request](https://github.com/gzigzigzeo/ebay_request) gem.
29
+ If you plan to use new APIs, you are welcome to use this gem together with [ebay_api](https://github.com/nepalez/ebay_api) client gem for REST APIs.
30
30
 
31
- If you plan to use new APIs, you are welcome to use this gem either standalone or together with [ebay_api](https://github.com/nepalez/ebay_api) client get for REST APIs.
31
+ For old APIs, you can look at [ebay_request](https://github.com/gzigzigzeo/ebay_request) gem (you can configure it to use OAuth tokens).
32
32
 
33
33
  Now you can read the eBay docs about [REST APIs](https://developer.ebay.com/api-docs/static/ebay-rest-landing.html) and [OAuth](https://developer.ebay.com/api-docs/static/oauth-quick-ref-user-tokens.html) and then proceed to…
34
34
 
@@ -64,6 +64,7 @@ Required options:
64
64
  Additional options:
65
65
  - __sandbox__ - Are you running your application in [sandbox mode](<https://developer.ebay.com/api-docs/static/sandbox-landing.html>), default __`true`__.
66
66
  - __scope__ - A list of [OAuth scopes](<https://developer.ebay.com/api-docs/static/oauth-details.html#scopes>) that provide access to the interfaces you call, default: __`[]`__. If you want change scopes you could pass it as string or as array of scopes like so: `['https://api.ebay.com/oauth/api_scope/sell.marketing.readonly', 'https://api.ebay.com/oauth/api_scope/sell.account.readonly']`
67
+ - __prompt__ - Use value `login` to ask user for login and password even if they're already logged in (useful for switching between multiple accounts). By default is absent.
67
68
  - __read_timeout__ - Number of seconds to wait for one block to be read for Auth'n'auth eBay API requests, default is 60.
68
69
  - \+ all [OmniAuth](<https://github.com/omniauth/omniauth>) supported options, like: `callback_path`, `provider_ignores_state` and so on.
69
70
 
@@ -44,6 +44,7 @@ module OmniAuth
44
44
 
45
45
  def ensure_success_code(response)
46
46
  return if (200..299).cover?(response.code.to_i)
47
+
47
48
  raise FailureResponseCode, response
48
49
  end
49
50
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module EbayOauth
5
- VERSION = '0.4.0'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
@@ -19,7 +19,7 @@ module OmniAuth
19
19
  option :sandbox, true
20
20
  option :callback_url
21
21
 
22
- option :authorize_options, %i[scope]
22
+ option :authorize_options, %i[scope prompt]
23
23
  option :client_options, auth_scheme: :basic_auth, read_timeout: 60
24
24
 
25
25
  uid { user_info.uid }
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'omniauth/ebay-oauth/version'
6
6
 
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency 'omniauth', '~> 1.5'
22
22
  spec.add_dependency 'omniauth-oauth2', '~> 1.4'
23
23
 
24
- spec.add_development_dependency 'bundler', '~> 1.15'
24
+ spec.add_development_dependency 'bundler', '~> 2.0'
25
25
  spec.add_development_dependency 'rake', '>= 10'
26
26
  spec.add_development_dependency 'rspec', '~> 3.5'
27
27
  spec.add_development_dependency 'rubocop', '~> 0.42'
@@ -56,6 +56,20 @@ RSpec.describe OmniAuth::Strategies::EbayOauth do
56
56
  end
57
57
  end
58
58
 
59
+ context "when prompt isn't provided" do
60
+ it 'is absent' do
61
+ expect(subject.options.prompt).to be_nil
62
+ end
63
+ end
64
+
65
+ context 'when prompt is provided' do
66
+ let(:options) { { prompt: :login } }
67
+
68
+ it 'concatenates passed scopes with space' do
69
+ expect(subject.options.prompt).to eql :login
70
+ end
71
+ end
72
+
59
73
  context 'sandbox mode' do
60
74
  let(:options) { { sandbox: true } }
61
75
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-ebay-oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignat Zakrevsky
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-10 00:00:00.000000000 Z
12
+ date: 2019-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '1.15'
48
+ version: '2.0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '1.15'
55
+ version: '2.0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -134,7 +134,6 @@ files:
134
134
  - ".gitignore"
135
135
  - ".rspec"
136
136
  - ".rubocop.yml"
137
- - ".ruby-version"
138
137
  - ".travis.yml"
139
138
  - CHANGELOG.md
140
139
  - Gemfile
@@ -176,8 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
175
  - !ruby/object:Gem::Version
177
176
  version: '0'
178
177
  requirements: []
179
- rubyforge_project:
180
- rubygems_version: 2.7.6
178
+ rubygems_version: 3.0.3
181
179
  signing_key:
182
180
  specification_version: 4
183
181
  summary: OmniAuth strategy for new eBay OAuth API
@@ -1 +0,0 @@
1
- 2.4.3