Skip to content

clemsonciti/globus-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Globus HTTP CLI Client

This program impliments a subset of the Globus API for HTTP access to collections. It currently supports upload and download to Globus Guest Collections.

Usage

A configuration file (config.toml) should be generated before use. See the Configuration section.

Globus HTTP URLs

There are a few ways to determin the Collection's HTTPS base URL. The easiest is to browse to the collection in the file browser, then select the "Get Link" button.

Download

globus-http download <source-url> <destination-filename>

For example:

globus-http download https://g-123456.12345.1234.data.globus.org/filename.txt filename.txt

Upload

globus-http upload <source-filename> <destination-url>

For example:

globus-http upload filename.txt https://g-123456.12345.1234.data.globus.org/filename.txt 

Configuration

This client needs some configuration values that are read from a TOML file. By default, it will read from a config.toml file in the current directory, but you can change the path using the -config <filename> option. The configuration file should have the client ID, secret and needed scopes. Sample file:

# ClientID and ClientSecret are Globus Auth client credentials (see the
# Client Credentials section in the readme).
ClientID = "f1a33410-8df7-4df4-b112-a3b77f83b6e6"
ClientSecret = "secret"

# Scopes dictate which collection this client should access.
# For guest collections, the format is:
#   https://auth.globus.org/scopes/<collection-uuid>/https
#
Scopes = [
    "https://auth.globus.org/scopes/d5f73dee-4c7e-4d9e-9731-6439a5b82332/https",
    "https://auth.globus.org/scopes/2a18f093-13e6-467d-91b3-0b1b58f3b18c/https",
]

Client Credentials

Currently the client_credentials option is supported for authentication. To generate credentials:

  1. Go to the Globus developers page.
  2. Select Register an App -> "Advanced registration".
  3. Select a Project, or specify create a new project. If creating a new project, enter project name, contact email, and project admins.
  4. Provide an App name.
  5. Leave Redirects, Required Identity, Pre-selected Identity Provider, Use effective identity, and Prompt for Named Grant, empty and unchecked.
  6. Click register app.
  7. The ClientID needed in the configuration file (see section above) is the Client UUID.
  8. Click Add Client Secret. Record the provided client secret in the configuration file. See the section above.

Granting the client access to a guest collection

Before the client can access a guest collection, you need to grant it access to the desired [Guest Collection]((https://docs.globus.org/guides/tutorials/manage-files/share-files/).

Once you've created a guest collection and client credentials, select Add Permissions on the guest collection and share with <client-id>@clients.auth.globus.org (e.g. f1a33410-8df7-4df4-b112-a3b77f83b6e6@clients.auth.globus.org). You can select read and/or write as appropriate.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages