globus_client 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/globus_client/endpoint.rb +27 -1
- data/lib/globus_client/version.rb +1 -1
- data/lib/globus_client.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17883fcf5075a2d48a8c1d6d8dec772c4f6b7bf9df670744ac99280fafb4d70d
|
4
|
+
data.tar.gz: 4652598239017ee6d049359b60d4931ab4efe6d2c90f222434554b93556c2edd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a3f421d6284bd63a9e19ec0526d06d1c3757752d1367b9bef7fe5a5b651dbf369b9d6e02589b8c8e4d60e3a0d71f3c6974961ff68ffdb3d5b8642e7c21aceb0
|
7
|
+
data.tar.gz: 67dd2fa038211a82ec0651c24812666b138ce6172beff07adbfa90864ea5874c5297f0ff155c16158634d2f02220d43f85449032710ffa21095f73c9dcabe23b
|
data/Gemfile.lock
CHANGED
@@ -57,7 +57,17 @@ class GlobusClient
|
|
57
57
|
|
58
58
|
# Assign a user read-only permissions for a directory https://docs.globus.org/api/transfer/acl/#rest_access_create
|
59
59
|
def disallow_writes
|
60
|
-
|
60
|
+
update_access_request(permissions: "r")
|
61
|
+
end
|
62
|
+
|
63
|
+
# Delete the access rule https://docs.globus.org/api/transfer/acl/#delete_access_rule
|
64
|
+
def delete_access_rule
|
65
|
+
raise(StandardError, "Access rule not found for #{path}") if !access_rule_id
|
66
|
+
|
67
|
+
response = connection.delete("#{access_path}/#{access_rule_id}")
|
68
|
+
return true if response.success?
|
69
|
+
|
70
|
+
UnexpectedResponse.call(response)
|
61
71
|
end
|
62
72
|
|
63
73
|
private
|
@@ -166,6 +176,22 @@ class GlobusClient
|
|
166
176
|
UnexpectedResponse.call(response)
|
167
177
|
end
|
168
178
|
|
179
|
+
def update_access_request(permissions:)
|
180
|
+
raise(StandardError, "Access rule not found for #{path}") if !access_rule_id
|
181
|
+
|
182
|
+
response = connection.put("#{access_path}/#{access_rule_id}") do |req|
|
183
|
+
req.body = {
|
184
|
+
DATA_TYPE: "access",
|
185
|
+
permissions:
|
186
|
+
}.to_json
|
187
|
+
req.headers["Content-Type"] = "application/json"
|
188
|
+
end
|
189
|
+
|
190
|
+
return true if response.success?
|
191
|
+
|
192
|
+
UnexpectedResponse.call(response)
|
193
|
+
end
|
194
|
+
|
169
195
|
def access_rule
|
170
196
|
response = connection.get(access_list_path) do |req|
|
171
197
|
req.headers["Content-Type"] = "application/json"
|
data/lib/globus_client.rb
CHANGED
@@ -35,7 +35,7 @@ class GlobusClient
|
|
35
35
|
self
|
36
36
|
end
|
37
37
|
|
38
|
-
delegate :config, :disallow_writes, :file_count, :list_files, :mkdir, :total_size,
|
38
|
+
delegate :config, :disallow_writes, :delete_access_rule, :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
|
@@ -64,6 +64,13 @@ class GlobusClient
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
def delete_access_rule(...)
|
68
|
+
TokenWrapper.refresh(config) do
|
69
|
+
endpoint = Endpoint.new(config, ...)
|
70
|
+
endpoint.delete_access_rule
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
67
74
|
# NOTE: Can't use the `...` (argument forwarding) operator here because we
|
68
75
|
# want to route the keyword args to `Endpoint#new` and the block arg to
|
69
76
|
# `Endpoint#list_files`
|
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.11.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-
|
13
|
+
date: 2023-07-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|