This document describes the information needed by a client to be able to establish a connection to a Volt, how that information is persisted in a configuration file by the tdx Volt client libraries, and how to use a client configuration file to establish a connection to a tdx Volt using the tdx Volt CLI.
Create a client connection
The easiest way to obtain a connection configuration is to use the cli ‘auth’ command.
Note this will create a new identity and client configuration on the target Volt, if you want to obtain the configuration for an existing identity, see below.
Obtain a client connection
If you have a connection to the target tdx Volt configured in the fusebox, you can use this to quickly obtain a client configuration file.
Select the identity you want to use for the client in the Explorer pane on the left side of the fusebox. Then use the ‘copy to clipboard’ button next to the ‘client configuration’ detail in the right-hand panel, as highlighted in the image below:
Client connection information
Two pieces of information are required for a client to be able to connect to a tdx Volt to access resources or services:
The client credentials. The client credentials identify the client. As far as the target tdx Volt is
concerned, this is primarily made up of the client’s public key. However, in order to be able to prove possession of the key to the target Volt, the private key will be required by the client library to initiate the TLS handshake or sign a JWT. The client credentials are stored in the credential property, described below.
The target tdx Volt configuration. The tdx Volt configuration identifies the target Volt. It includes a unique identitifier (DID), address and public key. See the
Volt configuration reference section for a full description and details of how to obtain a tdx Volt configuration. The Volt configuration is stored in the volt property, described below.
Note that only the public portion of the client key is sent to the Volt, the private key is never seen by the Volt.
The basic structure of a client configuration is shown below:
Client configuration file
All the current tdx Volt client libraries support using a file to store a client configuration in the
JSON format described here.
It is not obligatory for clients or applications to use this format. The configuration details can be specified
as a plain object and stored in whatever method suits.
Populating the client key
Note that unless the full client key is stored in the tdx Volt, it will be necessary to manually populate the key property of the JSON that is copied to the clipboard using the method described above.
The example below shows the configuration copied from an identity that doesn’t have the key stored in the tdx Volt. As you can see, the key property has a placeholder (<**** INSERT PEM-FORMAT KEY HERE ****>) that must be replaced with the actual PEM-format private key corresponding to this client.
Test the connection
Assuming you have created a client configuration file, you can now use it to connect to a Volt.
We can use the Volt CLI to issue a request to the Volt. Here we ask the tdx Volt to list all the resources in the clients ‘Home’ folder (indicated by ’.’). This may yield no results if you have only just bound to the Volt.
Now try uploading a file to the home folder.
And then list the resources again:
The tdx Volt CLI will look for a client configuration file named `volt.config.json` if none is specified on the command line. So if you use this name to store your configuration details there is no need to specify the `-c client.config.json` parameter.
Relay connections
The discussion so far has related to peer-to-peer connections. However in many scenarios it will be necessary to connect to a Volt that is not on the same local network as the client, and may not be accessible via the wider internet because it is behind a firewall.
In order to be able to connect to remote Volts in these scenarios you can utilise the concept of a Relay Volt, which is described in more detail here.
The first step is to establish the configuration of the Relay Volt you would like to use.
It is then a case of adding another Volt configuration object describing the Relay Volt as a sub-property of the target volt configuration. This relay property takes the same format as the standard Volt configuration:
The addition of the `relay` property is the only addition that is required to a standard client configuration to force the client libraries to connect via a Relay Volt. However if the configuration has previously been used to bind locally, it may be necessary to delete the `credential.cert` property to force the client library to initialise the Relay parameters correctly.
Appendix
Client configuration definition
The JSONSchema definition of the Volt client configuration object is shown below.
Note that the client_name and crytpo properties describe the client and its credentials, and the remainder of the
document (the volt property) is simply an instance of a tdx Voltconfiguration object.