globus_client 0.9.1 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop/custom.yml +36 -6
- data/.rubocop.yml +5 -2
- data/Gemfile.lock +42 -28
- data/README.md +1 -1
- data/lib/globus_client/endpoint.rb +1 -1
- data/lib/globus_client/identity.rb +14 -14
- data/lib/globus_client/version.rb +1 -1
- data/lib/globus_client.rb +3 -3
- metadata +3 -4
- data/.rubocop_todo.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87ecd66b77eb1e4806ab42b2d7f8731ae3500127c143363da97df8ed514cc809
|
4
|
+
data.tar.gz: 2023133582b10a3796ffae425954c8f5ca7d53583ab5246bce82a67bd5e8c22d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c1c4b4741b1080b01ad8067fbad40f4443ffbc6e0431446bc13278df91e4e027b7d7308ddf1297267bf4ad358979c991a67c9abaa7a216276553cd7c8a9f2fb
|
7
|
+
data.tar.gz: b2cd05d79e4186849e4bab41bf92bc921031dd10d315ffe3ce81d638b38d6a263f9727fff99abdaf513b30e8b87c7e726b6fe3f2f1587d118b60b38ae8bb35bb
|
data/.rubocop/custom.yml
CHANGED
@@ -30,17 +30,17 @@ RSpec/SubjectDeclaration: # new in 2.5
|
|
30
30
|
Enabled: true
|
31
31
|
RSpec/VerifiedDoubleReference: # new in 2.10.0
|
32
32
|
Enabled: true
|
33
|
-
|
33
|
+
Capybara/NegationMatcher: # new in 2.14
|
34
34
|
Enabled: true
|
35
|
-
|
35
|
+
Capybara/SpecificActions: # new in 2.14
|
36
36
|
Enabled: true
|
37
|
-
|
37
|
+
Capybara/SpecificFinders: # new in 2.13
|
38
38
|
Enabled: true
|
39
|
-
|
39
|
+
Capybara/SpecificMatcher: # new in 2.12
|
40
40
|
Enabled: true
|
41
|
-
|
41
|
+
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
|
42
42
|
Enabled: true
|
43
|
-
|
43
|
+
FactoryBot/SyntaxMethods: # new in 2.7
|
44
44
|
Enabled: true
|
45
45
|
RSpec/Rails/AvoidSetupHook: # new in 2.4
|
46
46
|
Enabled: true
|
@@ -48,3 +48,33 @@ RSpec/Rails/HaveHttpStatus: # new in 2.12
|
|
48
48
|
Enabled: true
|
49
49
|
RSpec/Rails/InferredSpecType: # new in 2.14
|
50
50
|
Enabled: true
|
51
|
+
Capybara/MatchStyle: # new in 2.17
|
52
|
+
Enabled: true
|
53
|
+
FactoryBot/AssociationStyle: # new in 2.23
|
54
|
+
Enabled: true
|
55
|
+
FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
|
56
|
+
Enabled: true
|
57
|
+
FactoryBot/FactoryNameStyle: # new in 2.16
|
58
|
+
Enabled: true
|
59
|
+
FactoryBot/RedundantFactoryOption: # new in 2.23
|
60
|
+
Enabled: true
|
61
|
+
RSpec/BeEmpty: # new in 2.20
|
62
|
+
Enabled: true
|
63
|
+
RSpec/ContainExactly: # new in 2.19
|
64
|
+
Enabled: true
|
65
|
+
RSpec/DuplicatedMetadata: # new in 2.16
|
66
|
+
Enabled: true
|
67
|
+
RSpec/IndexedLet: # new in 2.20
|
68
|
+
Enabled: false # Sometimes indices *are* meaningful
|
69
|
+
RSpec/MatchArray: # new in 2.19
|
70
|
+
Enabled: true
|
71
|
+
RSpec/PendingWithoutReason: # new in 2.16
|
72
|
+
Enabled: true
|
73
|
+
RSpec/RedundantAround: # new in 2.19
|
74
|
+
Enabled: true
|
75
|
+
RSpec/SkipBlockInsideExample: # new in 2.19
|
76
|
+
Enabled: true
|
77
|
+
RSpec/Rails/MinitestAssertions: # new in 2.17
|
78
|
+
Enabled: true
|
79
|
+
RSpec/Rails/TravelAround: # new in 2.19
|
80
|
+
Enabled: true
|
data/.rubocop.yml
CHANGED
@@ -3,13 +3,16 @@ inherit_mode:
|
|
3
3
|
- Exclude
|
4
4
|
|
5
5
|
require:
|
6
|
+
- standard
|
7
|
+
- standard-custom
|
8
|
+
- standard-performance
|
6
9
|
- rubocop-performance
|
7
10
|
- rubocop-rspec
|
8
|
-
- standard
|
9
11
|
|
10
12
|
inherit_gem:
|
11
13
|
standard: config/base.yml
|
14
|
+
standard-performance: config/base.yml
|
15
|
+
standard-custom: config/base.yml
|
12
16
|
|
13
17
|
inherit_from:
|
14
18
|
- .rubocop/custom.yml
|
15
|
-
- .rubocop_todo.yml
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
globus_client (0.
|
4
|
+
globus_client (0.10.0)
|
5
5
|
activesupport (>= 4.2, < 8)
|
6
6
|
faraday
|
7
7
|
faraday-retry
|
@@ -10,12 +10,12 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activesupport (7.0.
|
13
|
+
activesupport (7.0.6)
|
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.
|
18
|
+
addressable (2.8.4)
|
19
19
|
public_suffix (>= 2.0.2, < 6.0)
|
20
20
|
ast (2.4.2)
|
21
21
|
byebug (11.1.3)
|
@@ -24,60 +24,66 @@ GEM
|
|
24
24
|
rexml
|
25
25
|
diff-lcs (1.5.0)
|
26
26
|
docile (1.4.0)
|
27
|
-
faraday (2.7.
|
27
|
+
faraday (2.7.10)
|
28
28
|
faraday-net_http (>= 2.0, < 3.1)
|
29
29
|
ruby2_keywords (>= 0.0.4)
|
30
30
|
faraday-net_http (3.0.2)
|
31
|
-
faraday-retry (2.
|
31
|
+
faraday-retry (2.2.0)
|
32
32
|
faraday (~> 2.0)
|
33
33
|
hashdiff (1.0.1)
|
34
|
-
i18n (1.
|
34
|
+
i18n (1.14.1)
|
35
35
|
concurrent-ruby (~> 1.0)
|
36
36
|
json (2.6.3)
|
37
37
|
language_server-protocol (3.17.0.3)
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
lint_roller (1.1.0)
|
39
|
+
minitest (5.18.1)
|
40
|
+
parallel (1.23.0)
|
41
|
+
parser (3.2.2.3)
|
41
42
|
ast (~> 2.4.1)
|
42
|
-
|
43
|
+
racc
|
44
|
+
public_suffix (5.0.3)
|
45
|
+
racc (1.7.1)
|
43
46
|
rainbow (3.1.1)
|
44
47
|
rake (13.0.6)
|
45
|
-
regexp_parser (2.
|
48
|
+
regexp_parser (2.8.1)
|
46
49
|
rexml (3.2.5)
|
47
50
|
rspec (3.12.0)
|
48
51
|
rspec-core (~> 3.12.0)
|
49
52
|
rspec-expectations (~> 3.12.0)
|
50
53
|
rspec-mocks (~> 3.12.0)
|
51
|
-
rspec-core (3.12.
|
54
|
+
rspec-core (3.12.2)
|
52
55
|
rspec-support (~> 3.12.0)
|
53
|
-
rspec-expectations (3.12.
|
56
|
+
rspec-expectations (3.12.3)
|
54
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
58
|
rspec-support (~> 3.12.0)
|
56
|
-
rspec-mocks (3.12.
|
59
|
+
rspec-mocks (3.12.6)
|
57
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
61
|
rspec-support (~> 3.12.0)
|
59
|
-
rspec-support (3.12.
|
60
|
-
rubocop (1.
|
62
|
+
rspec-support (3.12.1)
|
63
|
+
rubocop (1.52.1)
|
61
64
|
json (~> 2.3)
|
62
65
|
parallel (~> 1.10)
|
63
|
-
parser (>= 3.2.
|
66
|
+
parser (>= 3.2.2.3)
|
64
67
|
rainbow (>= 2.2.2, < 4.0)
|
65
68
|
regexp_parser (>= 1.8, < 3.0)
|
66
69
|
rexml (>= 3.2.5, < 4.0)
|
67
|
-
rubocop-ast (>= 1.
|
70
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
68
71
|
ruby-progressbar (~> 1.7)
|
69
72
|
unicode-display_width (>= 2.4.0, < 3.0)
|
70
|
-
rubocop-ast (1.
|
73
|
+
rubocop-ast (1.29.0)
|
71
74
|
parser (>= 3.2.1.0)
|
72
|
-
rubocop-capybara (2.
|
75
|
+
rubocop-capybara (2.18.0)
|
73
76
|
rubocop (~> 1.41)
|
74
|
-
rubocop-
|
77
|
+
rubocop-factory_bot (2.23.1)
|
78
|
+
rubocop (~> 1.33)
|
79
|
+
rubocop-performance (1.18.0)
|
75
80
|
rubocop (>= 1.7.0, < 2.0)
|
76
81
|
rubocop-ast (>= 0.4.0)
|
77
|
-
rubocop-rspec (2.
|
82
|
+
rubocop-rspec (2.22.0)
|
78
83
|
rubocop (~> 1.33)
|
79
84
|
rubocop-capybara (~> 2.17)
|
80
|
-
|
85
|
+
rubocop-factory_bot (~> 2.22)
|
86
|
+
ruby-progressbar (1.13.0)
|
81
87
|
ruby2_keywords (0.0.5)
|
82
88
|
simplecov (0.22.0)
|
83
89
|
docile (~> 1.1)
|
@@ -85,10 +91,18 @@ GEM
|
|
85
91
|
simplecov_json_formatter (~> 0.1)
|
86
92
|
simplecov-html (0.12.3)
|
87
93
|
simplecov_json_formatter (0.1.4)
|
88
|
-
standard (1.
|
94
|
+
standard (1.30.1)
|
89
95
|
language_server-protocol (~> 3.17.0.2)
|
90
|
-
|
91
|
-
rubocop
|
96
|
+
lint_roller (~> 1.0)
|
97
|
+
rubocop (~> 1.52.0)
|
98
|
+
standard-custom (~> 1.0.0)
|
99
|
+
standard-performance (~> 1.1.0)
|
100
|
+
standard-custom (1.0.2)
|
101
|
+
lint_roller (~> 1.0)
|
102
|
+
rubocop (~> 1.50)
|
103
|
+
standard-performance (1.1.2)
|
104
|
+
lint_roller (~> 1.1)
|
105
|
+
rubocop-performance (~> 1.18.0)
|
92
106
|
tzinfo (2.0.6)
|
93
107
|
concurrent-ruby (~> 1.0)
|
94
108
|
unicode-display_width (2.4.2)
|
@@ -96,7 +110,7 @@ GEM
|
|
96
110
|
addressable (>= 2.8.0)
|
97
111
|
crack (>= 0.3.2)
|
98
112
|
hashdiff (>= 0.4.0, < 2.0.0)
|
99
|
-
zeitwerk (2.6.
|
113
|
+
zeitwerk (2.6.8)
|
100
114
|
|
101
115
|
PLATFORMS
|
102
116
|
x86_64-darwin-19
|
@@ -116,4 +130,4 @@ DEPENDENCIES
|
|
116
130
|
webmock
|
117
131
|
|
118
132
|
BUNDLED WITH
|
119
|
-
2.
|
133
|
+
2.4.13
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ client = GlobusClient.configure(
|
|
33
33
|
)
|
34
34
|
client.mkdir(user_id: 'mjgiarlo@stanford.edu', path: 'mjgiarlo/work1234/version1')
|
35
35
|
|
36
|
-
result = client.
|
36
|
+
result = client.user_valid?('mjgiarlo@stanford.edu')
|
37
37
|
```
|
38
38
|
|
39
39
|
You can also invoke methods directly on the client class, which is useful in a
|
@@ -113,7 +113,7 @@ class GlobusClient
|
|
113
113
|
# @param files [Array<FileInfo>] an array of FileInfo structs, each of which has a name and a size
|
114
114
|
# @param return_presence [Boolean] if true, return a boolean to indicate if any files at all are present, short-circuiting the recursive operation
|
115
115
|
def ls_path(filepath, files, return_presence: false)
|
116
|
-
response = connection.get("#{transfer_path}/ls?path=#{filepath}")
|
116
|
+
response = connection.get("#{transfer_path}/ls?path=#{CGI.escape(filepath)}")
|
117
117
|
return UnexpectedResponse.call(response) unless response.success?
|
118
118
|
|
119
119
|
data = JSON.parse(response.body)["DATA"]
|
@@ -7,9 +7,10 @@ class GlobusClient
|
|
7
7
|
@config = config
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
# @param user_id [String] the username in the form of an email addresss
|
11
|
+
# @return [Hash] id and status of Globus identity
|
12
|
+
def get_identity(user_id)
|
11
13
|
@email = user_id
|
12
|
-
|
13
14
|
response = lookup_identity
|
14
15
|
UnexpectedResponse.call(response) unless response.success?
|
15
16
|
|
@@ -17,12 +18,16 @@ class GlobusClient
|
|
17
18
|
extract_id(data)
|
18
19
|
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
# @param user_id [String] the username in the form of an email addresss
|
22
|
+
# @return [Boolean] whether the account has a valid status
|
23
|
+
def valid?(user_id)
|
24
|
+
["used", "private", "unused"].include?(get_identity(user_id)["status"])
|
25
|
+
end
|
26
|
+
|
27
|
+
# @param user_id [String] the username in the form of an email addresss
|
28
|
+
# @return [String] UUID for Globus identity
|
29
|
+
def get_identity_id(user_id)
|
30
|
+
get_identity(user_id)["id"]
|
26
31
|
end
|
27
32
|
|
28
33
|
private
|
@@ -43,12 +48,7 @@ class GlobusClient
|
|
43
48
|
|
44
49
|
def extract_id(data)
|
45
50
|
identities = data["identities"]
|
46
|
-
|
47
|
-
matching_users = identities.select { |id| id["username"] == @email }
|
48
|
-
active_users = matching_users.select { |user| (user["status"] == "used" || user["status"] == "private") }
|
49
|
-
raise "No matching active Globus user found for #{@email}." if active_users.empty?
|
50
|
-
|
51
|
-
active_users.first["id"]
|
51
|
+
identities.find { |id| id["username"] == @email }
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/lib/globus_client.rb
CHANGED
@@ -36,7 +36,7 @@ class GlobusClient
|
|
36
36
|
end
|
37
37
|
|
38
38
|
delegate :config, :disallow_writes, :file_count, :list_files, :mkdir, :total_size,
|
39
|
-
:
|
39
|
+
:user_valid?, :get_filenames, :has_files?, to: :instance
|
40
40
|
|
41
41
|
def default_transfer_url
|
42
42
|
"https://transfer.api.globusonline.org"
|
@@ -102,10 +102,10 @@ class GlobusClient
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
def
|
105
|
+
def user_valid?(...)
|
106
106
|
TokenWrapper.refresh(config) do
|
107
107
|
identity = Identity.new(config)
|
108
|
-
identity.
|
108
|
+
identity.valid?(...)
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
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.
|
4
|
+
version: 0.10.1
|
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-
|
13
|
+
date: 2023-07-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -171,7 +171,6 @@ files:
|
|
171
171
|
- ".rspec"
|
172
172
|
- ".rubocop.yml"
|
173
173
|
- ".rubocop/custom.yml"
|
174
|
-
- ".rubocop_todo.yml"
|
175
174
|
- ".standard.yml"
|
176
175
|
- Gemfile
|
177
176
|
- Gemfile.lock
|
@@ -209,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
208
|
- !ruby/object:Gem::Version
|
210
209
|
version: '0'
|
211
210
|
requirements: []
|
212
|
-
rubygems_version: 3.4.
|
211
|
+
rubygems_version: 3.4.10
|
213
212
|
signing_key:
|
214
213
|
specification_version: 4
|
215
214
|
summary: Interface for interacting with the Globus API.
|
data/.rubocop_todo.yml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2022-10-27 22:53:23 UTC using RuboCop version 1.37.0.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|