Sha256: df83e5c92ddfa88fad97ba36e4fd13cb584e2587a69362bbdf6ef9f6c5c7c20c

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "globus_client"

GlobusClient.configure(
  client_id: ENV["GLOBUS_CLIENT_ID"],
  client_secret: ENV["GLOBUS_CLIENT_SECRET"],
  uploads_directory: ENV["GLOBUS_UPLOADS_DIRECTORY"],
  transfer_endpoint_id: ENV["GLOBUS_ENDPOINT"]
)

user_id, path = *ARGV

# Test public API methods here.
GlobusClient.mkdir(user_id:, path:)

user_exists = GlobusClient.user_exists?(user_id)

# Not part of the public API but this allows us to test access changes
before_permissions = GlobusClient::Endpoint.new(GlobusClient.config, user_id:, path:).send(:access_rule)["permissions"]

files_count = GlobusClient.file_count(user_id:, path:)

total_size = GlobusClient.total_size(user_id:, path:)

GlobusClient.disallow_writes(user_id:, path:)

# Not part of the public API but this allows us to test access changes
after_permissions = GlobusClient::Endpoint.new(GlobusClient.config, user_id:, path:).send(:access_rule)["permissions"]

puts "User #{user_id} exists: #{user_exists}"
puts "Initial directory permissions: #{before_permissions}"
puts "Number of files in directory: #{files_count}"
puts "Total size of files in directory: #{total_size}"
puts "Final directory permissions: #{after_permissions}"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
globus_client-0.5.0 api_test.rb