Skip to content

Commit 27eb71f

Browse files
authored
Merge pull request #17 from bigcommerce/PEN-540
PEN-540: Upgrade omniauth-bigcommerce dependencies
2 parents 3068ae1 + 56f4188 commit 27eb71f

8 files changed

Lines changed: 138 additions & 15 deletions

File tree

Gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
# persons to whom the Software is furnished to do so, subject to the following conditions:
7+
#
8+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
# Software.
10+
#
11+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
#
116
source 'https://rubygems.org'
217

318
gemspec

Guardfile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
guard 'rspec', :version => 2 do
1+
# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
# persons to whom the Software is furnished to do so, subject to the following conditions:
7+
#
8+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
# Software.
10+
#
11+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
#
16+
guard 'rspec', version: 2 do
217
watch(%r{^spec/.+_spec\.rb$})
318
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
419
watch('spec/spec_helper.rb') { "spec" }

LICENSE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Rakefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
#!/usr/bin/env rake
2-
require "bundler/gem_tasks"
2+
# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
3+
#
4+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
7+
# persons to whom the Software is furnished to do so, subject to the following conditions:
8+
#
9+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10+
# Software.
11+
#
12+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13+
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16+
#
17+
require 'bundler/gem_tasks'
318
require 'rspec/core/rake_task'
419

520
RSpec::Core::RakeTask.new
621

722
desc 'Run specs'
8-
task :default => :spec
23+
task default: :spec

lib/omniauth-bigcommerce.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1+
# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
# persons to whom the Software is furnished to do so, subject to the following conditions:
7+
#
8+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
# Software.
10+
#
11+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
#
116
require 'omniauth/bigcommerce/version'
217
require 'omniauth/strategies/bigcommerce'
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
# persons to whom the Software is furnished to do so, subject to the following conditions:
7+
#
8+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
# Software.
10+
#
11+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
#
116
module OmniAuth
217
module BigCommerce
3-
VERSION = '0.3.0'
18+
VERSION = '0.3.1'.freeze
419
end
520
end

lib/omniauth/strategies/bigcommerce.rb

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
1+
# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
# persons to whom the Software is furnished to do so, subject to the following conditions:
7+
#
8+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
# Software.
10+
#
11+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
#
116
require 'omniauth-oauth2'
217

318
module OmniAuth
419
module Strategies
20+
##
21+
# BigCommerce OAuth strategy for OmniAuth
22+
#
523
class BigCommerce < OmniAuth::Strategies::OAuth2
624
option :name, 'bigcommerce'
725
option :provider_ignores_state, true
826
option :scope, 'users_basic_information'
927
option :authorize_options, [:scope, :context]
1028
option :token_options, [:scope, :context]
11-
option :client_options, {
12-
site: ENV['BC_AUTH_SERVICE'] || 'https://login.bigcommerce.com',
13-
authorize_url: '/oauth2/authorize',
14-
token_url: '/oauth2/token'
15-
}
29+
option :client_options,
30+
site: ENV.fetch('BC_AUTH_SERVICE', 'https://login.bigcommerce.com'),
31+
authorize_url: '/oauth2/authorize',
32+
token_url: '/oauth2/token'
33+
1634

1735
uid { access_token.params['user']['id'] }
1836

1937
info do
2038
{
2139
name: access_token.params['user']['username'],
22-
email: access_token.params['user']['email'],
40+
email: access_token.params['user']['email']
2341
}
2442
end
2543

omniauth-bigcommerce.gemspec

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
1-
# -*- encoding: utf-8 -*-
1+
# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
# persons to whom the Software is furnished to do so, subject to the following conditions:
7+
#
8+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
# Software.
10+
#
11+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
#
216
require File.expand_path('../lib/omniauth/bigcommerce/version', __FILE__)
317

418
Gem::Specification.new do |gem|
5-
gem.authors = ['Tom Allen, Phil Muir, Sasha Gerrand']
19+
gem.authors = ['BigCommerce Engineering']
620
gem.email = ['developer@bigcommerce.com']
7-
gem.description = %q{Official OmniAuth strategy for BigCommerce.}
8-
gem.summary = %q{Official OmniAuth strategy for BigCommerce.}
21+
gem.description = 'Official OmniAuth strategy for BigCommerce.'
22+
gem.summary = gem.description
923
gem.homepage = 'https://github.com/bigcommerce/omniauth-bigcommerce'
1024

1125
gem.files = Dir['README.md', 'lib/**/*', 'omniauth-bigcommerce.gemspec', 'Gemfile']
1226
gem.name = 'omniauth-bigcommerce'
1327
gem.require_paths = ['lib']
1428
gem.required_ruby_version = '>= 2.1'
1529
gem.version = OmniAuth::BigCommerce::VERSION
30+
gem.license = 'MIT'
1631

32+
gem.add_dependency 'oauth2', '~> 1.3.1'
1733
gem.add_dependency 'omniauth'
18-
gem.add_dependency 'omniauth-oauth2', '>= 1.1.1'
34+
gem.add_dependency 'omniauth-oauth2', '>= 1.5'
1935
gem.add_development_dependency 'rake'
2036
gem.add_development_dependency 'rspec'
2137
gem.add_development_dependency 'simplecov'

0 commit comments

Comments
 (0)