
    &g                         d Z ddlZddlmZ dZdZdZdZdZd	Z	d
Z
dZdZdZdZdZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )z We use x-goog-api-client header to report metrics. This module provides
the constants and helper methods to construct x-goog-api-client header.
    N)versionzx-goog-api-clientzgoogle-byoid-sdkzauth-request-type/atzauth-request-type/itzauth-request-type/mdszauth-request-type/re-startzauth-request-type/re-contzcred-type/uzcred-type/sazcred-type/jwtzcred-type/mdszcred-type/impc                  d    d                     t          j                    t          j                  S )Nzgl-python/{} auth/{})formatplatformpython_versionr   __version__     E/var/www/api/venv/lib/python3.11/site-packages/google/auth/metrics.pypython_and_auth_lib_versionr   -   s$    !(()@)B)BGDWXXXr
   c                  \    d                     t                      t          t                    S Nz{} {} {})r   r   REQUEST_TYPE_ACCESS_TOKENCRED_TYPE_SA_MDSr	   r
   r   token_request_access_token_mdsr   5   s)    #%%'@BR  r
   c                  \    d                     t                      t          t                    S r   )r   r   REQUEST_TYPE_ID_TOKENr   r	   r
   r   token_request_id_token_mdsr   =   s)    #%%'<>N  r
   c                  \    d                     t                      t          t                    S r   )r   r   r   CRED_TYPE_SA_IMPERSONATEr	   r
   r   &token_request_access_token_impersonater   E   s)    #%%!   r
   c                  \    d                     t                      t          t                    S r   )r   r   r   r   r	   r
   r   "token_request_id_token_impersonater   O   s)    #%%'<>V  r
   c                  \    d                     t                      t          t                    S r   )r   r   r   CRED_TYPE_SA_ASSERTIONr	   r
   r   'token_request_access_token_sa_assertionr   X   s)    #%%'@BX  r
   c                  \    d                     t                      t          t                    S r   )r   r   r   r   r	   r
   r   #token_request_id_token_sa_assertionr   a   s)    #%%'<>T  r
   c                  P    d                     t                      t                    S N{} {})r   r   CRED_TYPE_USERr	   r
   r   token_request_userr#   i   s    >>577HHHr
   c                  P    d                     t                      t                    S r    )r   r   REQUEST_TYPE_MDS_PINGr	   r
   r   mds_pingr&   q   s    >>5779NOOOr
   c                  P    d                     t                      t                    S r    )r   r   REQUEST_TYPE_REAUTH_STARTr	   r
   r   reauth_startr)   w   s    >>5779RSSSr
   c                  P    d                     t                      t                    S r    )r   r   REQUEST_TYPE_REAUTH_CONTINUEr	   r
   r   reauth_continuer,   }   s    >>5779UVVVr
   c                     d                     t                      t                    }|                                 D ]\  }}d                     |||          }|S )Nr!   z{} {}/{})r   r   BYOID_HEADER_SECTIONitems)metrics_optionsheaderkeyvalues       r   byoid_metrics_headerr4      sZ    ^^799;OPPF%++-- 7 7
U""6366Mr
   c                 h    |sdS t           | vr|| t           <   dS | t           xx         d|z   z  cc<   dS )a  Add x-goog-api-client header with the given value.

    Args:
        headers (Mapping[str, str]): The headers to which we will add the
            metric header.
        metric_header_value (Optional[str]): If value is None, do nothing;
            if headers already has a x-goog-api-client header, append the value
            to the existing header; otherwise add a new x-goog-api-client
            header with the given value.
    N )API_CLIENT_HEADER)headersmetric_header_values     r   add_metric_headerr:      sV      ''%8!"""!"""c,?&??"""""r
   )__doc__r   google.authr   r7   r.   r   r   r%   r(   r+   r"   r   CRED_TYPE_SA_JWTr   r   r   r   r   r   r   r   r   r#   r&   r)   r,   r4   r:   r	   r
   r   <module>r>      s\           (  *  3 . / 8 :  ' " " * Y Y Y            I I IP P PT T TW W W  @ @ @ @ @r
   