
    &g                      B    d Z ddlZddlZddlmZ ddlmZ ddZddZdS )	zEHelper functions for loading data from a Google service account file.    N)crypt)
exceptionsTc                 t   t          ||ng           }|                    |                                           }|r:t          j        d                    d                    |                              |r t          j        	                    |           }nt          j
        	                    |           }|S )a  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.
        use_rsa_signer (Optional[bool]): Whether to use RSA signer or EC signer.
            We use RSA signer by default.

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

    Raises:
        MalformedError: 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keysr   MalformedErrorformatjoinr   	RSASignerfrom_service_account_infoES256Signer)datarequireuse_rsa_signerkeys_neededmissingsigners         S/var/www/api/venv/lib/python3.11/site-packages/google/auth/_service_account_info.py	from_dictr      s    * !4gg"==K$$TYY[[11G 
'		' 2 233
 
 	
  C::4@@"<<TBBM    c                     t          j        | dd          5 }t          j        |          }|t	          |||          fcddd           S # 1 swxY w Y   dS )a  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.
        use_rsa_signer (Optional[bool]): Whether to use RSA signer or EC signer.
            We use RSA signer by default.

    Returns:
        Tuple[ Mapping[str, str], google.auth.crypt.Signer ]: The verified
            info and a signer instance.
    rzutf-8)encoding)r   r   N)ioopenjsonloadr   )filenamer   r   	json_filer   s        r   from_filenamer!   @   s     
3	1	1	1 UYy##YtW^TTTTU U U U U U U U U U U U U U U U U Us   (AAA)NT)__doc__r   r   google.authr   r   r   r!    r   r   <module>r%      s}    L K 				        " " " " " "% % % %PU U U U U Ur   