This module provides a
Credentials class to be used for authentication.
A credentials object can be created from a
credentials.properties file obtained
from the HERE platform portal or from environment variables.
- class xyzspaces.iml.credentials.Credentials(cred_properties)¶
Credentials provides functions for dealing with the HERE platform Credentials.
Credentials can be read from the following locations:
The default location: “~/.here/credentials.properties”
A custom path to a credentials properties file
cred_properties (pyhocon.config_tree.ConfigTree) –
Instantiate the credentials object.
cred_properties (pyhocon.config_tree.ConfigTree) – the properties of Credentials.
- classmethod from_default()¶
Return the credentials object from the default default credential path at ‘~/.here/credentials.properties’.
If environmental variables are set, these values will override the ones found in the default file.
If no default file is found, this method will try to read the credentials from the environmental variables.
- Return type
- classmethod from_credentials_file(path)¶
Return the credentials object from a specified credentials path.
- classmethod from_env()¶
Return the credentials object from the following environment variables:
Patch the credentials by reading the following environment variables and applying them accordingly.
Whenever such an environment variable is set, it overrides the one loaded from file.