o
    tBh6	                     @   s@   d Z ddlZddlZddlZddlmZ dddZdddZdS )	zEHelper functions for loading data from a Google service account file.    N)cryptc                 C   sL   t |dur|ng }|t| }|rtdd|tj	| }|S )aY  Validates a dictionary containing Google service account data.

    Creates and returns a :class:`google.auth.crypt.Signer` instance from the
    private key specified in the data.

    Args:
        data (Mapping[str, str]): The service account data
        require (Sequence[str]): List of keys required to be present in the
            info.

    Returns:
        google.auth.crypt.Signer: A signer created from the private key in the
            service account file.

    Raises:
        ValueError: if the data was in the wrong format, or if one of the
            required keys is missing.
    NzGService account info was not in the expected format, missing fields {}.z, )
set
differencesixiterkeys
ValueErrorformatjoinr   	RSASignerfrom_service_account_info)datarequirekeys_neededmissingsigner r   x/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/google/auth/_service_account_info.py	from_dict   s   r   c                 C   sN   t j| ddd}t|}|t||dfW  d   S 1 s w   Y  dS )ax  Reads a Google service account JSON file and returns its parsed info.

    Args:
        filename (str): The path to the service account .json file.
        require (Sequence[str]): List of keys required to be present in the
            info.

    Returns:
        Tuple[ Mapping[str, str], google.auth.crypt.Signer ]: The verified
            info and a signer instance.
    rzutf-8)encoding)r   N)ioopenjsonloadr   )filenamer   	json_filer   r   r   r   from_filename<   s   
$r   )N)__doc__r   r   r   google.authr   r   r   r   r   r   r   <module>   s   
#