HeliosSession¶
Manager for the authorization token required to access the Helios API.
-
class
helios.core.session.
Authentication
(client_id, client_secret, api_url=None)[source]¶ Authentication API.
Parameters: - client_id (str) – API key ID.
- client_secret (str) – API key secret.
- api_url (str) – Override the default API URL.
-
class
helios.core.session.
HeliosSession
(client_id=None, client_secret=None, api_url=None, base_directory=None, max_threads=64, token_expiration_threshold=60, ssl_verify=True)[source]¶ Manages configuration and authentication details for the Helios APIs.
The session will handle acquiring and verifying tokens as well as various developer options.
Parameters: - client_id (str, optional) – API key ID.
- client_secret (str, optional) – API key secret.
- api_url (str, optional) – Override the default API URL.
- base_directory (str, optional) – Override the base directory for storage of tokens and credentials.json file.
- max_threads (int, optional) – The maximum number of threads allowed for batch calls.
- token_expiration_threshold (int, optional) – The number of minutes to allow before token expiration. E.g. if the token will expire in 29 minutes and the threshold is set to 30, a new token will be acquired because expiration time is below the threshold.
- ssl_verify (bool, optional) – Use SSL verification for all HTTP requests. Defaults to True.
-
auth_header
¶ Authentication header for API requests.
-
client
(name)[source]¶ Gets a core API instance using the current HeliosSession.
Parameters: name (str) – Name of API. Returns: Core API instance.
-
class
helios.core.session.
Token
(access_token, expires_in=None, **kwargs)[source]¶ Helios token.
Parameters: - access_token (str) – Access token.
- expires_in (int) – Seconds until expiration. WARNING: this value can be misleading. If reading from a token file the value will not be current.
- kwargs – Any other optional token attributes.
-
auth_header
¶ Authentication header for API requests.
-
expiration
¶ The expiration time.
-
expired
¶ True if token is expired, False otherwise.