carlogtt_python_library.amazon_internal.midway module

This module …

class carlogtt_python_library.amazon_internal.midway.MidwayUtils[source]

Bases: object

A handler class for Midway utilities.

cli_midway_auth(max_retries: int = 3, options: str = '-s')[source]

Run mwinit -s as bash command.

Parameters:
  • max_retries – The maximum number of total attempts. Default is 3.

  • options – The options to pass to the mwinit command. Default is -s

Returns:

None

extract_valid_cookies(cookie_filepath: str = '~/.midway/cookie') dict[str, str][source]

Retrieves valid cookies from a specified cookie file, filtering based on cookie that start with #Http and valid cookie expiration time. Return a dictionary of cookie names and their values.

Parameters:

cookie_filepath – The file path to the cookie file. Defaults to “~/.midway/cookie”.

Returns:

A dictionary where each key-value pair corresponds to a cookie name and its value extracted from the file.