Token Generation

Usage and examples for astokengen

Overview

A token authorizes the download of one or more files, or an upload of one or more files into a directory (called destination root). It supports the traditional “cp” paradigm of ascp (copy file1, file2, file3 to directory) or source/destination pairs (ascp --file-pair-list).

Functionality

Usage

  1. astokengen --mode=send [OPTS] -u USER --dest=PATH [-v TOKEN]  
  2. astokengen --mode=send [OPTS] -u USER --file-pair-list=FILENAME --dest=DEST [-v TOKEN]  
  3. astokengen --mode=recv [OPTS] -u USER -p PATH [-p PATH …] [-v TOKEN]  
  4. astokengen --mode=recv [OPTS] -u USER --file-list=FILENAME [-v TOKEN]  
  5. astokengen --mode=recv [OPTS] -u USER --file-pair-list=FILENAME [-v TOKEN]  
  6. astokengen -t TOKEN [OPTS]

Option (short form) Option (long form) Description
-A --version Print version information.
  --mode=MODE Direction of the transfer mode (send | recv)
-p --path=PATH Source path
  --dest=DEST Destination path
-u --user=USER Generate the token for this user name. This name is embedded in the token and also used to retrieve further information from aspera.conf (user_value and token_life_seconds).
  --file-list=FILE Specifies a file name that contains a list of sources for a download token. Each line of the file contains a single source and blank lines are ignored.
  --file-pair-list=FILE Specifies a file name that contains a multiplexed list of source and destination pairs for an upload or download token. Each pair of lines encodes one source and one destination and blank lines are ignored.
-v TOKEN   Verify token against user and path parameters.
-t TOKEN   Display the contents of the token.
-k PASSPHRASE   Passphrase to decrypt token. For use with -t.
-b   Assume user name and paths are encoded in base64.

Examples

Description Example
Example file list
/monday/first_thing.txt
/monday/next_thing.txt  
/monday/last_thing.txt  
Example file-pair list
/monday/first_thing.txt
/archive/monday/texts/first_thing  
/monday/next_thing.txt  
/archive/monday/texts/next_thing  
/monday/last_thing.txt  
/archive/monday/texts/last_thing  
Common upload

In a common upload, only the destination is encoded into the token.

astokengen --user=USER --dest=PATH --mode=send

The destination is encoded into the token. Source paths are not allowed and will cause astokengen to fail. --path and --file-list are illegal in this case.

Paired upload

The destination is pre-pended to each of the destinations in the paired list file and they are all encoded into the token. The destinations are in each odd numbered line of the file (1, 3, 5, 7, etc).

astokengen --user=USER --dest=PATH --file-pair-list=FILENAME --mode=send  

--path and --file-list are illegal in this case.

Common download

The specified paths are encoded into the token.

astokengen --user=USER --path=FILE1 --path=FILE2 --mode=recv  
astokengen --user=USER --file-list=FILENAME --mode=recv  

--dest and --file-pair-list are illegal in this case.

Paired download

The source files from the pair list are encoded in the token. The sources are in each even numbered line of the file (0, 2, 4, 6, 8, etc.).

astokengen --user=USER --file-pair-list=FILENAME --mode=recv  
--dest, --path and --file-list are illegal in this case.