Authentication
flow_it_api.auth
Authentication management for the FlowIt VMC API.
Classes
Authenticator
Handles JWT authentication and token lifecycle.
Source code in src/flow_it_api/auth.py
Attributes
token
property
Return the current token if it is still valid.
:return: Token string or None if expired or not set.
Methods:
__init__(host, password, username=DEFAULT_USERNAME, client=None)
Initialize the authenticator.
:param host: Base URL of the VMC machine. :param password: API password. :param username: API username. :param client: Optional existing HTTPX async client.
Source code in src/flow_it_api/auth.py
get_valid_token()
async
Return a valid token, logging in if necessary.
:return: Valid JWT token string.
invalidate_token()
login()
async
Login to the device and return the JWT token.
:return: JWT token string. :raises FlowItAuthError: If credentials are invalid. :raises FlowItConnectionError: If connection fails.