From b3d3f0f8eb818fa701b19537ea292cb337aa8e00 Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Fri, 16 Mar 2018 18:20:36 +0300 Subject: [PATCH] Rename strategy to `ebay_oauth` to allow use with old strategies --- .ruby-version | 2 +- .travis.yml | 7 +++-- CHANGELOG.md | 31 +++++++++++++++++++ README.md | 6 ++-- lib/omniauth-ebay-oauth.rb | 2 +- lib/omniauth/ebay-oauth/version.rb | 2 +- .../strategies/{ebay.rb => ebay_oauth.rb} | 2 +- .../{ebay_spec.rb => ebay_oauth_spec.rb} | 2 +- 8 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 CHANGELOG.md rename lib/omniauth/strategies/{ebay.rb => ebay_oauth.rb} (97%) rename spec/omniauth/strategies/{ebay_spec.rb => ebay_oauth_spec.rb} (98%) diff --git a/.ruby-version b/.ruby-version index cc6c9a4..35cee72 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.5 +2.4.3 diff --git a/.travis.yml b/.travis.yml index 1e4d358..0e6fc88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ sudo: false language: ruby rvm: - - 2.3.5 - - 2.4.2 -before_install: gem install bundler -v 1.15.4 + - 2.3.6 + - 2.4.3 + - 2.5.0 +before_install: gem install bundler -v 1.16.1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6599582 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,31 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [0.2.0] - 2018-03-16 + +### Changed + + - Renamed strategy from `ebay` to `ebay_oauth`. @Envek + + This allow to use this strategy simultaneously with old strategies (like [omniauth-ebay](https://github.com/TheGiftsProject/omniauth-ebay) and [ebay_request](https://github.com/gzigzigzeo/ebay_request#omniauth-strategy)) + + As eBay allows to have only one OAuth RUName per application keyset while allowing to have many Auth'n'auth RUNames, it may be desirable to use Auth'n'auth for auxilary signins, where obtaining of OAuth tokens is not required. + +## [0.1.1] - 2018-01-09 + +### Fixed + + - Add missing require to fix gem load errors when this gem is being required from another gem. @Envek + + +## [0.1.0] - 2017-11-27 + + - Initial release: fully working strategy. @ignat-z + + +[0.2.0]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v0.1.1...v0.2.0 +[0.1.1]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/v0.1.0...v0.1.1 +[0.1.0]: https://github.com/evilmartians/omniauth-ebay-oauth/compare/5213dada5fec8df5da551daf763b6acc84ec7330...v0.1.0 diff --git a/README.md b/README.md index f234470..81b9e4e 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ bundle install ```ruby use OmniAuth::Builder do - provider :ebay, CLIENT_ID, CLIENT_SECRET, callback_url: RU_NAME, + provider :ebay_oauth, CLIENT_ID, CLIENT_SECRET, callback_url: RU_NAME, sandbox: false, scope: 'https://api.ebay.com/oauth/api_scope' # redefining additional default options end ``` @@ -78,8 +78,8 @@ require 'omniauth-ebay-oauth' use Rack::Session::Cookie use OmniAuth::Builder do - provider :ebay, ENV['EBAY_CLIENT_ID'], ENV['EBAY_CLIENT_SECRET'], - callback_url: ENV['EBAY_RU_NAME'] + provider :ebay_oauth, ENV['EBAY_CLIENT_ID'], ENV['EBAY_CLIENT_SECRET'], + callback_url: ENV['EBAY_RU_NAME'], name: 'ebay' end get '/' do diff --git a/lib/omniauth-ebay-oauth.rb b/lib/omniauth-ebay-oauth.rb index 9783d24..6335f05 100644 --- a/lib/omniauth-ebay-oauth.rb +++ b/lib/omniauth-ebay-oauth.rb @@ -7,4 +7,4 @@ require 'omniauth/ebay-oauth/errors' require 'omniauth/ebay-oauth/user_info' require 'omniauth/ebay-oauth/user_info_request' -require 'omniauth/strategies/ebay' +require 'omniauth/strategies/ebay_oauth' diff --git a/lib/omniauth/ebay-oauth/version.rb b/lib/omniauth/ebay-oauth/version.rb index d722dd0..fb4665a 100644 --- a/lib/omniauth/ebay-oauth/version.rb +++ b/lib/omniauth/ebay-oauth/version.rb @@ -2,6 +2,6 @@ module OmniAuth module EbayOauth - VERSION = '0.1.1' + VERSION = '0.2.0' end end diff --git a/lib/omniauth/strategies/ebay.rb b/lib/omniauth/strategies/ebay_oauth.rb similarity index 97% rename from lib/omniauth/strategies/ebay.rb rename to lib/omniauth/strategies/ebay_oauth.rb index 61d92ee..e8369c5 100644 --- a/lib/omniauth/strategies/ebay.rb +++ b/lib/omniauth/strategies/ebay_oauth.rb @@ -5,7 +5,7 @@ module OmniAuth module Strategies # OmniAuth strategy for eBay - class Ebay < OmniAuth::Strategies::OAuth2 + class EbayOauth < OmniAuth::Strategies::OAuth2 option :production_client_options, user_info_endpoint: 'https://api.ebay.com/ws/api.dll', token_url: 'https://api.ebay.com/identity/v1/oauth2/token', diff --git a/spec/omniauth/strategies/ebay_spec.rb b/spec/omniauth/strategies/ebay_oauth_spec.rb similarity index 98% rename from spec/omniauth/strategies/ebay_spec.rb rename to spec/omniauth/strategies/ebay_oauth_spec.rb index 9c9e1d1..0cadefb 100644 --- a/spec/omniauth/strategies/ebay_spec.rb +++ b/spec/omniauth/strategies/ebay_oauth_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe OmniAuth::Strategies::Ebay do +RSpec.describe OmniAuth::Strategies::EbayOauth do subject { described_class.new(nil, options) } describe '#callback_url' do