Module configuration

Module configuration 

Source
Expand description

By default, all settings are loaded from files located under your home directory in the .qcs folder. Within that folder:

  • settings.toml will be used to load general settings (e.g. which URLs to connect to).
  • secrets.toml will 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 the settings.toml file to load.
  • [SECRETS_PATH_VAR]: Set the path of the secrets.toml file to load.
  • [SECRETS_READ_ONLY_VAR]: Flag indicating whether to treat the secrets.toml file 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 default
  • QUILC_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.

Modules§

secrets
Models and utilities for managing QCS secret credentials.
settings
Models and utilities for managing QCS settings.
tokens
Models and utilities for managing OAuth2 sessions.

Structs§

ClientConfiguration
A configuration suitable for use as a QCS API Client.
ClientConfigurationBuilder
Builder for ClientConfiguration.

Enums§

ClientConfigurationBuilderError
Error type for ClientConfigurationBuilder
ConfigSource
Describes how a ClientConfiguration was initialized.
LoadError
Errors that can occur when loading a configuration.
TokenError
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.
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.