iqm.iqm_client.cli.token_manager.refresh_tokens

Contents

iqm.iqm_client.cli.token_manager.refresh_tokens#

iqm.iqm_client.cli.token_manager.refresh_tokens(config: ConfigFile, current_tokens: dict, cycle: int) tuple[dict | None, bool, int]#

Request new tokens from auth server.

Parameters:
  • config (ConfigFile) – IQM Client CLI configuration

  • current_tokens (dict) – dict containing the current tokens from the tokens file

  • cycle (int) – refresh cycle length in seconds

Returns:

Tuple[Optional[dict], bool, int] = (tokens, status, sleep_time) tokens: dict containing new tokens or current tokens if auth server could not be connected or

None if auth server refused to provide new tokens.

status: bool, True if tokens were refreshed successfully, False otherwise sleep_time: time to sleep before next refresh attempt

Return type:

tuple[dict | None, bool, int]