globus_client 0.13.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +22 -12
- data/.rubocop_todo.yml +33 -0
- data/Gemfile +10 -2
- data/Gemfile.lock +79 -80
- data/README.md +1 -2
- data/Rakefile +3 -3
- data/api_test.rb +18 -18
- data/globus_client.gemspec +19 -26
- data/lib/globus_client/authenticator.rb +10 -18
- data/lib/globus_client/endpoint.rb +51 -48
- data/lib/globus_client/identity.rb +7 -15
- data/lib/globus_client/unexpected_response.rb +1 -1
- data/lib/globus_client/version.rb +1 -1
- data/lib/globus_client.rb +38 -34
- metadata +5 -100
- data/.autoupdate/postupdate +0 -19
- data/.rubocop/custom.yml +0 -80
- data/.standard.yml +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e189003b0a3f0592abd4fb7fabb006a3367f3cd330d83d7e46da2c2993bbbc21
|
4
|
+
data.tar.gz: 36c6ff9a70ddcfea7be6e1ca044b110adb536aa911adbb1626f5086737342d88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02cd08266cd52d2a3dd86ded97c8ce0085832fb446223375ab69164ed087187611e184e7cb4555208a0fb30b477e6c8b0e212041073cce2a3c328ddf6412e0c3
|
7
|
+
data.tar.gz: 1d54da5c74f41e1a98ecdf0296ee948e14a9e569ed1f58a20f52c96347b1b215a4121050cef2e9c7f3d25d525a5b061e9cfe79cc8517efb1ff896cb517226962
|
data/.rubocop.yml
CHANGED
@@ -1,18 +1,28 @@
|
|
1
|
-
|
2
|
-
merge:
|
3
|
-
- Exclude
|
1
|
+
inherit_from: .rubocop_todo.yml
|
4
2
|
|
5
3
|
require:
|
6
|
-
- standard
|
7
|
-
- standard-custom
|
8
|
-
- standard-performance
|
9
4
|
- rubocop-performance
|
10
5
|
- rubocop-rspec
|
11
6
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 3.1
|
9
|
+
DisplayCopNames: true
|
10
|
+
SuggestExtensions: false
|
11
|
+
NewCops: disable
|
12
|
+
Exclude:
|
13
|
+
- bin/**
|
14
|
+
- vendor/bundle/**/*
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
# Per team developer playbook
|
17
|
+
RSpec/MultipleMemoizedHelpers:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
# Layout
|
21
|
+
Layout/LineLength:
|
22
|
+
Max: 150
|
23
|
+
|
24
|
+
# Naming
|
25
|
+
Naming/PredicateName:
|
26
|
+
ForbiddenPrefixes:
|
27
|
+
- is_
|
28
|
+
- have_
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude`
|
3
|
+
# on 2023-09-29 23:59:42 UTC using RuboCop version 1.56.3.
|
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.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
Lint/StructNewOverride:
|
11
|
+
Exclude:
|
12
|
+
- 'lib/globus_client/endpoint.rb'
|
13
|
+
|
14
|
+
# Offense count: 4
|
15
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
16
|
+
Metrics/AbcSize:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/globus_client.rb'
|
19
|
+
- 'lib/globus_client/endpoint.rb'
|
20
|
+
- 'lib/globus_client/unexpected_response.rb'
|
21
|
+
|
22
|
+
# Offense count: 1
|
23
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
24
|
+
Metrics/CyclomaticComplexity:
|
25
|
+
Exclude:
|
26
|
+
- 'lib/globus_client/endpoint.rb'
|
27
|
+
|
28
|
+
# Offense count: 3
|
29
|
+
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
|
30
|
+
Metrics/MethodLength:
|
31
|
+
Exclude:
|
32
|
+
- 'lib/globus_client/endpoint.rb'
|
33
|
+
- 'lib/globus_client/unexpected_response.rb'
|
data/Gemfile
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in globus_client.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
|
8
|
+
group :deployment do
|
9
|
+
gem 'byebug'
|
10
|
+
gem 'rake', '~> 13.0'
|
11
|
+
gem 'rspec', '~> 3.0'
|
12
|
+
gem 'rubocop-performance'
|
13
|
+
gem 'rubocop-rspec'
|
14
|
+
gem 'simplecov'
|
15
|
+
gem 'webmock'
|
16
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
globus_client (0.
|
5
|
-
activesupport (>= 4.2
|
4
|
+
globus_client (0.15.0)
|
5
|
+
activesupport (>= 4.2)
|
6
6
|
faraday
|
7
7
|
faraday-retry
|
8
8
|
zeitwerk
|
@@ -10,111 +10,110 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activesupport (
|
14
|
-
|
13
|
+
activesupport (8.0.1)
|
14
|
+
base64
|
15
|
+
benchmark (>= 0.3)
|
16
|
+
bigdecimal
|
17
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
18
|
+
connection_pool (>= 2.2.5)
|
19
|
+
drb
|
15
20
|
i18n (>= 1.6, < 2)
|
21
|
+
logger (>= 1.4.2)
|
16
22
|
minitest (>= 5.1)
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
securerandom (>= 0.3)
|
24
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
25
|
+
uri (>= 0.13.1)
|
26
|
+
addressable (2.8.7)
|
27
|
+
public_suffix (>= 2.0.2, < 7.0)
|
20
28
|
ast (2.4.2)
|
21
|
-
base64 (0.
|
29
|
+
base64 (0.2.0)
|
30
|
+
benchmark (0.4.0)
|
31
|
+
bigdecimal (3.1.9)
|
22
32
|
byebug (11.1.3)
|
23
|
-
concurrent-ruby (1.
|
24
|
-
|
33
|
+
concurrent-ruby (1.3.5)
|
34
|
+
connection_pool (2.5.0)
|
35
|
+
crack (1.0.0)
|
36
|
+
bigdecimal
|
25
37
|
rexml
|
26
|
-
diff-lcs (1.5.
|
27
|
-
docile (1.4.
|
28
|
-
|
29
|
-
|
30
|
-
faraday-net_http (>= 2.0, < 3.
|
31
|
-
|
32
|
-
|
33
|
-
faraday-
|
38
|
+
diff-lcs (1.5.1)
|
39
|
+
docile (1.4.1)
|
40
|
+
drb (2.2.1)
|
41
|
+
faraday (2.12.2)
|
42
|
+
faraday-net_http (>= 2.0, < 3.5)
|
43
|
+
json
|
44
|
+
logger
|
45
|
+
faraday-net_http (3.4.0)
|
46
|
+
net-http (>= 0.5.0)
|
47
|
+
faraday-retry (2.2.1)
|
34
48
|
faraday (~> 2.0)
|
35
|
-
hashdiff (1.
|
36
|
-
i18n (1.14.
|
49
|
+
hashdiff (1.1.2)
|
50
|
+
i18n (1.14.7)
|
37
51
|
concurrent-ruby (~> 1.0)
|
38
|
-
json (2.
|
39
|
-
language_server-protocol (3.17.0.
|
40
|
-
|
41
|
-
minitest (5.
|
42
|
-
|
43
|
-
|
52
|
+
json (2.9.1)
|
53
|
+
language_server-protocol (3.17.0.4)
|
54
|
+
logger (1.6.6)
|
55
|
+
minitest (5.25.4)
|
56
|
+
net-http (0.6.0)
|
57
|
+
uri
|
58
|
+
parallel (1.26.3)
|
59
|
+
parser (3.3.7.1)
|
44
60
|
ast (~> 2.4.1)
|
45
61
|
racc
|
46
|
-
public_suffix (
|
47
|
-
racc (1.
|
62
|
+
public_suffix (6.0.1)
|
63
|
+
racc (1.8.1)
|
48
64
|
rainbow (3.1.1)
|
49
|
-
rake (13.
|
50
|
-
regexp_parser (2.
|
51
|
-
rexml (3.
|
52
|
-
rspec (3.
|
53
|
-
rspec-core (~> 3.
|
54
|
-
rspec-expectations (~> 3.
|
55
|
-
rspec-mocks (~> 3.
|
56
|
-
rspec-core (3.
|
57
|
-
rspec-support (~> 3.
|
58
|
-
rspec-expectations (3.
|
65
|
+
rake (13.2.1)
|
66
|
+
regexp_parser (2.10.0)
|
67
|
+
rexml (3.4.0)
|
68
|
+
rspec (3.13.0)
|
69
|
+
rspec-core (~> 3.13.0)
|
70
|
+
rspec-expectations (~> 3.13.0)
|
71
|
+
rspec-mocks (~> 3.13.0)
|
72
|
+
rspec-core (3.13.3)
|
73
|
+
rspec-support (~> 3.13.0)
|
74
|
+
rspec-expectations (3.13.3)
|
59
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
-
rspec-support (~> 3.
|
61
|
-
rspec-mocks (3.
|
76
|
+
rspec-support (~> 3.13.0)
|
77
|
+
rspec-mocks (3.13.2)
|
62
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
-
rspec-support (~> 3.
|
64
|
-
rspec-support (3.
|
65
|
-
rubocop (1.
|
66
|
-
base64 (~> 0.1.1)
|
79
|
+
rspec-support (~> 3.13.0)
|
80
|
+
rspec-support (3.13.2)
|
81
|
+
rubocop (1.71.2)
|
67
82
|
json (~> 2.3)
|
68
83
|
language_server-protocol (>= 3.17.0)
|
69
84
|
parallel (~> 1.10)
|
70
|
-
parser (>= 3.
|
85
|
+
parser (>= 3.3.0.2)
|
71
86
|
rainbow (>= 2.2.2, < 4.0)
|
72
|
-
regexp_parser (>=
|
73
|
-
|
74
|
-
rubocop-ast (>= 1.28.1, < 2.0)
|
87
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
88
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
75
89
|
ruby-progressbar (~> 1.7)
|
76
|
-
unicode-display_width (>= 2.4.0, <
|
77
|
-
rubocop-ast (1.
|
78
|
-
parser (>= 3.
|
79
|
-
rubocop-
|
80
|
-
rubocop (
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
rubocop (>= 1.7.0, < 2.0)
|
85
|
-
rubocop-ast (>= 0.4.0)
|
86
|
-
rubocop-rspec (2.24.1)
|
87
|
-
rubocop (~> 1.33)
|
88
|
-
rubocop-capybara (~> 2.17)
|
89
|
-
rubocop-factory_bot (~> 2.22)
|
90
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
91
|
+
rubocop-ast (1.38.0)
|
92
|
+
parser (>= 3.3.1.0)
|
93
|
+
rubocop-performance (1.23.1)
|
94
|
+
rubocop (>= 1.48.1, < 2.0)
|
95
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
96
|
+
rubocop-rspec (3.4.0)
|
97
|
+
rubocop (~> 1.61)
|
90
98
|
ruby-progressbar (1.13.0)
|
91
|
-
|
99
|
+
securerandom (0.4.1)
|
92
100
|
simplecov (0.22.0)
|
93
101
|
docile (~> 1.1)
|
94
102
|
simplecov-html (~> 0.11)
|
95
103
|
simplecov_json_formatter (~> 0.1)
|
96
|
-
simplecov-html (0.
|
104
|
+
simplecov-html (0.13.1)
|
97
105
|
simplecov_json_formatter (0.1.4)
|
98
|
-
standard (1.31.1)
|
99
|
-
language_server-protocol (~> 3.17.0.2)
|
100
|
-
lint_roller (~> 1.0)
|
101
|
-
rubocop (~> 1.56.2)
|
102
|
-
standard-custom (~> 1.0.0)
|
103
|
-
standard-performance (~> 1.2)
|
104
|
-
standard-custom (1.0.2)
|
105
|
-
lint_roller (~> 1.0)
|
106
|
-
rubocop (~> 1.50)
|
107
|
-
standard-performance (1.2.0)
|
108
|
-
lint_roller (~> 1.1)
|
109
|
-
rubocop-performance (~> 1.19.0)
|
110
106
|
tzinfo (2.0.6)
|
111
107
|
concurrent-ruby (~> 1.0)
|
112
|
-
unicode-display_width (
|
113
|
-
|
108
|
+
unicode-display_width (3.1.4)
|
109
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
110
|
+
unicode-emoji (4.0.4)
|
111
|
+
uri (1.0.2)
|
112
|
+
webmock (3.25.0)
|
114
113
|
addressable (>= 2.8.0)
|
115
114
|
crack (>= 0.3.2)
|
116
115
|
hashdiff (>= 0.4.0, < 2.0.0)
|
117
|
-
zeitwerk (2.
|
116
|
+
zeitwerk (2.7.1)
|
118
117
|
|
119
118
|
PLATFORMS
|
120
119
|
x86_64-darwin-19
|
@@ -128,9 +127,9 @@ DEPENDENCIES
|
|
128
127
|
globus_client!
|
129
128
|
rake (~> 13.0)
|
130
129
|
rspec (~> 3.0)
|
130
|
+
rubocop-performance
|
131
131
|
rubocop-rspec
|
132
132
|
simplecov
|
133
|
-
standard
|
134
133
|
webmock
|
135
134
|
|
136
135
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
[](https://badge.fury.io/rb/globus_client)
|
2
2
|
[](https://circleci.com/gh/sul-dlss/globus_client)
|
3
|
-
[](https://codeclimate.com/github/sul-dlss/globus_client/test_coverage)
|
3
|
+
[](https://codecov.io/github/sul-dlss/globus_client)
|
5
4
|
|
6
5
|
# GlobusClient
|
7
6
|
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'rubocop/rake_task'
|
6
6
|
|
7
7
|
RSpec::Core::RakeTask.new(:spec)
|
8
8
|
RuboCop::RakeTask.new
|
data/api_test.rb
CHANGED
@@ -1,40 +1,40 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
4
|
+
require 'benchmark'
|
5
|
+
require 'bundler/setup'
|
6
|
+
require 'globus_client'
|
7
7
|
|
8
|
-
Benchmark.bm(20) do |benchmark|
|
8
|
+
Benchmark.bm(20) do |benchmark| # rubocop:disable Metrics/BlockLength
|
9
9
|
user_id, path = *ARGV
|
10
10
|
|
11
|
-
benchmark.report(
|
11
|
+
benchmark.report('Configure:') do
|
12
12
|
GlobusClient.configure(
|
13
|
-
client_id: ENV
|
14
|
-
client_secret: ENV
|
15
|
-
uploads_directory: ENV
|
16
|
-
transfer_endpoint_id: ENV
|
13
|
+
client_id: ENV.fetch('GLOBUS_CLIENT_ID', nil),
|
14
|
+
client_secret: ENV.fetch('GLOBUS_CLIENT_SECRET', nil),
|
15
|
+
uploads_directory: ENV.fetch('GLOBUS_UPLOADS_DIRECTORY', nil),
|
16
|
+
transfer_endpoint_id: ENV.fetch('GLOBUS_ENDPOINT', nil)
|
17
17
|
)
|
18
18
|
end
|
19
19
|
|
20
|
-
benchmark.report(
|
20
|
+
benchmark.report('mkdir:') do
|
21
21
|
GlobusClient.mkdir(user_id:, path:)
|
22
22
|
end
|
23
23
|
|
24
|
-
benchmark.report(
|
24
|
+
benchmark.report('user_valid?:') do
|
25
25
|
@user_exists = GlobusClient.user_valid?(user_id)
|
26
26
|
end
|
27
27
|
|
28
|
-
benchmark.report(
|
28
|
+
benchmark.report('before_perms:') do
|
29
29
|
# Not part of the public API but this allows us to test access changes
|
30
|
-
@before_permissions = GlobusClient::Endpoint.new(
|
30
|
+
@before_permissions = GlobusClient::Endpoint.new(user_id:, path:).send(:access_rule)['permissions']
|
31
31
|
end
|
32
32
|
|
33
|
-
benchmark.report(
|
33
|
+
benchmark.report('has_files?:') do
|
34
34
|
@has_files = GlobusClient.has_files?(user_id:, path:)
|
35
35
|
end
|
36
36
|
|
37
|
-
benchmark.report(
|
37
|
+
benchmark.report('list_files:') do
|
38
38
|
GlobusClient.list_files(user_id:, path:) do |files|
|
39
39
|
@files_count = files.count
|
40
40
|
@total_size = files.sum(&:size)
|
@@ -42,13 +42,13 @@ Benchmark.bm(20) do |benchmark|
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
benchmark.report(
|
45
|
+
benchmark.report('disallow_writes:') do
|
46
46
|
GlobusClient.disallow_writes(user_id:, path:)
|
47
47
|
end
|
48
48
|
|
49
|
-
benchmark.report(
|
49
|
+
benchmark.report('after_perms:') do
|
50
50
|
# Not part of the public API but this allows us to test access changes
|
51
|
-
@after_permissions = GlobusClient::Endpoint.new(
|
51
|
+
@after_permissions = GlobusClient::Endpoint.new(user_id:, path:).send(:access_rule)['permissions']
|
52
52
|
end
|
53
53
|
|
54
54
|
puts "User #{user_id} exists: #{@user_exists}"
|
data/globus_client.gemspec
CHANGED
@@ -1,24 +1,24 @@
|
|
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 'globus_client/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
8
|
+
spec.name = 'globus_client'
|
9
9
|
spec.version = GlobusClient::VERSION
|
10
|
-
spec.authors = [
|
11
|
-
spec.email = [
|
10
|
+
spec.authors = ['Aaron Collier', 'Laura Wrubel', 'Mike Giarlo']
|
11
|
+
spec.email = ['aaron.collier@stanford.edu', 'lwrubel@stanford.edu', 'mjgiarlo@stanford.edu']
|
12
12
|
|
13
|
-
spec.summary =
|
14
|
-
spec.description =
|
15
|
-
spec.homepage =
|
16
|
-
spec.required_ruby_version =
|
13
|
+
spec.summary = 'Interface for interacting with the Globus API.'
|
14
|
+
spec.description = 'This provides API interaction with the Globus API'
|
15
|
+
spec.homepage = 'https://github.com/sul-dlss/globus_client'
|
16
|
+
spec.required_ruby_version = '>= 3.1.0'
|
17
17
|
|
18
|
-
spec.metadata[
|
19
|
-
spec.metadata[
|
20
|
-
spec.metadata[
|
21
|
-
spec.metadata[
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/sul-dlss/globus_client'
|
20
|
+
spec.metadata['changelog_uri'] = 'https://github.com/sul-dlss/globus_client/releases'
|
21
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
22
22
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
24
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -27,19 +27,12 @@ Gem::Specification.new do |spec|
|
|
27
27
|
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
28
28
|
end
|
29
29
|
end
|
30
|
-
spec.bindir =
|
30
|
+
spec.bindir = 'exe'
|
31
31
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
-
spec.require_paths = [
|
32
|
+
spec.require_paths = ['lib']
|
33
33
|
|
34
|
-
spec.add_dependency
|
35
|
-
spec.add_dependency
|
36
|
-
spec.add_dependency
|
37
|
-
spec.add_dependency
|
38
|
-
|
39
|
-
spec.add_development_dependency "rake", "~> 13.0"
|
40
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
41
|
-
spec.add_development_dependency "standard"
|
42
|
-
spec.add_development_dependency "rubocop-rspec"
|
43
|
-
spec.add_development_dependency "simplecov"
|
44
|
-
spec.add_development_dependency "webmock"
|
34
|
+
spec.add_dependency 'activesupport', '>= 4.2'
|
35
|
+
spec.add_dependency 'faraday'
|
36
|
+
spec.add_dependency 'faraday-retry'
|
37
|
+
spec.add_dependency 'zeitwerk'
|
45
38
|
end
|
@@ -3,40 +3,32 @@
|
|
3
3
|
class GlobusClient
|
4
4
|
# The namespace for the "login" command
|
5
5
|
class Authenticator
|
6
|
-
def self.token
|
7
|
-
new
|
8
|
-
end
|
9
|
-
|
10
|
-
def initialize(client_id, client_secret, auth_url)
|
11
|
-
@client_id = client_id
|
12
|
-
@client_secret = client_secret
|
13
|
-
@auth_url = auth_url
|
6
|
+
def self.token
|
7
|
+
new.token
|
14
8
|
end
|
15
9
|
|
16
10
|
# Request an access_token
|
17
11
|
def token
|
18
|
-
response = connection.post(
|
12
|
+
response = connection.post('/v2/oauth2/token', form_data)
|
19
13
|
|
20
14
|
UnexpectedResponse.call(response) unless response.success?
|
21
15
|
|
22
|
-
JSON.parse(response.body)[
|
16
|
+
JSON.parse(response.body)['access_token']
|
23
17
|
end
|
24
18
|
|
25
19
|
private
|
26
20
|
|
27
|
-
attr_reader :client_id, :client_secret, :auth_url
|
28
|
-
|
29
21
|
def connection
|
30
|
-
Faraday.new(url: auth_url)
|
22
|
+
Faraday.new(url: GlobusClient.config.auth_url)
|
31
23
|
end
|
32
24
|
|
33
25
|
def form_data
|
34
26
|
{
|
35
|
-
client_id
|
36
|
-
client_secret
|
37
|
-
encoding:
|
38
|
-
grant_type:
|
39
|
-
scope:
|
27
|
+
client_id: GlobusClient.config.client_id,
|
28
|
+
client_secret: GlobusClient.config.client_secret,
|
29
|
+
encoding: 'form',
|
30
|
+
grant_type: 'client_credentials',
|
31
|
+
scope: 'urn:globus:auth:scope:transfer.api.globus.org:all'
|
40
32
|
}
|
41
33
|
end
|
42
34
|
end
|
@@ -2,18 +2,18 @@
|
|
2
2
|
|
3
3
|
class GlobusClient
|
4
4
|
# The namespace for endpoint API operations
|
5
|
-
class Endpoint
|
6
|
-
PATH_SEPARATOR =
|
5
|
+
class Endpoint # rubocop:disable Metrics/ClassLength
|
6
|
+
PATH_SEPARATOR = '/'
|
7
7
|
|
8
8
|
FileInfo = Struct.new(:name, :size)
|
9
9
|
|
10
|
-
# @param client [GlobusClient] a configured instance of the GlobusClient
|
11
10
|
# @param path [String] the path to operate on
|
12
11
|
# @param user_id [String] a Globus user ID (e.g., a @stanford.edu email address)
|
13
|
-
|
14
|
-
|
12
|
+
# @param notify_email [Boolean] indicates if we should ask Globus to send emails on access change (default: true)
|
13
|
+
def initialize(path:, user_id:, notify_email: true)
|
15
14
|
@user_id = user_id
|
16
15
|
@path = path
|
16
|
+
@notify_email = notify_email
|
17
17
|
end
|
18
18
|
|
19
19
|
def has_files?
|
@@ -30,41 +30,43 @@ class GlobusClient
|
|
30
30
|
def mkdir
|
31
31
|
# transfer API does not support recursive directory creation
|
32
32
|
paths.each do |path|
|
33
|
-
|
34
|
-
base_url:
|
33
|
+
GlobusClient.instance.post(
|
34
|
+
base_url: GlobusClient.config.transfer_url,
|
35
35
|
path: "#{transfer_path}/mkdir",
|
36
|
-
body: {DATA_TYPE:
|
37
|
-
expected_response:
|
36
|
+
body: { DATA_TYPE: 'mkdir', path: },
|
37
|
+
expected_response: lambda { |resp|
|
38
|
+
resp.status == 502 && JSON.parse(resp.body)['code'] == 'ExternalError.MkdirFailed.Exists'
|
39
|
+
}
|
38
40
|
)
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
42
44
|
# Assign a user read/write permissions for a directory https://docs.globus.org/api/transfer/acl/#rest_access_create
|
43
45
|
def allow_writes
|
44
|
-
access_request(permissions:
|
46
|
+
access_request(permissions: 'rw')
|
45
47
|
end
|
46
48
|
|
47
49
|
# Assign a user read-only permissions for a directory https://docs.globus.org/api/transfer/acl/#rest_access_create
|
48
50
|
def disallow_writes
|
49
|
-
update_access_request(permissions:
|
51
|
+
update_access_request(permissions: 'r')
|
50
52
|
end
|
51
53
|
|
52
54
|
# Delete the access rule https://docs.globus.org/api/transfer/acl/#delete_access_rule
|
53
55
|
def delete_access_rule
|
54
|
-
raise(StandardError, "Access rule not found for #{path}")
|
56
|
+
raise(StandardError, "Access rule not found for #{path}") unless access_rule_id
|
55
57
|
|
56
|
-
|
57
|
-
base_url:
|
58
|
+
GlobusClient.instance.delete(
|
59
|
+
base_url: GlobusClient.config.transfer_url,
|
58
60
|
path: "#{access_path}/#{access_rule_id}"
|
59
61
|
)
|
60
62
|
end
|
61
63
|
|
62
64
|
private
|
63
65
|
|
64
|
-
attr_reader :
|
66
|
+
attr_reader :path, :user_id, :notify_email
|
65
67
|
|
66
68
|
def globus_identity_id
|
67
|
-
Identity.new
|
69
|
+
Identity.new.get_identity_id(user_id)
|
68
70
|
end
|
69
71
|
|
70
72
|
# Builds up a path from a list of path elements. E.g., input would look like:
|
@@ -74,7 +76,7 @@ class GlobusClient
|
|
74
76
|
def paths
|
75
77
|
@paths ||= path_segments.map.with_index do |_segment, index|
|
76
78
|
File
|
77
|
-
.join(
|
79
|
+
.join(GlobusClient.config.uploads_directory, path_segments.slice(..index))
|
78
80
|
.concat(PATH_SEPARATOR)
|
79
81
|
end
|
80
82
|
end
|
@@ -95,27 +97,27 @@ class GlobusClient
|
|
95
97
|
# @param files [Array<FileInfo>] an array of FileInfo structs, each of which has a name and a size
|
96
98
|
# @param return_presence [Boolean] if true, return a boolean to indicate if any files at all are present, short-circuiting the recursive operation
|
97
99
|
def ls_path(filepath, files, return_presence: false)
|
98
|
-
response =
|
99
|
-
base_url:
|
100
|
+
response = GlobusClient.instance.get(
|
101
|
+
base_url: GlobusClient.config.transfer_url,
|
100
102
|
path: "#{transfer_path}/ls",
|
101
|
-
params: {path: filepath}
|
103
|
+
params: { path: filepath }
|
102
104
|
)
|
103
105
|
|
104
|
-
response[
|
105
|
-
.select { |object| object[
|
106
|
+
response['DATA']
|
107
|
+
.select { |object| object['type'] == 'file' }
|
106
108
|
.each do |file|
|
107
109
|
return true if return_presence
|
108
110
|
|
109
|
-
files << FileInfo.new("#{filepath}#{file[
|
111
|
+
files << FileInfo.new("#{filepath}#{file['name']}", file['size'])
|
110
112
|
end
|
111
113
|
|
112
|
-
response[
|
113
|
-
.select { |object| object[
|
114
|
+
response['DATA']
|
115
|
+
.select { |object| object['type'] == 'dir' }
|
114
116
|
.each do |dir|
|
115
117
|
# NOTE: This allows the recursive method to short-circuit iff ls_path
|
116
118
|
# returns true, which only happens when return_presence is true
|
117
119
|
# and the first file is found in the ls operation.
|
118
|
-
return true if ls_path("#{filepath}#{dir[
|
120
|
+
return true if ls_path("#{filepath}#{dir['name']}/", files, return_presence:) == true
|
119
121
|
end
|
120
122
|
|
121
123
|
return false if return_presence
|
@@ -127,58 +129,59 @@ class GlobusClient
|
|
127
129
|
if access_rule_id
|
128
130
|
update_access_request(permissions:)
|
129
131
|
else
|
130
|
-
|
131
|
-
|
132
|
+
body = {
|
133
|
+
DATA_TYPE: 'access',
|
134
|
+
principal_type: 'identity',
|
135
|
+
principal: globus_identity_id,
|
136
|
+
path: full_path,
|
137
|
+
permissions:
|
138
|
+
}
|
139
|
+
body[:notify_email] = user_id if notify_email
|
140
|
+
GlobusClient.instance.post(
|
141
|
+
base_url: GlobusClient.config.transfer_url,
|
132
142
|
path: access_path,
|
133
|
-
body:
|
134
|
-
DATA_TYPE: "access",
|
135
|
-
principal_type: "identity",
|
136
|
-
principal: globus_identity_id,
|
137
|
-
path: full_path,
|
138
|
-
permissions:,
|
139
|
-
notify_email: user_id
|
140
|
-
}
|
143
|
+
body:
|
141
144
|
)
|
142
145
|
end
|
143
146
|
end
|
144
147
|
|
145
148
|
def update_access_request(permissions:)
|
146
|
-
raise(StandardError, "Access rule not found for #{path}")
|
149
|
+
raise(StandardError, "Access rule not found for #{path}") unless access_rule_id
|
147
150
|
|
148
|
-
|
149
|
-
base_url:
|
151
|
+
GlobusClient.instance.put(
|
152
|
+
base_url: GlobusClient.config.transfer_url,
|
150
153
|
path: "#{access_path}/#{access_rule_id}",
|
151
154
|
body: {
|
152
|
-
DATA_TYPE:
|
155
|
+
DATA_TYPE: 'access',
|
153
156
|
permissions:
|
154
157
|
}
|
155
158
|
)
|
156
159
|
end
|
157
160
|
|
158
161
|
def access_rule
|
159
|
-
response =
|
160
|
-
base_url:
|
162
|
+
response = GlobusClient.instance.get(
|
163
|
+
base_url: GlobusClient.config.transfer_url,
|
161
164
|
path: access_list_path,
|
162
|
-
content_type:
|
165
|
+
content_type: 'application/json'
|
163
166
|
)
|
164
167
|
|
165
|
-
response.fetch(
|
168
|
+
response.fetch('DATA').find { |acl| acl['path'] == full_path }
|
166
169
|
end
|
167
170
|
|
168
171
|
def access_rule_id
|
169
|
-
access_rule&.fetch(
|
172
|
+
access_rule&.fetch('id')
|
170
173
|
end
|
171
174
|
|
172
175
|
def transfer_path
|
173
|
-
"/v0.10/operation/endpoint/#{
|
176
|
+
"/v0.10/operation/endpoint/#{GlobusClient.config.transfer_endpoint_id}"
|
174
177
|
end
|
175
178
|
|
176
179
|
def access_path
|
177
|
-
"/v0.10/endpoint/#{
|
180
|
+
"/v0.10/endpoint/#{GlobusClient.config.transfer_endpoint_id}/access"
|
178
181
|
end
|
179
182
|
|
180
183
|
def access_list_path
|
181
|
-
"/v0.10/endpoint/#{
|
184
|
+
"/v0.10/endpoint/#{GlobusClient.config.transfer_endpoint_id}/access_list"
|
182
185
|
end
|
183
186
|
end
|
184
187
|
end
|
@@ -3,36 +3,28 @@
|
|
3
3
|
class GlobusClient
|
4
4
|
# Lookup of a Globus identity ID
|
5
5
|
class Identity
|
6
|
-
def initialize(client)
|
7
|
-
@client = client
|
8
|
-
end
|
9
|
-
|
10
6
|
# @param user_id [String] the username in the form of an email addresss
|
11
7
|
# @return [Hash] id and status of Globus identity
|
12
8
|
def get_identity(user_id)
|
13
|
-
response =
|
14
|
-
base_url:
|
15
|
-
path:
|
16
|
-
params: {usernames: user_id}
|
9
|
+
response = GlobusClient.instance.get(
|
10
|
+
base_url: GlobusClient.config.auth_url,
|
11
|
+
path: '/v2/api/identities',
|
12
|
+
params: { usernames: user_id }
|
17
13
|
)
|
18
14
|
|
19
|
-
response[
|
15
|
+
response['identities'].find { |id| id['username'] == user_id }
|
20
16
|
end
|
21
17
|
|
22
18
|
# @param user_id [String] the username in the form of an email addresss
|
23
19
|
# @return [Boolean] whether the account has a valid status
|
24
20
|
def valid?(user_id)
|
25
|
-
[
|
21
|
+
%w[used private unused].include?(get_identity(user_id)['status'])
|
26
22
|
end
|
27
23
|
|
28
24
|
# @param user_id [String] the username in the form of an email addresss
|
29
25
|
# @return [String] UUID for Globus identity
|
30
26
|
def get_identity_id(user_id)
|
31
|
-
get_identity(user_id)[
|
27
|
+
get_identity(user_id)['id']
|
32
28
|
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
attr_reader :client
|
37
29
|
end
|
38
30
|
end
|
@@ -39,7 +39,7 @@ class GlobusClient
|
|
39
39
|
when 502
|
40
40
|
raise EndpointError, "Other error with endpoint: #{response.status} #{response.body}."
|
41
41
|
when 503
|
42
|
-
raise ServiceUnavailable,
|
42
|
+
raise ServiceUnavailable, 'The service is down for maintenance.'
|
43
43
|
else
|
44
44
|
raise StandardError, "Unexpected response: #{response.status} #{response.body}."
|
45
45
|
end
|
data/lib/globus_client.rb
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require "zeitwerk"
|
3
|
+
require 'active_support/core_ext/module/delegation'
|
4
|
+
require 'active_support/core_ext/object/blank'
|
5
|
+
require 'faraday'
|
6
|
+
require 'faraday/retry'
|
7
|
+
require 'singleton'
|
8
|
+
require 'zeitwerk'
|
10
9
|
|
11
10
|
# Load the gem's internal dependencies: use Zeitwerk instead of needing to manually require classes
|
12
11
|
Zeitwerk::Loader.for_gem.setup
|
13
12
|
|
14
13
|
# Client for interacting with the Globus API
|
15
|
-
class GlobusClient
|
14
|
+
class GlobusClient # rubocop:disable Metrics/ClassLength
|
16
15
|
include Singleton
|
17
16
|
|
18
17
|
class << self
|
@@ -22,8 +21,10 @@ class GlobusClient
|
|
22
21
|
# @param transfer_endpoint_id [String] the transfer API endpoint ID supplied by Globus
|
23
22
|
# @param transfer_url [String] the transfer API URL
|
24
23
|
# @param auth_url [String] the authentication API URL
|
25
|
-
|
26
|
-
|
24
|
+
# rubocop:disable Metrics/ParameterLists
|
25
|
+
def configure(client_id:, client_secret:, uploads_directory:, transfer_endpoint_id:,
|
26
|
+
transfer_url: default_transfer_url, auth_url: default_auth_url)
|
27
|
+
instance.config = Config.new(
|
27
28
|
# For the initial token, use a dummy value to avoid hitting any APIs
|
28
29
|
# during configuration, allowing `with_token_refresh_when_unauthorized` to handle
|
29
30
|
# auto-magic token refreshing. Why not immediately get a valid token? Our apps
|
@@ -34,7 +35,7 @@ class GlobusClient
|
|
34
35
|
# NOTE: `nil` and blank string cannot be used as dummy values here as
|
35
36
|
# they lead to a malformed request to be sent, which triggers an
|
36
37
|
# exception not rescued by `with_token_refresh_when_unauthorized`
|
37
|
-
token:
|
38
|
+
token: 'a temporary dummy token to avoid hitting the API before it is needed',
|
38
39
|
client_id:,
|
39
40
|
client_secret:,
|
40
41
|
uploads_directory:,
|
@@ -45,16 +46,17 @@ class GlobusClient
|
|
45
46
|
|
46
47
|
self
|
47
48
|
end
|
49
|
+
# rubocop:enable Metrics/ParameterLists
|
48
50
|
|
49
51
|
delegate :config, :disallow_writes, :delete_access_rule, :file_count, :list_files, :mkdir, :total_size,
|
50
|
-
|
52
|
+
:user_valid?, :get_filenames, :has_files?, :delete, :get, :post, :put, to: :instance
|
51
53
|
|
52
54
|
def default_transfer_url
|
53
|
-
|
55
|
+
'https://transfer.api.globusonline.org'
|
54
56
|
end
|
55
57
|
|
56
58
|
def default_auth_url
|
57
|
-
|
59
|
+
'https://auth.globus.org'
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
@@ -67,8 +69,8 @@ class GlobusClient
|
|
67
69
|
def get(base_url:, path:, params: {}, content_type: nil)
|
68
70
|
response = with_token_refresh_when_unauthorized do
|
69
71
|
connection(base_url).get(path, params) do |request|
|
70
|
-
request.headers[
|
71
|
-
request.headers[
|
72
|
+
request.headers['Authorization'] = "Bearer #{config.token}"
|
73
|
+
request.headers['Content-Type'] = content_type if content_type
|
72
74
|
end
|
73
75
|
end
|
74
76
|
|
@@ -84,11 +86,11 @@ class GlobusClient
|
|
84
86
|
# @param path [String] the path to the Globus API request
|
85
87
|
# @param body [String] the body of the Globus API request
|
86
88
|
# @param expected_response [#call] an expected response handler to allow short-circuiting the unexpected response
|
87
|
-
def post(base_url:, path:, body:, expected_response: ->(
|
89
|
+
def post(base_url:, path:, body:, expected_response: ->(_resp) { false })
|
88
90
|
response = with_token_refresh_when_unauthorized do
|
89
91
|
connection(base_url).post(path) do |request|
|
90
|
-
request.headers[
|
91
|
-
request.headers[
|
92
|
+
request.headers['Authorization'] = "Bearer #{config.token}"
|
93
|
+
request.headers['Content-Type'] = 'application/json'
|
92
94
|
request.body = body.to_json
|
93
95
|
end
|
94
96
|
end
|
@@ -107,8 +109,8 @@ class GlobusClient
|
|
107
109
|
def put(base_url:, path:, body:)
|
108
110
|
response = with_token_refresh_when_unauthorized do
|
109
111
|
connection(base_url).put(path) do |request|
|
110
|
-
request.headers[
|
111
|
-
request.headers[
|
112
|
+
request.headers['Authorization'] = "Bearer #{config.token}"
|
113
|
+
request.headers['Content-Type'] = 'application/json'
|
112
114
|
request.body = body.to_json
|
113
115
|
end
|
114
116
|
end
|
@@ -126,7 +128,7 @@ class GlobusClient
|
|
126
128
|
def delete(base_url:, path:)
|
127
129
|
response = with_token_refresh_when_unauthorized do
|
128
130
|
connection(base_url).delete(path) do |request|
|
129
|
-
request.headers[
|
131
|
+
request.headers['Authorization'] = "Bearer #{config.token}"
|
130
132
|
end
|
131
133
|
end
|
132
134
|
|
@@ -138,7 +140,7 @@ class GlobusClient
|
|
138
140
|
end
|
139
141
|
|
140
142
|
def mkdir(...)
|
141
|
-
Endpoint.new(
|
143
|
+
Endpoint.new(...).tap do |endpoint|
|
142
144
|
endpoint.mkdir
|
143
145
|
endpoint.allow_writes
|
144
146
|
end
|
@@ -146,57 +148,59 @@ class GlobusClient
|
|
146
148
|
|
147
149
|
def disallow_writes(...)
|
148
150
|
Endpoint
|
149
|
-
.new(
|
151
|
+
.new(...)
|
150
152
|
.disallow_writes
|
151
153
|
end
|
152
154
|
|
153
155
|
def delete_access_rule(...)
|
154
156
|
Endpoint
|
155
|
-
.new(
|
157
|
+
.new(...)
|
156
158
|
.delete_access_rule
|
157
159
|
end
|
158
160
|
|
159
161
|
# NOTE: Can't use the `...` (argument forwarding) operator here because we
|
160
162
|
# want to route the keyword args to `Endpoint#new` and the block arg to
|
161
163
|
# `Endpoint#list_files`
|
162
|
-
def list_files(**keywords, &
|
164
|
+
def list_files(**keywords, &)
|
163
165
|
Endpoint
|
164
|
-
.new(
|
165
|
-
.list_files(&
|
166
|
+
.new(**keywords)
|
167
|
+
.list_files(&)
|
166
168
|
end
|
167
169
|
|
168
170
|
def file_count(...)
|
169
171
|
Endpoint
|
170
|
-
.new(
|
172
|
+
.new(...)
|
171
173
|
.list_files { |files| return files.count }
|
172
174
|
end
|
173
175
|
|
174
176
|
def total_size(...)
|
175
177
|
Endpoint
|
176
|
-
.new(
|
178
|
+
.new(...)
|
177
179
|
.list_files { |files| return files.sum(&:size) }
|
178
180
|
end
|
179
181
|
|
180
182
|
def get_filenames(...)
|
181
183
|
Endpoint
|
182
|
-
.new(
|
184
|
+
.new(...)
|
183
185
|
.list_files { |files| return files.map(&:name) }
|
184
186
|
end
|
185
187
|
|
186
188
|
def has_files?(...)
|
187
189
|
Endpoint
|
188
|
-
.new(
|
190
|
+
.new(...)
|
189
191
|
.has_files?
|
190
192
|
end
|
191
193
|
|
192
194
|
def user_valid?(...)
|
193
195
|
Identity
|
194
|
-
.new
|
196
|
+
.new
|
195
197
|
.valid?(...)
|
196
198
|
end
|
197
199
|
|
198
200
|
private
|
199
201
|
|
202
|
+
Config = Struct.new(:client_id, :auth_url, :client_secret, :transfer_endpoint_id, :transfer_url, :uploads_directory, :token, keyword_init: true)
|
203
|
+
|
200
204
|
def connection(base_url)
|
201
205
|
Faraday.new(url: base_url) do |conn|
|
202
206
|
conn.request :retry, {
|
@@ -226,7 +230,7 @@ class GlobusClient
|
|
226
230
|
|
227
231
|
# if unauthorized, token has likely expired. try to get a new token and then retry the same request(s).
|
228
232
|
if response.status == 401
|
229
|
-
config.token = Authenticator.token
|
233
|
+
config.token = Authenticator.token
|
230
234
|
response = yield
|
231
235
|
end
|
232
236
|
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: globus_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Collier
|
8
8
|
- Laura Wrubel
|
9
9
|
- Mike Giarlo
|
10
|
-
autorequire:
|
11
10
|
bindir: exe
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: activesupport
|
@@ -19,9 +18,6 @@ dependencies:
|
|
19
18
|
- - ">="
|
20
19
|
- !ruby/object:Gem::Version
|
21
20
|
version: '4.2'
|
22
|
-
- - "<"
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: '8'
|
25
21
|
type: :runtime
|
26
22
|
prerelease: false
|
27
23
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,9 +25,6 @@ dependencies:
|
|
29
25
|
- - ">="
|
30
26
|
- !ruby/object:Gem::Version
|
31
27
|
version: '4.2'
|
32
|
-
- - "<"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '8'
|
35
28
|
- !ruby/object:Gem::Dependency
|
36
29
|
name: faraday
|
37
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,90 +67,6 @@ dependencies:
|
|
74
67
|
- - ">="
|
75
68
|
- !ruby/object:Gem::Version
|
76
69
|
version: '0'
|
77
|
-
- !ruby/object:Gem::Dependency
|
78
|
-
name: rake
|
79
|
-
requirement: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - "~>"
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '13.0'
|
84
|
-
type: :development
|
85
|
-
prerelease: false
|
86
|
-
version_requirements: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - "~>"
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '13.0'
|
91
|
-
- !ruby/object:Gem::Dependency
|
92
|
-
name: rspec
|
93
|
-
requirement: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - "~>"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '3.0'
|
98
|
-
type: :development
|
99
|
-
prerelease: false
|
100
|
-
version_requirements: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - "~>"
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '3.0'
|
105
|
-
- !ruby/object:Gem::Dependency
|
106
|
-
name: standard
|
107
|
-
requirement: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - ">="
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '0'
|
112
|
-
type: :development
|
113
|
-
prerelease: false
|
114
|
-
version_requirements: !ruby/object:Gem::Requirement
|
115
|
-
requirements:
|
116
|
-
- - ">="
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: '0'
|
119
|
-
- !ruby/object:Gem::Dependency
|
120
|
-
name: rubocop-rspec
|
121
|
-
requirement: !ruby/object:Gem::Requirement
|
122
|
-
requirements:
|
123
|
-
- - ">="
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
126
|
-
type: :development
|
127
|
-
prerelease: false
|
128
|
-
version_requirements: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - ">="
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '0'
|
133
|
-
- !ruby/object:Gem::Dependency
|
134
|
-
name: simplecov
|
135
|
-
requirement: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - ">="
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '0'
|
140
|
-
type: :development
|
141
|
-
prerelease: false
|
142
|
-
version_requirements: !ruby/object:Gem::Requirement
|
143
|
-
requirements:
|
144
|
-
- - ">="
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
version: '0'
|
147
|
-
- !ruby/object:Gem::Dependency
|
148
|
-
name: webmock
|
149
|
-
requirement: !ruby/object:Gem::Requirement
|
150
|
-
requirements:
|
151
|
-
- - ">="
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
version: '0'
|
154
|
-
type: :development
|
155
|
-
prerelease: false
|
156
|
-
version_requirements: !ruby/object:Gem::Requirement
|
157
|
-
requirements:
|
158
|
-
- - ">="
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
version: '0'
|
161
70
|
description: This provides API interaction with the Globus API
|
162
71
|
email:
|
163
72
|
- aaron.collier@stanford.edu
|
@@ -167,11 +76,9 @@ executables: []
|
|
167
76
|
extensions: []
|
168
77
|
extra_rdoc_files: []
|
169
78
|
files:
|
170
|
-
- ".autoupdate/postupdate"
|
171
79
|
- ".rspec"
|
172
80
|
- ".rubocop.yml"
|
173
|
-
- ".
|
174
|
-
- ".standard.yml"
|
81
|
+
- ".rubocop_todo.yml"
|
175
82
|
- Gemfile
|
176
83
|
- Gemfile.lock
|
177
84
|
- LICENSE
|
@@ -192,7 +99,6 @@ metadata:
|
|
192
99
|
source_code_uri: https://github.com/sul-dlss/globus_client
|
193
100
|
changelog_uri: https://github.com/sul-dlss/globus_client/releases
|
194
101
|
rubygems_mfa_required: 'true'
|
195
|
-
post_install_message:
|
196
102
|
rdoc_options: []
|
197
103
|
require_paths:
|
198
104
|
- lib
|
@@ -200,15 +106,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
106
|
requirements:
|
201
107
|
- - ">="
|
202
108
|
- !ruby/object:Gem::Version
|
203
|
-
version:
|
109
|
+
version: 3.1.0
|
204
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
111
|
requirements:
|
206
112
|
- - ">="
|
207
113
|
- !ruby/object:Gem::Version
|
208
114
|
version: '0'
|
209
115
|
requirements: []
|
210
|
-
rubygems_version: 3.
|
211
|
-
signing_key:
|
116
|
+
rubygems_version: 3.6.3
|
212
117
|
specification_version: 4
|
213
118
|
summary: Interface for interacting with the Globus API.
|
214
119
|
test_files: []
|
data/.autoupdate/postupdate
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/bin/bash --login
|
2
|
-
|
3
|
-
# This script is called by our weekly dependency update job in Jenkins after updating Ruby and other deps
|
4
|
-
|
5
|
-
# Switch to Ruby 3.1 for GlobusClient (3.0 is default in Jenkinsfile)
|
6
|
-
rvm use 3.1.2@globus_client --create &&
|
7
|
-
gem install bundler &&
|
8
|
-
bundle install --gemfile Gemfile
|
9
|
-
|
10
|
-
standardrb --fix > globus_client_standard.txt
|
11
|
-
|
12
|
-
retVal=$?
|
13
|
-
|
14
|
-
git commit -am "Update to latest standard style guide"
|
15
|
-
|
16
|
-
if [ $retVal -ne 0 ]; then
|
17
|
-
echo "ERROR UPDATING RUBY TO STANDARD STYLE (globus_client)"
|
18
|
-
cat globus_client_standard.txt
|
19
|
-
fi
|
data/.rubocop/custom.yml
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
TargetRubyVersion: 3.1
|
3
|
-
DisplayCopNames: true
|
4
|
-
SuggestExtensions: false
|
5
|
-
Exclude:
|
6
|
-
- bin/**
|
7
|
-
- vendor/bundle/**/*
|
8
|
-
|
9
|
-
# Per team developer playbook
|
10
|
-
RSpec/MultipleMemoizedHelpers:
|
11
|
-
Enabled: false
|
12
|
-
|
13
|
-
RSpec/BeEq: # new in 2.9.0
|
14
|
-
Enabled: true
|
15
|
-
RSpec/BeNil: # new in 2.9.0
|
16
|
-
Enabled: true
|
17
|
-
RSpec/ChangeByZero: # new in 2.11
|
18
|
-
Enabled: true
|
19
|
-
RSpec/ClassCheck: # new in 2.13
|
20
|
-
Enabled: true
|
21
|
-
RSpec/ExcessiveDocstringSpacing: # new in 2.5
|
22
|
-
Enabled: true
|
23
|
-
RSpec/IdenticalEqualityAssertion: # new in 2.4
|
24
|
-
Enabled: true
|
25
|
-
RSpec/NoExpectationExample: # new in 2.13
|
26
|
-
Enabled: true
|
27
|
-
RSpec/SortMetadata: # new in 2.14
|
28
|
-
Enabled: true
|
29
|
-
RSpec/SubjectDeclaration: # new in 2.5
|
30
|
-
Enabled: true
|
31
|
-
RSpec/VerifiedDoubleReference: # new in 2.10.0
|
32
|
-
Enabled: true
|
33
|
-
Capybara/NegationMatcher: # new in 2.14
|
34
|
-
Enabled: true
|
35
|
-
Capybara/SpecificActions: # new in 2.14
|
36
|
-
Enabled: true
|
37
|
-
Capybara/SpecificFinders: # new in 2.13
|
38
|
-
Enabled: true
|
39
|
-
Capybara/SpecificMatcher: # new in 2.12
|
40
|
-
Enabled: true
|
41
|
-
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
|
42
|
-
Enabled: true
|
43
|
-
FactoryBot/SyntaxMethods: # new in 2.7
|
44
|
-
Enabled: true
|
45
|
-
RSpec/Rails/AvoidSetupHook: # new in 2.4
|
46
|
-
Enabled: true
|
47
|
-
RSpec/Rails/HaveHttpStatus: # new in 2.12
|
48
|
-
Enabled: true
|
49
|
-
RSpec/Rails/InferredSpecType: # new in 2.14
|
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/.standard.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
parallel: true
|