globus_client 0.11.0 → 0.12.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: 17883fcf5075a2d48a8c1d6d8dec772c4f6b7bf9df670744ac99280fafb4d70d
4
- data.tar.gz: 4652598239017ee6d049359b60d4931ab4efe6d2c90f222434554b93556c2edd
3
+ metadata.gz: bb50d72f725c17c845856c0f00f8753c1c709ee1adbe9876a2863692692f7274
4
+ data.tar.gz: 7c2b9379dcf066d3f827b10ecc8eb52106054bd1f5203e16015d8e21435fe9cd
5
5
  SHA512:
6
- metadata.gz: 5a3f421d6284bd63a9e19ec0526d06d1c3757752d1367b9bef7fe5a5b651dbf369b9d6e02589b8c8e4d60e3a0d71f3c6974961ff68ffdb3d5b8642e7c21aceb0
7
- data.tar.gz: 67dd2fa038211a82ec0651c24812666b138ce6172beff07adbfa90864ea5874c5297f0ff155c16158634d2f02220d43f85449032710ffa21095f73c9dcabe23b
6
+ metadata.gz: d2e10ae21d5e6d4c1cf2a42e69ee2e8608772812136e8f068e13418b6ddb606de72ef3e8e22c8a774baedbf986f16ccf0e1499cc1bf6f563866636d9a3c3c48e
7
+ data.tar.gz: 8a0b323fa8002d1591f1b4ddb57e400862647d782faeb78da92e548fcdb5ef1acf064b499683db0c9609f50d9afcf06a4d41d99f1d4c36f0e3829ccdfc8f151a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- globus_client (0.11.0)
4
+ globus_client (0.12.0)
5
5
  activesupport (>= 4.2, < 8)
6
6
  faraday
7
7
  faraday-retry
@@ -10,21 +10,23 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.0.6)
13
+ activesupport (7.0.8)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 1.6, < 2)
16
16
  minitest (>= 5.1)
17
17
  tzinfo (~> 2.0)
18
- addressable (2.8.4)
18
+ addressable (2.8.5)
19
19
  public_suffix (>= 2.0.2, < 6.0)
20
20
  ast (2.4.2)
21
+ base64 (0.1.1)
21
22
  byebug (11.1.3)
22
23
  concurrent-ruby (1.2.2)
23
24
  crack (0.4.5)
24
25
  rexml
25
26
  diff-lcs (1.5.0)
26
27
  docile (1.4.0)
27
- faraday (2.7.10)
28
+ faraday (2.7.11)
29
+ base64
28
30
  faraday-net_http (>= 2.0, < 3.1)
29
31
  ruby2_keywords (>= 0.0.4)
30
32
  faraday-net_http (3.0.2)
@@ -36,7 +38,7 @@ GEM
36
38
  json (2.6.3)
37
39
  language_server-protocol (3.17.0.3)
38
40
  lint_roller (1.1.0)
39
- minitest (5.18.1)
41
+ minitest (5.20.0)
40
42
  parallel (1.23.0)
41
43
  parser (3.2.2.3)
42
44
  ast (~> 2.4.1)
@@ -46,7 +48,7 @@ GEM
46
48
  rainbow (3.1.1)
47
49
  rake (13.0.6)
48
50
  regexp_parser (2.8.1)
49
- rexml (3.2.5)
51
+ rexml (3.2.6)
50
52
  rspec (3.12.0)
51
53
  rspec-core (~> 3.12.0)
52
54
  rspec-expectations (~> 3.12.0)
@@ -60,26 +62,28 @@ GEM
60
62
  diff-lcs (>= 1.2.0, < 2.0)
61
63
  rspec-support (~> 3.12.0)
62
64
  rspec-support (3.12.1)
63
- rubocop (1.52.1)
65
+ rubocop (1.56.3)
66
+ base64 (~> 0.1.1)
64
67
  json (~> 2.3)
68
+ language_server-protocol (>= 3.17.0)
65
69
  parallel (~> 1.10)
66
70
  parser (>= 3.2.2.3)
67
71
  rainbow (>= 2.2.2, < 4.0)
68
72
  regexp_parser (>= 1.8, < 3.0)
69
73
  rexml (>= 3.2.5, < 4.0)
70
- rubocop-ast (>= 1.28.0, < 2.0)
74
+ rubocop-ast (>= 1.28.1, < 2.0)
71
75
  ruby-progressbar (~> 1.7)
72
76
  unicode-display_width (>= 2.4.0, < 3.0)
73
77
  rubocop-ast (1.29.0)
74
78
  parser (>= 3.2.1.0)
75
79
  rubocop-capybara (2.18.0)
76
80
  rubocop (~> 1.41)
77
- rubocop-factory_bot (2.23.1)
81
+ rubocop-factory_bot (2.24.0)
78
82
  rubocop (~> 1.33)
79
- rubocop-performance (1.18.0)
83
+ rubocop-performance (1.19.1)
80
84
  rubocop (>= 1.7.0, < 2.0)
81
85
  rubocop-ast (>= 0.4.0)
82
- rubocop-rspec (2.22.0)
86
+ rubocop-rspec (2.24.0)
83
87
  rubocop (~> 1.33)
84
88
  rubocop-capybara (~> 2.17)
85
89
  rubocop-factory_bot (~> 2.22)
@@ -91,26 +95,26 @@ GEM
91
95
  simplecov_json_formatter (~> 0.1)
92
96
  simplecov-html (0.12.3)
93
97
  simplecov_json_formatter (0.1.4)
94
- standard (1.30.1)
98
+ standard (1.31.1)
95
99
  language_server-protocol (~> 3.17.0.2)
96
100
  lint_roller (~> 1.0)
97
- rubocop (~> 1.52.0)
101
+ rubocop (~> 1.56.2)
98
102
  standard-custom (~> 1.0.0)
99
- standard-performance (~> 1.1.0)
103
+ standard-performance (~> 1.2)
100
104
  standard-custom (1.0.2)
101
105
  lint_roller (~> 1.0)
102
106
  rubocop (~> 1.50)
103
- standard-performance (1.1.2)
107
+ standard-performance (1.2.0)
104
108
  lint_roller (~> 1.1)
105
- rubocop-performance (~> 1.18.0)
109
+ rubocop-performance (~> 1.19.0)
106
110
  tzinfo (2.0.6)
107
111
  concurrent-ruby (~> 1.0)
108
112
  unicode-display_width (2.4.2)
109
- webmock (3.18.1)
113
+ webmock (3.19.1)
110
114
  addressable (>= 2.8.0)
111
115
  crack (>= 0.3.2)
112
116
  hashdiff (>= 0.4.0, < 2.0.0)
113
- zeitwerk (2.6.8)
117
+ zeitwerk (2.6.11)
114
118
 
115
119
  PLATFORMS
116
120
  x86_64-darwin-19
data/api_test.rb CHANGED
@@ -21,8 +21,8 @@ Benchmark.bm(20) do |benchmark|
21
21
  GlobusClient.mkdir(user_id:, path:)
22
22
  end
23
23
 
24
- benchmark.report("user_exists?:") do
25
- @user_exists = GlobusClient.user_exists?(user_id)
24
+ benchmark.report("user_valid?:") do
25
+ @user_exists = GlobusClient.user_valid?(user_id)
26
26
  end
27
27
 
28
28
  benchmark.report("before_perms:") do
@@ -197,6 +197,10 @@ class GlobusClient
197
197
  req.headers["Content-Type"] = "application/json"
198
198
  end
199
199
 
200
+ # debugging of Globus responses
201
+ response_body = JSON.parse(response.body)
202
+ raise(StandardError, "Response is missing DATA in: #{response_body}") unless response_body.key?("DATA")
203
+
200
204
  JSON
201
205
  .parse(response.body)["DATA"]
202
206
  .find { |acl| acl["path"] == full_path }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GlobusClient
4
- VERSION = "0.11.0"
4
+ VERSION = "0.12.0"
5
5
  end
data/lib/globus_client.rb CHANGED
@@ -23,7 +23,17 @@ class GlobusClient
23
23
  # @param auth_url [String] the authentication API URL
24
24
  def configure(client_id:, client_secret:, uploads_directory:, transfer_endpoint_id:, transfer_url: default_transfer_url, auth_url: default_auth_url)
25
25
  instance.config = OpenStruct.new(
26
- token: Authenticator.token(client_id, client_secret, auth_url),
26
+ # For the initial token, use a dummy value to avoid hitting any APIs
27
+ # during configuration, allowing the `TokenWrapper` to handle auto-magic
28
+ # token refreshing. Why not immediately get a valid token? Our apps
29
+ # commonly invoke client `.configure` methods in the initializer in all
30
+ # application environments, even those that are never expected to
31
+ # connect to production APIs, such as local development machines.
32
+ #
33
+ # NOTE: `nil` and blank string cannot be used as dummy values here as
34
+ # they lead to a malformed request to be sent, which triggers an
35
+ # exception not rescued by `TokenWrapper`
36
+ token: "a temporary dummy token to avoid hitting the API before it is needed",
27
37
  client_id:,
28
38
  client_secret:,
29
39
  uploads_directory:,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globus_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Collier
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-07-28 00:00:00.000000000 Z
13
+ date: 2023-09-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.4.10
211
+ rubygems_version: 3.4.19
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Interface for interacting with the Globus API.