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 Seven Bridges client applications and libraries require your Seven Bridges Platform credentials to authenticate.
Application or library name | Description |
---|---|
sevenbridges-python | sevenbridges-python is the official Seven Bridges -maintained Python bindings for the Seven Bridges API. |
sevenbridges-r | sevenbridges-r is the official Seven Bridges -maintained R bindings for the Seven Bridges API. |
Hierarchy of credentials
Using a unified configuration file is the preferred method for storing your Seven Bridges credentials. However, Seven Bridges 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
andSB_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 Seven Bridges 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 Seven Bridges 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://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://cgc-api.sbgenomics.com/v2
auth_token = 2cba934ad7094809bf1700cd80751745
[sbpla]
api_endpoint = https://api.sbgenomics.com/v2
auth_token = d7090174092cba934a485cd8075bf170
[sbpla-gcp]
api_endpoint = https://gcp-api.sbgenomics.com/v2
auth_token = 90d70172c409ba48934a5c750d80bf17
Note that each profile must have exactly one api_endpoint
and one auth-token
key with their corresponding values.
Updated about 2 years ago