omniauth-dropbox2 2.0.4 → 2.0.6

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: 3c9b7e808498b8a2c402dfc33e7e3b6bed9c75de13480df640b144ff2c53a7d0
4
- data.tar.gz: 7d7121180df1b2ef59abb5f77eb996ee3dec923b8e4ea414a0275a03335f89a6
3
+ metadata.gz: 5fb1b08740769552b63bd3d833064a354db805581bf5effaf3f5ce8579e9268b
4
+ data.tar.gz: ad4874277525c28c483e65e969247f24ed32cebf410c35e8b2480163562ab863
5
5
  SHA512:
6
- metadata.gz: 8f634d46da852ab09a786a7fe9432b7e245b6ed9e91841550848728f0e3b90dd0bb8313e0315ca5dc18d74b22fd9dd49bce0dfbeaad6a7514ec5da93d347cdbd
7
- data.tar.gz: 52ba48fac291da44ed3ce4e948368bcb296e7c03f517dddf72f134218489430fc5d25bd16ffeed4d7a967c509f9b20a30ad2ab1f610a699b0a0ccc8c1da83411
6
+ metadata.gz: 809bfc9c7c20e773c520612ffca683046aea772800bab4d8744b3b96092335efd9a3a3a05d204fdc78f57f4dea76d58046519cc8d8ef7532c125b3a04ef2da4e
7
+ data.tar.gz: 7387e25bc039130646452a87933b28b1191465d44812baf412f16f53d529d79472e0eb007536e92a6dbadbeb7c2aaab9557f734b88456c288c0d880ce8ac1409
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # OmniAuth Dropbox2 Strategy
1
+ # OmniAuth Dropbox Strategy
2
2
 
3
3
  [![Test](https://github.com/icoretech/omniauth-dropbox2/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/icoretech/omniauth-dropbox2/actions/workflows/test.yml?query=branch%3Amain)
4
- [![Gem Version](https://img.shields.io/gem/v/omniauth-dropbox2.svg)](https://rubygems.org/gems/omniauth-dropbox2)
4
+ [![Gem Version](https://badge.fury.io/rb/omniauth-dropbox2.svg)](https://badge.fury.io/rb/omniauth-dropbox2)
5
5
 
6
6
  `omniauth-dropbox2` provides a Dropbox OAuth2 strategy for OmniAuth.
7
7
 
@@ -85,6 +85,7 @@ Example payload from `request.env['omniauth.auth']` (real flow shape, anonymized
85
85
  ```
86
86
 
87
87
  Notes:
88
+
88
89
  - `uid` is mapped from `raw_info.account_id`
89
90
  - `info.name` is mapped from `raw_info.name.display_name`
90
91
  - `credentials` includes `token`, plus `refresh_token` when provided by Dropbox
@@ -99,7 +100,7 @@ bundle exec rake
99
100
 
100
101
  The default Rake task runs:
101
102
 
102
- - `rake lint` (RuboCop)
103
+ - `standardrb`
103
104
  - `rake test_unit` (strategy/unit Minitest suite)
104
105
 
105
106
  Run Rails integration tests with an explicit Rails version:
@@ -118,7 +119,7 @@ RAILS_VERSION='~> 8.1.0' bundle exec rake test_rails_integration
118
119
  ## Compatibility
119
120
 
120
121
  - Ruby: `>= 3.2` (tested on `3.2`, `3.3`, `3.4`, `4.0`)
121
- - `omniauth-oauth2`: `>= 1.8`, `< 1.9`
122
+ - `omniauth-oauth2`: `>= 1.8`, `< 2.0`
122
123
  - Rails integration lanes: `~> 7.1.0`, `~> 7.2.0`, `~> 8.0.0`, `~> 8.1.0`
123
124
 
124
125
  ## Release
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Dropbox2
5
- VERSION = '2.0.4'
5
+ VERSION = "2.0.6"
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth/dropbox2/version'
4
- require 'omniauth/strategies/dropbox'
3
+ require "omniauth/dropbox2/version"
4
+ require "omniauth/strategies/dropbox"
@@ -1,61 +1,61 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth-oauth2'
3
+ require "omniauth-oauth2"
4
4
 
5
5
  module OmniAuth
6
6
  module Strategies
7
7
  # OmniAuth strategy for Dropbox OAuth2.
8
8
  class Dropbox < OmniAuth::Strategies::OAuth2
9
- option :name, 'dropbox'
9
+ option :name, "dropbox"
10
10
 
11
11
  option :client_options,
12
- site: 'https://api.dropboxapi.com/2',
13
- authorize_url: 'https://www.dropbox.com/oauth2/authorize',
14
- token_url: 'https://api.dropboxapi.com/oauth2/token',
15
- connection_opts: {
16
- headers: {
17
- user_agent: 'icoretech-omniauth-dropbox2 gem',
18
- accept: 'application/json',
19
- content_type: 'application/json'
20
- }
21
- }
12
+ site: "https://api.dropboxapi.com/2",
13
+ authorize_url: "https://www.dropbox.com/oauth2/authorize",
14
+ token_url: "https://api.dropboxapi.com/oauth2/token",
15
+ connection_opts: {
16
+ headers: {
17
+ user_agent: "icoretech-omniauth-dropbox2 gem",
18
+ accept: "application/json",
19
+ content_type: "application/json"
20
+ }
21
+ }
22
22
 
23
- uid { raw_info['account_id'] }
23
+ uid { raw_info["account_id"] }
24
24
 
25
25
  info do
26
26
  {
27
- name: raw_info.dig('name', 'display_name')
27
+ name: raw_info.dig("name", "display_name")
28
28
  }.compact
29
29
  end
30
30
 
31
31
  credentials do
32
32
  {
33
- 'token' => access_token.token,
34
- 'refresh_token' => access_token.refresh_token,
35
- 'expires_at' => access_token.expires_at,
36
- 'expires' => access_token.expires?,
37
- 'scope' => token_scope
33
+ "token" => access_token.token,
34
+ "refresh_token" => access_token.refresh_token,
35
+ "expires_at" => access_token.expires_at,
36
+ "expires" => access_token.expires?,
37
+ "scope" => token_scope
38
38
  }.compact
39
39
  end
40
40
 
41
41
  extra do
42
42
  {
43
- 'raw_info' => raw_info
43
+ "raw_info" => raw_info
44
44
  }
45
45
  end
46
46
 
47
47
  def raw_info
48
- @raw_info ||= access_token.post('users/get_current_account', body: 'null').parsed
48
+ @raw_info ||= access_token.post("users/get_current_account", body: "null").parsed
49
49
  end
50
50
 
51
51
  def callback_url
52
- return '' if @authorization_code_from_signed_request
52
+ return "" if @authorization_code_from_signed_request
53
53
 
54
54
  options[:callback_url] || super
55
55
  end
56
56
 
57
57
  def query_string
58
- return '' if request.params['code']
58
+ return "" if request.params["code"]
59
59
 
60
60
  super
61
61
  end
@@ -64,7 +64,7 @@ module OmniAuth
64
64
 
65
65
  def token_scope
66
66
  token_params = access_token.respond_to?(:params) ? access_token.params : {}
67
- token_params['scope'] || (access_token['scope'] if access_token.respond_to?(:[]))
67
+ token_params["scope"] || (access_token["scope"] if access_token.respond_to?(:[]))
68
68
  end
69
69
  end
70
70
 
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth/dropbox2/version'
3
+ require "omniauth/dropbox2/version"
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'omniauth/dropbox2'
3
+ require "omniauth/dropbox2"
@@ -1,34 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'omniauth/dropbox2/version'
5
+ require "omniauth/dropbox2/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'omniauth-dropbox2'
8
+ spec.name = "omniauth-dropbox2"
9
9
  spec.version = OmniAuth::Dropbox2::VERSION
10
- spec.authors = ['Claudio Poli']
11
- spec.email = ['masterkain@gmail.com']
10
+ spec.authors = ["Claudio Poli"]
11
+ spec.email = ["masterkain@gmail.com"]
12
12
 
13
- spec.summary = 'OmniAuth strategy for Dropbox OAuth2 authentication.'
14
- spec.description = 'OAuth2 strategy for OmniAuth that authenticates users with Dropbox and exposes account metadata.'
15
- spec.homepage = 'https://github.com/icoretech/omniauth-dropbox2'
16
- spec.license = 'MIT'
17
- spec.required_ruby_version = '>= 3.2'
13
+ spec.summary = "OmniAuth strategy for Dropbox OAuth2 authentication."
14
+ spec.description = "OAuth2 strategy for OmniAuth that authenticates users with Dropbox and exposes account metadata."
15
+ spec.homepage = "https://github.com/icoretech/omniauth-dropbox2"
16
+ spec.license = "MIT"
17
+ spec.required_ruby_version = ">= 3.2"
18
18
 
19
- spec.metadata['source_code_uri'] = 'https://github.com/icoretech/omniauth-dropbox2'
20
- spec.metadata['bug_tracker_uri'] = 'https://github.com/icoretech/omniauth-dropbox2/issues'
21
- spec.metadata['changelog_uri'] = 'https://github.com/icoretech/omniauth-dropbox2/releases'
22
- spec.metadata['rubygems_mfa_required'] = 'true'
19
+ spec.metadata["source_code_uri"] = "https://github.com/icoretech/omniauth-dropbox2"
20
+ spec.metadata["bug_tracker_uri"] = "https://github.com/icoretech/omniauth-dropbox2/issues"
21
+ spec.metadata["changelog_uri"] = "https://github.com/icoretech/omniauth-dropbox2/releases"
22
+ spec.metadata["rubygems_mfa_required"] = "true"
23
23
 
24
24
  spec.files = Dir[
25
- 'lib/**/*.rb',
26
- 'README*',
27
- 'LICENSE*',
28
- '*.gemspec'
25
+ "lib/**/*.rb",
26
+ "README*",
27
+ "LICENSE*",
28
+ "*.gemspec"
29
29
  ]
30
- spec.require_paths = ['lib']
30
+ spec.require_paths = ["lib"]
31
31
 
32
- spec.add_dependency 'cgi', '>= 0.3.6'
33
- spec.add_dependency 'omniauth-oauth2', '>= 1.8', '< 1.9'
32
+ spec.add_dependency "cgi", ">= 0.3.6"
33
+ spec.add_dependency "omniauth-oauth2", ">= 1.8", "< 2.0"
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-dropbox2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Poli
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '1.8'
33
33
  - - "<"
34
34
  - !ruby/object:Gem::Version
35
- version: '1.9'
35
+ version: '2.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '1.8'
43
43
  - - "<"
44
44
  - !ruby/object:Gem::Version
45
- version: '1.9'
45
+ version: '2.0'
46
46
  description: OAuth2 strategy for OmniAuth that authenticates users with Dropbox and
47
47
  exposes account metadata.
48
48
  email: