
    qh                     *    S r SSKJr   " S S\5      rg)a  
GitLab OAuth2 backend, docs at:
    https://python-social-auth.readthedocs.io/en/latest/backends/gitlab.html

Thanks to [@saily](https://github.com/saily) who published an
implementation for GitLab support on his blog post [Weblate with
GitLab as OAuth provider](http://widerin.net/blog/weblate-gitlab-oauth-login/).
His code was a great reference when working on this implementation.
   )
BaseOAuth2c                   X    \ rS rSrSrSrSrSrSrSr	S/r
/ S	QrS
 rS rS rS rS rSrg)GitLabOAuth2   z#GitLab OAuth authentication backendgitlabzhttps://gitlab.comz"https://gitlab.com/oauth/authorizezhttps://gitlab.com/oauth/tokenF	read_user))idr	   )
expires_inexpires)refresh_tokenr   c                     U R                  S5      =(       d    U R                  nSR                  UR                  S5      U5      $ )NAPI_URLz{}{}/)settingr   formatrstrip)selfpathapi_urls      M/var/www/html/env/lib/python3.13/site-packages/social_core/backends/gitlab.pyr   GitLabOAuth2.api_url   s3    ,,y)9T\\}}W^^C0$77    c                 $    U R                  S5      $ )Nz/oauth/authorizer   r   s    r   authorization_urlGitLabOAuth2.authorization_url!   s    ||.//r   c                 $    U R                  S5      $ )Nz/oauth/tokenr   r   s    r   access_token_urlGitLabOAuth2.access_token_url$   s    ||N++r   c                     U R                  UR                  S5      5      u  p#nUR                  S5      UR                  S5      =(       d    SUUUS.$ )z'Return user details from GitLab accountnameusernameemail )r#   r$   fullname
first_name	last_name)get_user_namesget)r   responser&   r'   r(   s        r   get_user_detailsGitLabOAuth2.get_user_details'   sP    *.*=*=hll6>R*S'i Z0\\'*0b $"
 	
r   c                 D    U R                  U R                  S5      SU0S9$ )zLoads user data from servicez/api/v4/useraccess_token)params)get_jsonr   )r   r/   argskwargss       r   	user_dataGitLabOAuth2.user_data2   s+    }}LL(.,1O  
 	
r    N)__name__
__module____qualname____firstlineno____doc__r"   r   AUTHORIZATION_URLACCESS_TOKEN_URLREDIRECT_STATEDEFAULT_SCOPE
EXTRA_DATAr   r   r   r,   r4   __static_attributes__r6   r   r   r   r      sG    -D"G<7N MMJ80,	

r   r   N)r;   oauthr   r   r6   r   r   <module>rC      s    (
: (
r   