Store credentials to access Seven Bridges client applications and libraries

Overview

Seven Bridges maintains client applications and libraries which require authentication. Instead of storing your credentials separately for each client application or client library, use a unified configuration file to securely maintain your credentials and authenticate. On this page, learn about Seven Bridges client applications and libraries which require authentication, how applications and libraries check for credentials, and about using a unified configuration file.

Seven Bridges client applications and libraries

The following client applications and libraries require your Cavatica credentials to authenticate.

Application or library nameDescription
sevenbridges-pythonsevenbridges-python is the official Seven Bridges-maintained Python library for the Seven Bridges API.
sevenbridges-rsevenbridges-r is the official Seven Bridges -maintained R library for the Seven Bridges API.
sevenbridges-javasevenbridges-java is the official Seven Bridges -maintained Java library for the Seven Bridges API.
Seven Bridges Command Line InterfaceSeven Bridges Command Line Interface is the official Seven Bridges-maintained command line client for the Seven Bridges API.
SBFSSBFS is a command line tool which enables interaction with Platform project files that are mounted as a local file system.

Hierarchy of credentials

Using a unified configuration file is the preferred method for storing your Cavatica credentials. However, the client applications and libraries will check for your credentials in the following order:

  • Explicit parameters passed during initialization
  • Environmental variables available on an OS level which are defined by users. Credentials can be stored using using the following environmental variables: SB_API_ENDPOINT and SB_AUTH_TOKEN.
  • Unified configuration file which stores your credentials for all Seven Bridges client applications and libraries. This is the preferred method for storing your credentials. Learn more about the unified configuration file below.
  • Application or library-specific configuration file which stores your credentials for a specific client application or library.

Note that the previously used configuration file (such as .sbgrc or .sbg.auth.yml) is no longer supported by sevenbridges-r starting from version 1.5.5 and sevenbridges-python starting from version 0.7.0.

Unified configuration file

Use a unified configuration file to store all of your credentials for client applications and libraries. The configuration file, credentials, is a INI-like file stored in a directory named .sevenbridges underneath your home directory. This location varies across operating systems, but would typically be:

  • (for Linux and Mac OS X) $HOME/.sevenbridges/credentials
  • (for MS Windows) %UserProfile%\.sevenbridges\credentials

The credentials configuration file should contain key-value pairs of the following form:

api_endpoint = https://cavatica-api.sbgenomics.com/v2
auth_token = 2cba934ad7094809bf1700cd80751745

The above key-value pairs comprise one profile. Each profile's name precedes the relevant key-value pairs and is enclosed in brackets. The credentials file can consist of multiple profiles, as shown below. For instance, users may have multiple accounts on the same environment:

[default]
api_endpoint = https://api.sbgenomics.com/v2
auth_token = 2cba934ad7094809bf1700cd80751745

[cavatica]
api_endpoint = https://cavatica-api.sbgenomics.com/v2
auth_token = d7090174092cba934a485cd8075bf170

Note that each profile must have exactly one api_endpoint and one auth-token key with their corresponding values.