Expand description
By default, all settings are loaded from files located under your home directory in the
.qcs folder. Within that folder:
settings.tomlwill be used to load general settings (e.g. which URLs to connect to).secrets.tomlwill be used to load tokens for authentication.
Both files should contain profiles. Your settings should contain a default_profile_name
that determines which profile is loaded when no other profile is explicitly provided.
If you don’t have either of these files, see the QCS credentials guide for details on how to obtain them.
You can use environment variables to override values in your configuration:
SETTINGS_PATH_VAR: Set the path of thesettings.tomlfile to load.SECRETS_PATH_VAR: Set the path of thesecrets.tomlfile to load.SECRETS_READ_ONLY_VAR: Flag indicating whether to treat thesecrets.tomlfile as read-only. Disabled by default.- Access token updates will not be persisted to the secrets file, regardless of file permissions, for any of the following values (case insensitive): “true”, “yes”, “1”.
- Access token updates will be persisted to the secrets file if it is writeable for any other value or if unset.
PROFILE_NAME_VAR: Override the profile that is loaded by defaultQUILC_URL_VAR: Override the URL used for requests to the quilc server.QVM_URL_VAR: Override the URL used for requests to the QVM server.API_URL_VAR: Override the URL used for requests to the QCS REST API server.GRPC_API_URL_VAR: Override the URL used for requests to the QCS gRPC API.
The ClientConfiguration exposes an API for loading and accessing your
configuration.
Structs§
- Auth
Server - Okta authorization server.
- Client
Configuration - A configuration suitable for use as a QCS API Client.
- Client
Configuration Builder - Builder for
ClientConfiguration. - Client
Credentials - A pair of Client ID and Client Secret, used to request an OAuth Client Credentials Grant
- Externally
Managed - A struct that manages access tokens by utilizing a user-provided refresh function.
- OAuth
Session - Manages the
OAuth2authorization process and token lifecycle for accessing the QCS API. - Refresh
Token - A single type containing an access token and an associated refresh token.
- Token
Dispatcher - A wrapper for
OAuthSessionthat provides thread-safe access to the inner tokens.
Enums§
- Client
Configuration Builder Error - Error type for ClientConfigurationBuilder
- Config
Source - Describes how a
ClientConfigurationwas initialized. - Load
Error - Errors that can occur when loading a configuration.
- OAuth
Grant - Specifies the OAuth2 grant type to use, along with the data needed to request said grant type.
- Token
Error - Errors that can occur when managing authorization tokens.
Constants§
- API_
URL_ VAR - Setting this environment variable will override the URL used to connect to the QCS REST API.
- DEFAULT_
API_ URL - Default URL to access the QCS API.
- DEFAULT_
GRPC_ API_ URL - Default URL to access the gRPC API.
- DEFAULT_
PROFILE_ NAME - Default profile name.
- DEFAULT_
QUILC_ URL - Default URL to access
quilc. - DEFAULT_
QVM_ URL - Default URL to access QVM.
- DEFAULT_
SECRETS_ PATH - The default path that [
Secrets] will be loaded from - DEFAULT_
SETTINGS_ PATH - The default path that [
Settings] will be loaded from; - GRPC_
API_ URL_ VAR - Setting this environment variable will override the URL used to connect to the GRPC server.
- PROFILE_
NAME_ VAR - Setting this environment variable will change which profile is used from the loaded config files
- QUILC_
URL_ VAR - Setting this environment variable will override the URL used to access quilc.
- QVM_
URL_ VAR - Setting this environment variable will override the URL used to access the QVM.
- SECRETS_
PATH_ VAR - Setting the
QCS_SECRETS_FILE_PATHenvironment variable will change which file is used for loading secrets - SECRETS_
READ_ ONLY_ VAR QCS_SECRETS_READ_ONLYindicates whether to treat thesecrets.tomlfile as read-only. Disabled by default.- SETTINGS_
PATH_ VAR - Setting the
QCS_SETTINGS_FILE_PATHenvironment variable will change which file is used for loading [Settings].
Traits§
- Token
Refresher - Get and refresh access tokens
Type Aliases§
- Refresh
Function - A function that asynchronously refreshes a token.