omniauth-ebay-oauth 0.3.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +82 -0
- data/.github/workflows/test.yml +57 -0
- data/CHANGELOG.md +41 -0
- data/Gemfile +2 -0
- data/README.md +41 -5
- data/lib/omniauth/ebay-oauth/user_info_request.rb +1 -0
- data/lib/omniauth/ebay-oauth/version.rb +1 -1
- data/lib/omniauth/strategies/ebay_oauth.rb +4 -4
- data/omniauth-ebay-oauth.gemspec +4 -4
- data/spec/omniauth/strategies/ebay_oauth_spec.rb +21 -10
- metadata +17 -12
- data/.ruby-version +0 -1
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f00d0daffc4a2c20bcfc95aae0f3d4ed4850f8d512f0539321785d92477d02e
|
4
|
+
data.tar.gz: 91b24a5437389617ba8dc70b8d9429080945464dafa0df32a163b14cc64eeb36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7ea7e859bdaa6acd10eab5739880fef484e89414cdeed9aed8001af3a713e01055f4294f0970d3f0c3f95b373679974e25758c840dfea3e5cfb46f927c85aeb
|
7
|
+
data.tar.gz: 9b419002a3618d8ebea03be43f1734d2b3b94256807f1a5057d337061edfe2d3139e2ef2b6c976dd9772760e8faf9a97ea8e1d50d78b8874b573bf1a0dd086bf
|
@@ -0,0 +1,82 @@
|
|
1
|
+
name: Build and release gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- v*
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
release:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
with:
|
14
|
+
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: 2.7
|
18
|
+
- name: "Extract data from tag: version, message, body"
|
19
|
+
id: tag
|
20
|
+
run: |
|
21
|
+
git fetch --tags --force # Really fetch annotated tag. See https://github.com/actions/checkout/issues/290#issuecomment-680260080
|
22
|
+
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
|
23
|
+
echo ::set-output name=subject::$(git for-each-ref $GITHUB_REF --format='%(contents:subject)')
|
24
|
+
BODY="$(git for-each-ref $GITHUB_REF --format='%(contents:body)')"
|
25
|
+
# Extract changelog entries between this and previous version headers
|
26
|
+
escaped_version=$(echo ${GITHUB_REF#refs/tags/v} | sed -e 's/[]\/$*.^[]/\\&/g')
|
27
|
+
changelog=$(awk "BEGIN{inrelease=0} /## \[${escaped_version}\]/{inrelease=1;next} /## \[[0-9]+\.[0-9]+\.[0-9]+.*?\]/{inrelease=0;exit} {if (inrelease) print}" CHANGELOG.md)
|
28
|
+
# Multiline body for release. See https://github.community/t/set-output-truncates-multiline-strings/16852/5
|
29
|
+
BODY="${BODY}"$'\n'"${changelog}"
|
30
|
+
BODY="${BODY//'%'/'%25'}"
|
31
|
+
BODY="${BODY//$'\n'/'%0A'}"
|
32
|
+
BODY="${BODY//$'\r'/'%0D'}"
|
33
|
+
echo "::set-output name=body::$BODY"
|
34
|
+
# Add pre-release option if tag name has any suffix after vMAJOR.MINOR.PATCH
|
35
|
+
if [[ ${GITHUB_REF#refs/tags/} =~ ^v[0-9]+\.[0-9]+\.[0-9]+.+ ]]; then
|
36
|
+
echo ::set-output name=prerelease::true
|
37
|
+
fi
|
38
|
+
- name: Build gem
|
39
|
+
run: gem build
|
40
|
+
- name: Calculate checksums
|
41
|
+
run: sha256sum omniauth-ebay-oauth-${{ steps.tag.outputs.version }}.gem > SHA256SUM
|
42
|
+
- name: Check version
|
43
|
+
run: ls -l omniauth-ebay-oauth-${{ steps.tag.outputs.version }}.gem
|
44
|
+
- name: Create Release
|
45
|
+
id: create_release
|
46
|
+
uses: actions/create-release@v1
|
47
|
+
env:
|
48
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
49
|
+
with:
|
50
|
+
tag_name: ${{ github.ref }}
|
51
|
+
release_name: ${{ steps.tag.outputs.subject }}
|
52
|
+
body: ${{ steps.tag.outputs.body }}
|
53
|
+
draft: false
|
54
|
+
prerelease: ${{ steps.tag.outputs.prerelease }}
|
55
|
+
- name: Upload built gem as release asset
|
56
|
+
uses: actions/upload-release-asset@v1
|
57
|
+
env:
|
58
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
59
|
+
with:
|
60
|
+
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
61
|
+
asset_path: omniauth-ebay-oauth-${{ steps.tag.outputs.version }}.gem
|
62
|
+
asset_name: omniauth-ebay-oauth-${{ steps.tag.outputs.version }}.gem
|
63
|
+
asset_content_type: application/x-tar
|
64
|
+
- name: Upload checksums as release asset
|
65
|
+
uses: actions/upload-release-asset@v1
|
66
|
+
env:
|
67
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
68
|
+
with:
|
69
|
+
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
70
|
+
asset_path: SHA256SUM
|
71
|
+
asset_name: SHA256SUM
|
72
|
+
asset_content_type: text/plain
|
73
|
+
- name: Publish to GitHub packages
|
74
|
+
env:
|
75
|
+
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
|
76
|
+
run: |
|
77
|
+
gem push omniauth-ebay-oauth-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
|
78
|
+
- name: Publish to RubyGems
|
79
|
+
env:
|
80
|
+
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
|
81
|
+
run: |
|
82
|
+
gem push omniauth-ebay-oauth-${{ steps.tag.outputs.version }}.gem
|
@@ -0,0 +1,57 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- '**'
|
8
|
+
tags-ignore:
|
9
|
+
- 'v*'
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
name: "Ruby ${{ matrix.ruby }}, omniauth ${{ matrix.omniauth }}"
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
matrix:
|
18
|
+
include:
|
19
|
+
- ruby: "3.0"
|
20
|
+
omniauth: "~> 2.0"
|
21
|
+
- ruby: "2.7"
|
22
|
+
omniauth: "~> 2.0"
|
23
|
+
- ruby: "2.7"
|
24
|
+
omniauth: "~> 1.4"
|
25
|
+
- ruby: "2.6"
|
26
|
+
omniauth: "~> 1.4"
|
27
|
+
- ruby: "2.5"
|
28
|
+
omniauth: "~> 1.4"
|
29
|
+
- ruby: "2.4"
|
30
|
+
omniauth: "~> 1.4"
|
31
|
+
- ruby: "2.3"
|
32
|
+
omniauth: "~> 1.4"
|
33
|
+
container:
|
34
|
+
image: ruby:${{ matrix.ruby }}
|
35
|
+
env:
|
36
|
+
CI: true
|
37
|
+
OMNIAUTH_VERSION: "${{ matrix.omniauth }}"
|
38
|
+
steps:
|
39
|
+
- uses: actions/checkout@v2
|
40
|
+
- uses: actions/cache@v2
|
41
|
+
with:
|
42
|
+
path: vendor/bundle
|
43
|
+
key: bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
44
|
+
restore-keys: |
|
45
|
+
bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
|
46
|
+
bundle-${{ matrix.ruby }}-
|
47
|
+
- name: Upgrade Bundler to 2.0 (for older Rubies)
|
48
|
+
run: gem install bundler -v '~> 2.0'
|
49
|
+
- name: Bundle install
|
50
|
+
run: |
|
51
|
+
bundle config path vendor/bundle
|
52
|
+
bundle install
|
53
|
+
bundle update
|
54
|
+
- name: Run Rubocop
|
55
|
+
run: bundle exec rubocop
|
56
|
+
- name: Run RSpec
|
57
|
+
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,42 @@ 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
|
+
## [1.0.1] - 2021-09-01
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- Ruby 3.0 compatibility (keyword arguments usage)
|
12
|
+
|
13
|
+
## [1.0.0] - 2021-04-01
|
14
|
+
|
15
|
+
Mark gem as stable
|
16
|
+
|
17
|
+
### Changed
|
18
|
+
|
19
|
+
- Relax dependency to [OmniAuth](https://rubygems.org/gems/omniauth) gem to allow using 2.x versions.
|
20
|
+
|
21
|
+
See [OmniAuth 2.0.0 release notes](https://github.com/omniauth/omniauth/releases/tag/v2.0.0) if you want to upgrade to it in your app.
|
22
|
+
|
23
|
+
## [0.5.0] - 2019-04-04
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
- Added `prompt` option to allow login under different credentials. @Envek
|
28
|
+
|
29
|
+
See [Getting user consent](https://developer.ebay.com/api-docs/static/oauth-consent-request.html) documentation page for details.
|
30
|
+
|
31
|
+
## [0.4.0] - 2018-08-10
|
32
|
+
|
33
|
+
### Changed
|
34
|
+
|
35
|
+
- Changed default authentication endpoint. @Envek
|
36
|
+
|
37
|
+
Before: https://signin.ebay.com/authorize – always displays user consent screen “Allow APP_NAME to act on your behalf?”.
|
38
|
+
|
39
|
+
After: https://auth.ebay.com/oauth2/authorize – doesn't repeatedly ask for user consent.
|
40
|
+
|
41
|
+
I can't find new endpoint address in docs, but it is used in the wild.
|
42
|
+
|
7
43
|
## [0.3.0] - 2018-03-23
|
8
44
|
|
9
45
|
### Added
|
@@ -34,6 +70,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
34
70
|
- Initial release: fully working strategy. @ignat-z
|
35
71
|
|
36
72
|
|
73
|
+
[1.0.1]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v1.0.0...v1.0.1
|
74
|
+
[1.0.0]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v0.5.0...v1.0.0
|
75
|
+
[0.5.0]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v0.4.0...v0.5.0
|
76
|
+
[0.4.0]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v0.3.0...v0.4.0
|
77
|
+
[0.3.0]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v0.2.0...v0.3.0
|
37
78
|
[0.2.0]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v0.1.1...v0.2.0
|
38
79
|
[0.1.1]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v0.1.0...v0.1.1
|
39
80
|
[0.1.0]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/5213dada5fec8df5da551daf763b6acc84ec7330...v0.1.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/omniauth-ebay-oauth.svg)](https://badge.fury.io/rb/omniauth-ebay-oauth)
|
2
|
-
[![
|
2
|
+
[![Tests Status](https://github.com/evilmartians/omniauth-ebay-oauth/actions/workflows/test.yml/badge.svg)](https://github.com/evilmartians/omniauth-ebay-oauth/actions)
|
3
3
|
[![Cult of Martians](http://cultofmartians.com/assets/badges/badge.svg)](http://cultofmartians.com/tasks/ebay-oauth-signin.html)
|
4
4
|
|
5
5
|
# omniauth-ebay-oauth
|
@@ -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
|
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
|
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
|
-
|
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
|
|
@@ -89,6 +90,10 @@ end
|
|
89
90
|
get '/auth/ebay/callback' do
|
90
91
|
"Hello, #{request.env['omniauth.auth'].dig('info', 'name')}"
|
91
92
|
end
|
93
|
+
|
94
|
+
# OmniAuth disables starting authentication with GET request to mitigate CVE-2015-9284.
|
95
|
+
# For testing purposes we can enable it, but for production it is better to use POST with CSRF protection/
|
96
|
+
OmniAuth.config.allowed_request_methods += %i[get]
|
92
97
|
```
|
93
98
|
|
94
99
|
|
@@ -102,6 +107,37 @@ bundle exec rake
|
|
102
107
|
|
103
108
|
Please, keep in mind [OmniAuth Strategy Contribution Guide](<https://github.com/omniauth/omniauth/wiki/Strategy-Contribution-Guide>) and [eBay developers program](<https://developer.ebay.com/api-docs/static/oauth-tokens.html>).
|
104
109
|
|
110
|
+
### Releasing new versions
|
111
|
+
|
112
|
+
1. Bump version number in `lib/omniauth/ebay-oauth/version.rb`
|
113
|
+
|
114
|
+
In case of pre-releases keep in mind [rubygems/rubygems#3086](https://github.com/rubygems/rubygems/issues/3086) and check version with command like `Gem::Version.new(OmniAuth::EbayOauth::VERSION).to_s`
|
115
|
+
|
116
|
+
2. Fill `CHANGELOG.md` with missing changes, add header with version and date.
|
117
|
+
|
118
|
+
3. Make a commit:
|
119
|
+
|
120
|
+
```sh
|
121
|
+
git add lib/omniauth/ebay-oauth/version.rb CHANGELOG.md
|
122
|
+
version=$(ruby -r ./lib/omniauth/ebay-oauth/version.rb -e "puts Gem::Version.new(OmniAuth::EbayOauth::VERSION)")
|
123
|
+
git commit --message="${version}: " --edit
|
124
|
+
```
|
125
|
+
|
126
|
+
4. Create annotated tag:
|
127
|
+
|
128
|
+
```sh
|
129
|
+
git tag v${version} --annotate --message="${version}: " --edit --sign
|
130
|
+
```
|
131
|
+
|
132
|
+
5. Fill version name into subject line and (optionally) some description (list of changes will be taken from `CHANGELOG.md` and appended automatically)
|
133
|
+
|
134
|
+
6. Push it:
|
135
|
+
|
136
|
+
```sh
|
137
|
+
git push --follow-tags
|
138
|
+
```
|
139
|
+
|
140
|
+
7. GitHub Actions will create a new release, build and push gem into [rubygems.org](https://rubygems.org)! You're done!
|
105
141
|
|
106
142
|
## Contributing
|
107
143
|
|
@@ -9,17 +9,17 @@ module OmniAuth
|
|
9
9
|
option :production_client_options,
|
10
10
|
user_info_endpoint: 'https://api.ebay.com/ws/api.dll',
|
11
11
|
token_url: 'https://api.ebay.com/identity/v1/oauth2/token',
|
12
|
-
authorize_url: 'https://
|
12
|
+
authorize_url: 'https://auth.ebay.com/oauth2/authorize'
|
13
13
|
option :sandbox_client_options,
|
14
14
|
user_info_endpoint: 'https://api.sandbox.ebay.com/ws/api.dll',
|
15
15
|
token_url: 'https://api.sandbox.ebay.com/identity/v1/oauth2/token',
|
16
|
-
authorize_url: 'https://
|
16
|
+
authorize_url: 'https://auth.sandbox.ebay.com/oauth2/authorize'
|
17
17
|
|
18
18
|
option :name, :ebay
|
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 }
|
@@ -67,7 +67,7 @@ module OmniAuth
|
|
67
67
|
def user_info
|
68
68
|
@user_info ||=
|
69
69
|
OmniAuth::EbayOauth::UserInfo.new(OmniAuth::EbayOauth::UserInfoRequest
|
70
|
-
.new(access_token.token, client.options).call)
|
70
|
+
.new(access_token.token, **client.options).call)
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
data/omniauth-ebay-oauth.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path('
|
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
|
|
@@ -18,13 +18,13 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'omniauth', '
|
21
|
+
spec.add_dependency 'omniauth', '>= 1.5', '< 3'
|
22
22
|
spec.add_dependency 'omniauth-oauth2', '~> 1.4'
|
23
23
|
|
24
|
-
spec.add_development_dependency 'bundler', '~>
|
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
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
27
|
+
spec.add_development_dependency 'rubocop', '~> 0.81.0'
|
28
28
|
spec.add_development_dependency 'simplecov', '~> 0.10'
|
29
29
|
spec.add_development_dependency 'webmock', '~> 2.1'
|
30
30
|
end
|
@@ -5,6 +5,8 @@ require 'spec_helper'
|
|
5
5
|
RSpec.describe OmniAuth::Strategies::EbayOauth do
|
6
6
|
let(:options) { {} }
|
7
7
|
|
8
|
+
before { subject.setup_phase }
|
9
|
+
|
8
10
|
subject { described_class.new(nil, options) }
|
9
11
|
|
10
12
|
describe '#callback_url' do
|
@@ -16,8 +18,6 @@ RSpec.describe OmniAuth::Strategies::EbayOauth do
|
|
16
18
|
end
|
17
19
|
|
18
20
|
describe '#options' do
|
19
|
-
before { subject.setup_phase }
|
20
|
-
|
21
21
|
it 'default mode is sandbox' do
|
22
22
|
expect(subject.options.client_options.user_info_endpoint)
|
23
23
|
.to eq('https://api.sandbox.ebay.com/ws/api.dll')
|
@@ -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
|
|
@@ -71,7 +85,7 @@ RSpec.describe OmniAuth::Strategies::EbayOauth do
|
|
71
85
|
|
72
86
|
it 'has correct eBay sandbox authorize url' do
|
73
87
|
expect(subject.options.client_options.authorize_url)
|
74
|
-
.to eq('https://
|
88
|
+
.to eq('https://auth.sandbox.ebay.com/oauth2/authorize')
|
75
89
|
end
|
76
90
|
end
|
77
91
|
|
@@ -90,7 +104,7 @@ RSpec.describe OmniAuth::Strategies::EbayOauth do
|
|
90
104
|
|
91
105
|
it 'has correct eBay production authorize url' do
|
92
106
|
expect(subject.options.client_options.authorize_url)
|
93
|
-
.to eq('https://
|
107
|
+
.to eq('https://auth.ebay.com/oauth2/authorize')
|
94
108
|
end
|
95
109
|
end
|
96
110
|
end
|
@@ -98,15 +112,12 @@ RSpec.describe OmniAuth::Strategies::EbayOauth do
|
|
98
112
|
describe '#user_info' do
|
99
113
|
let(:access_token) { instance_double(OAuth2::AccessToken, token: :token) }
|
100
114
|
let(:user_info) { instance_double(OmniAuth::EbayOauth::UserInfo) }
|
101
|
-
let(:request) do
|
102
|
-
instance_double(OmniAuth::EbayOauth::UserInfoRequest, call: {})
|
103
|
-
end
|
104
115
|
|
105
116
|
before do
|
106
117
|
expect(subject).to receive(:access_token).and_return(access_token)
|
107
|
-
|
108
|
-
.to receive(:
|
109
|
-
|
118
|
+
allow_any_instance_of(OmniAuth::EbayOauth::UserInfoRequest)
|
119
|
+
.to receive(:call).and_return({})
|
120
|
+
allow(OmniAuth::EbayOauth::UserInfo)
|
110
121
|
.to receive(:new).with({}).and_return(user_info)
|
111
122
|
end
|
112
123
|
|
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
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ignat Zakrevsky
|
@@ -9,22 +9,28 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.5'
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '3'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: '1.5'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3'
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: omniauth-oauth2
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,14 +51,14 @@ dependencies:
|
|
45
51
|
requirements:
|
46
52
|
- - "~>"
|
47
53
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
54
|
+
version: '2.0'
|
49
55
|
type: :development
|
50
56
|
prerelease: false
|
51
57
|
version_requirements: !ruby/object:Gem::Requirement
|
52
58
|
requirements:
|
53
59
|
- - "~>"
|
54
60
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
61
|
+
version: '2.0'
|
56
62
|
- !ruby/object:Gem::Dependency
|
57
63
|
name: rake
|
58
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,14 +93,14 @@ dependencies:
|
|
87
93
|
requirements:
|
88
94
|
- - "~>"
|
89
95
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
96
|
+
version: 0.81.0
|
91
97
|
type: :development
|
92
98
|
prerelease: false
|
93
99
|
version_requirements: !ruby/object:Gem::Requirement
|
94
100
|
requirements:
|
95
101
|
- - "~>"
|
96
102
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
103
|
+
version: 0.81.0
|
98
104
|
- !ruby/object:Gem::Dependency
|
99
105
|
name: simplecov
|
100
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -131,11 +137,11 @@ executables: []
|
|
131
137
|
extensions: []
|
132
138
|
extra_rdoc_files: []
|
133
139
|
files:
|
140
|
+
- ".github/workflows/release.yml"
|
141
|
+
- ".github/workflows/test.yml"
|
134
142
|
- ".gitignore"
|
135
143
|
- ".rspec"
|
136
144
|
- ".rubocop.yml"
|
137
|
-
- ".ruby-version"
|
138
|
-
- ".travis.yml"
|
139
145
|
- CHANGELOG.md
|
140
146
|
- Gemfile
|
141
147
|
- LICENSE
|
@@ -176,8 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
182
|
- !ruby/object:Gem::Version
|
177
183
|
version: '0'
|
178
184
|
requirements: []
|
179
|
-
|
180
|
-
rubygems_version: 2.7.6
|
185
|
+
rubygems_version: 3.1.6
|
181
186
|
signing_key:
|
182
187
|
specification_version: 4
|
183
188
|
summary: OmniAuth strategy for new eBay OAuth API
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.4.3
|