Config
The config
parameter can be used to provide a dictionary containing the project configuration like user and password for basic auth or a bearer token.
Basic auth
The format of the dictionary for basic auth must be as this:
OAuth token
The format of the dictionary for bearer token must be as this:
Set manually credentials
In case you try to get a project without from the backend with invalid credentials, an exception will be raised.
Because the backend client is a Singleton object, it will autoconfigure credentials at startup, so the only way to setup proper credentials once it fails to connect is to use the SDK method set_dhcore_env()
.
set_dhcore_env
Function to set environment variables for DHCore config. Note that if the environment variable is already set, it will be overwritten. It also ovverides the remote client configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
endpoint
|
str
|
The endpoint of DHCore. |
None
|
user
|
str
|
The user of DHCore. |
None
|
password
|
str
|
The password of DHCore. |
None
|
access_token
|
str
|
The access token of DHCore. |
None
|
refresh_token
|
str
|
The refresh token of DHCore. |
None
|
client_id
|
str
|
The client id of DHCore. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Example:
Note that the set_dhcore_env()
method ovverrides the environment variables and (if already instantiated) the credentials attributes of the backend client.