omniauth-bigcommerce 0.3.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd5e32f8a45da147b03443c65712f28bf6e009a21122c1353fe584928f5a08d3
4
- data.tar.gz: 2576edbd1b56fe581af75289981f24c86a26d69091102561736e77488e61fde6
3
+ metadata.gz: 1ab65242f6af944039277657ae8ebffec01bdd38bfe9766094bd56a6c142bb71
4
+ data.tar.gz: b71e105172d89c5649ec7934015e687595d9f7ad1eec5010f9569cfa2556e9d5
5
5
  SHA512:
6
- metadata.gz: a863750397104fa836e569bee0ad1a31d91534dbcdfc0ad8ab6f5bf04f84f2fb030e1b6c37a8dd6cddab56ad75a79b16ff0a767d2aa821505f3f186cb7fd6479
7
- data.tar.gz: de692355ae688192e9200430b6f21b4fc1cad2df8c348f47133c84605e12ebfe64f0251f607758ad1d14699272dbcaa6722df62cf38e42b63aaa7f4520399b76
6
+ metadata.gz: aac59b20ee2202e8028b4506b21164aec151be9916038340256aa91ba1d2facb837bb1acc299816afb25d169a253e04ba4d2aff43d917114c47d2acb0b48329c
7
+ data.tar.gz: 9bae0bc193e0d3dd9e67369a893b178a04b385b0d4a6fc7f99ff88e206426327b8697288e4cbcac9e203f1f4464de13c7c3d6191122bb77df64cf44dbd545e82
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -16,3 +18,12 @@
16
18
  source 'https://rubygems.org'
17
19
 
18
20
  gemspec
21
+
22
+ gem 'bundler-audit', '>= 0.9'
23
+ gem 'rake', '~> 13.0'
24
+ gem 'rspec', '~> 3.0'
25
+ gem 'rspec_junit_formatter'
26
+ gem 'rubocop', '~> 1.21'
27
+ gem 'rubocop-performance', '~> 1.19.0'
28
+ gem 'rubocop-thread_safety', '~> 0.5.1'
29
+ gem 'simplecov'
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # OmniAuth Bigcommerce Strategy
2
2
  [![Build Status](https://travis-ci.org/bigcommerce/omniauth-bigcommerce.png?branch=master)](https://travis-ci.org/bigcommerce/omniauth-bigcommerce)
3
3
 
4
- This gem provides a dead simple way to authenticate to Bigcommerce using OmniAuth.
4
+ This gem provides a simple way to authenticate to Bigcommerce using OmniAuth.
5
5
 
6
6
  ## Installation
7
7
 
@@ -42,14 +42,14 @@ It defaults to https://login.bigcommerce.com if the env variable is not defined.
42
42
 
43
43
  ## Auth Hash Schema
44
44
 
45
- The following information is provided back to you for this provider:
45
+ The following response format is provided back to you for this provider:
46
46
 
47
47
  ```
48
48
  {
49
49
  uid: '12345',
50
50
  info: {
51
- name: 'Philip Muir',
52
- email: 'philip.muir@example.com'
51
+ name: 'John Doe',
52
+ email: 'john.doe@example.com'
53
53
  },
54
54
  credentials: {
55
55
  token: 'xyz123abc'
@@ -57,7 +57,8 @@ The following information is provided back to you for this provider:
57
57
  extra: {
58
58
  raw_info: {},
59
59
  scopes: 'requested_scopes store_v2_settings'
60
- context: 'store/xyz123'
60
+ context: 'store/xyz123',
61
+ account_uuid: 'fooBar'
61
62
  }
62
63
  }
63
64
  ```
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -15,6 +17,6 @@
15
17
  #
16
18
  module OmniAuth
17
19
  module BigCommerce
18
- VERSION = '0.3.3'.freeze
20
+ VERSION = '0.5.0'
19
21
  end
20
22
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -24,14 +26,13 @@ module OmniAuth
24
26
  option :name, 'bigcommerce'
25
27
  option :provider_ignores_state, true
26
28
  option :scope, 'users_basic_information'
27
- option :authorize_options, [:scope, :context]
28
- option :token_options, [:scope, :context]
29
+ option :authorize_options, %i[scope context]
30
+ option :token_options, %i[scope context account_uuid]
29
31
  option :client_options,
30
32
  site: ENV.fetch('BC_AUTH_SERVICE', 'https://login.bigcommerce.com'),
31
33
  authorize_url: '/oauth2/authorize',
32
34
  token_url: '/oauth2/token'
33
35
 
34
-
35
36
  uid { access_token.params['user']['id'] }
36
37
 
37
38
  info do
@@ -51,7 +52,8 @@ module OmniAuth
51
52
  {
52
53
  raw_info: raw_info,
53
54
  scopes: raw_info['scope'],
54
- context: raw_info['context']
55
+ context: raw_info['context'],
56
+ account_uuid: raw_info.fetch('account_uuid', '')
55
57
  }
56
58
  end
57
59
 
@@ -70,7 +72,7 @@ module OmniAuth
70
72
  def authorize_params
71
73
  super.tap do |params|
72
74
  options[:authorize_options].each do |k|
73
- params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s])
75
+ params[k] = request.params[k.to_s] unless blank?(request.params[k.to_s])
74
76
  end
75
77
  end
76
78
  end
@@ -79,10 +81,18 @@ module OmniAuth
79
81
  def token_params
80
82
  super.tap do |params|
81
83
  options[:token_options].each do |k|
82
- params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s])
84
+ params[k] = request.params[k.to_s] unless blank?(request.params[k.to_s])
83
85
  end
84
86
  end
85
87
  end
88
+
89
+ ##
90
+ # Checks for nil or empty values
91
+ # @param [String|nil] value
92
+ # @return [Boolean]
93
+ def blank?(value)
94
+ value.nil? || value.empty?
95
+ end
86
96
  end
87
97
  end
88
98
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -31,10 +31,8 @@ Gem::Specification.new do |gem|
31
31
  gem.version = OmniAuth::BigCommerce::VERSION
32
32
  gem.license = 'MIT'
33
33
 
34
- gem.add_dependency 'oauth2', '>= 1.4.4'
34
+ gem.add_dependency 'oauth2', '>= 1.4.4', '< 2'
35
35
  gem.add_dependency 'omniauth'
36
36
  gem.add_dependency 'omniauth-oauth2', '>= 1.5'
37
- gem.add_development_dependency 'rake'
38
- gem.add_development_dependency 'rspec'
39
- gem.add_development_dependency 'simplecov'
37
+ gem.metadata['rubygems_mfa_required'] = 'true'
40
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-bigcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BigCommerce Engineering
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2025-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.4.4
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 1.4.4
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: omniauth
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -52,48 +58,6 @@ dependencies:
52
58
  - - ">="
53
59
  - !ruby/object:Gem::Version
54
60
  version: '1.5'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: simplecov
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
61
  description: Official OmniAuth strategy for BigCommerce.
98
62
  email:
99
63
  - developer@bigcommerce.com
@@ -110,8 +74,9 @@ files:
110
74
  homepage: https://github.com/bigcommerce/omniauth-bigcommerce
111
75
  licenses:
112
76
  - MIT
113
- metadata: {}
114
- post_install_message:
77
+ metadata:
78
+ rubygems_mfa_required: 'true'
79
+ post_install_message:
115
80
  rdoc_options: []
116
81
  require_paths:
117
82
  - lib
@@ -126,8 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
91
  - !ruby/object:Gem::Version
127
92
  version: '0'
128
93
  requirements: []
129
- rubygems_version: 3.0.6
130
- signing_key:
94
+ rubygems_version: 3.4.10
95
+ signing_key:
131
96
  specification_version: 4
132
97
  summary: Official OmniAuth strategy for BigCommerce.
133
98
  test_files: []