
    )Jf_                         d dl mZ d dlmZ d dlmZ d dlmZmZm	Z	 ddl
mZ  G d de          Z G d	 d
e          Z e	j        e          Z ej        e          ZdS )    )ElementTree)
ExpatError)OAuth)OAuthAdapterOAuthCallbackViewOAuthLoginView   )OpenStreetMapProviderc                       e Zd ZdZd ZdS )OpenStreetMapAPIz2https://api.openstreetmap.org/api/0.6/user/detailsc                 `   |                      | j                  }	 t          j        |                              d          }|j        }|                    d          }|/|                    d|j                            d          i           |S # t          t          t          f$ r Y d S w xY w)Nuserimgavatarhref)queryurlr   
fromstringfindattribupdategetr   KeyError
IndexError)selfraw_xmluser_element	user_infouser_avatars        v/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/allauth/socialaccount/providers/openstreetmap/views.pyget_user_infozOpenStreetMapAPI.get_user_info   s    **TX&&	&1'::??GGL$+I&++E22K&  (K,>,B,B6,J,J!KLLLHj1 	 	 	44	s   A5B B-,B-N)__name__
__module____qualname__r   r!        r    r   r      s(        
>C
 
 
 
 
r&   r   c                   .    e Zd Zej        ZdZdZdZd Z	dS )OpenStreetMapOAuthAdapterz1https://www.openstreetmap.org/oauth/request_tokenz0https://www.openstreetmap.org/oauth/access_tokenz-https://www.openstreetmap.org/oauth/authorizec                     t          ||j        |j        | j                  }|                                }|                                                     ||          S )N)r   	client_idsecretrequest_token_urlr!   get_providersociallogin_from_response)r   requestapptokenresponseclient
extra_datas          r    complete_loginz(OpenStreetMapOAuthAdapter.complete_login$   sV    !S]CJ0F
 
 ))++
  ""<<WjQQQr&   N)
r"   r#   r$   r
   idprovider_idr,   access_token_urlauthorize_urlr5   r%   r&   r    r(   r(      sA        '*KKICMR R R R Rr&   r(   N)	xml.etreer   xml.parsers.expatr   ,allauth.socialaccount.providers.oauth.clientr   +allauth.socialaccount.providers.oauth.viewsr   r   r   providerr
   r   r(   adapter_viewoauth_loginoauth_callbackr%   r&   r    <module>rB      s
   ! ! ! ! ! ! ( ( ( ( ( ( > > > > > >          , + + + + +    u    R R R R R R R R *n)*CDD/"/0IJJr&   