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 +4 -4
- data/README.md +5 -4
- data/lib/omniauth/dropbox2/version.rb +1 -1
- data/lib/omniauth/dropbox2.rb +2 -2
- data/lib/omniauth/strategies/dropbox.rb +24 -24
- data/lib/omniauth-dropbox2/version.rb +1 -1
- data/lib/omniauth-dropbox2.rb +1 -1
- data/omniauth-dropbox2.gemspec +21 -21
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5fb1b08740769552b63bd3d833064a354db805581bf5effaf3f5ce8579e9268b
|
|
4
|
+
data.tar.gz: ad4874277525c28c483e65e969247f24ed32cebf410c35e8b2480163562ab863
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 809bfc9c7c20e773c520612ffca683046aea772800bab4d8744b3b96092335efd9a3a3a05d204fdc78f57f4dea76d58046519cc8d8ef7532c125b3a04ef2da4e
|
|
7
|
+
data.tar.gz: 7387e25bc039130646452a87933b28b1191465d44812baf412f16f53d529d79472e0eb007536e92a6dbadbeb7c2aaab9557f734b88456c288c0d880ce8ac1409
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# OmniAuth
|
|
1
|
+
# OmniAuth Dropbox Strategy
|
|
2
2
|
|
|
3
3
|
[](https://github.com/icoretech/omniauth-dropbox2/actions/workflows/test.yml?query=branch%3Amain)
|
|
4
|
-
[](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
|
-
- `
|
|
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`, `<
|
|
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
|
data/lib/omniauth/dropbox2.rb
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
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,
|
|
9
|
+
option :name, "dropbox"
|
|
10
10
|
|
|
11
11
|
option :client_options,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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[
|
|
23
|
+
uid { raw_info["account_id"] }
|
|
24
24
|
|
|
25
25
|
info do
|
|
26
26
|
{
|
|
27
|
-
name: raw_info.dig(
|
|
27
|
+
name: raw_info.dig("name", "display_name")
|
|
28
28
|
}.compact
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
credentials do
|
|
32
32
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
43
|
+
"raw_info" => raw_info
|
|
44
44
|
}
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def raw_info
|
|
48
|
-
@raw_info ||= access_token.post(
|
|
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
|
|
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
|
|
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[
|
|
67
|
+
token_params["scope"] || (access_token["scope"] if access_token.respond_to?(:[]))
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
data/lib/omniauth-dropbox2.rb
CHANGED
data/omniauth-dropbox2.gemspec
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
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
|
-
require
|
|
5
|
+
require "omniauth/dropbox2/version"
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name =
|
|
8
|
+
spec.name = "omniauth-dropbox2"
|
|
9
9
|
spec.version = OmniAuth::Dropbox2::VERSION
|
|
10
|
-
spec.authors = [
|
|
11
|
-
spec.email = [
|
|
10
|
+
spec.authors = ["Claudio Poli"]
|
|
11
|
+
spec.email = ["masterkain@gmail.com"]
|
|
12
12
|
|
|
13
|
-
spec.summary =
|
|
14
|
-
spec.description =
|
|
15
|
-
spec.homepage =
|
|
16
|
-
spec.license =
|
|
17
|
-
spec.required_ruby_version =
|
|
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[
|
|
20
|
-
spec.metadata[
|
|
21
|
-
spec.metadata[
|
|
22
|
-
spec.metadata[
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
"lib/**/*.rb",
|
|
26
|
+
"README*",
|
|
27
|
+
"LICENSE*",
|
|
28
|
+
"*.gemspec"
|
|
29
29
|
]
|
|
30
|
-
spec.require_paths = [
|
|
30
|
+
spec.require_paths = ["lib"]
|
|
31
31
|
|
|
32
|
-
spec.add_dependency
|
|
33
|
-
spec.add_dependency
|
|
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
|
+
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: '
|
|
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: '
|
|
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:
|