(token_data, bless_config)
Save the session credentials for this user, after the user has MFA'ed
    Args:
        token_data (dict): credentials returned from sts call
        bless_config (BlessConfig): Loaded BlessConfig
Save the session credentials for this user, after the user has MFA'ed
    Args:
        token_data (dict): credentials returned from sts call
        bless_config (BlessConfig): Loaded BlessConfig
Save the session credentials for this user after the user has MFA ed Args : token_data ( dict ) : credentials returned from sts call bless_config ( BlessConfig ) : Loaded BlessConfig
def save_cached_creds(token_data, bless_config):
    """ Save the session credentials for this user, after the user has MFA'ed
    Args:
        token_data (dict): credentials returned from sts call
        bless_config (BlessConfig): Loaded BlessConfig
    """
    client_config = bless_config.get_client_config()
    cachedir = os.path.join(
        os.getenv(
            'HOME',
            os.getcwd()),
        client_config['mfa_cache_dir'])
    if not os.path.exists(cachedir):
        os.makedirs(cachedir)

    cache_file_path = os.path.join(cachedir, client_config['mfa_cache_file'])
    _token_data = make_cachable_creds(token_data)
    with open(cache_file_path, 'w') as cache:
        json.dump(_token_data, cache)
def save_cached_creds ( token_data , bless_config ) : client_config = bless_config . get_client_config ( ) cachedir = os . path . join ( os . getenv ( 'HOME' , os . getcwd ( ) ) , client_config [ 'mfa_cache_dir' ] ) if not os . path . exists ( cachedir ) : os . makedirs ( cachedir ) cache_file_path = os . path . join ( cachedir , client_config [ 'mfa_cache_file' ] ) _token_data = make_cachable_creds ( token_data ) with open ( cache_file_path , 'w' ) as cache : json . dump ( _token_data , cache )