ó
    ychÎ  ã                   ób   • S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  SSK
JrJr   " S S\5      rg	)
z¯
oauthlib.oauth2.rfc8628
~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 Device Authorization RFC8628.
é    )Úadd_params_to_uri)ÚBackendApplicationClientÚClient)ÚInsecureTransportError)Úprepare_token_request)Úis_secure_transportÚlist_to_scopec                   óH   ^ • \ rS rSrSrSrU 4S jrSS jr  S	S jrSr	U =r
$ )
ÚDeviceClienté   aÂ  A public client utilizing the device authorization workflow.

The client can request an access token using a device code and
a public client id associated with the device code as defined
in RFC8628.

The device authorization grant type can be used to obtain both
access tokens and refresh tokens and is intended to be used in
a scenario where the device being authorized does not have a
user interface that is suitable for performing authentication.
z,urn:ietf:params:oauth:grant-type:device_codec                 óT   >• [         TU ]  " U40 UD6  UR                  S5      U l        g )NÚclient_secret)ÚsuperÚ__init__Úgetr   )ÚselfÚ	client_idÚkwargsÚ	__class__s      €Úo/var/www/djangovue.mamus.xyz/django/venv/lib/python3.13/site-packages/oauthlib/oauth2/rfc8628/clients/device.pyr   ÚDeviceClient.__init__   s&   ø€ Ü‰Ò˜Ñ- fÒ-Ø#ŸZ™Z¨Ó8ˆÕó    c                 ó¼  • [        U5      (       d
  [        5       eUc  U R                  OUnSU R                  4SU R                  4/nU R
                  b  UR                  SU R
                  45        U(       a  UR                  S[        U5      45        UR                  5        H*  u  pVU(       d  M  UR                  [        U5      U45        M,     [        X5      $ )Nr   Ú
grant_typer   Úscope)r   r   r   r   r   r   Úappendr	   ÚitemsÚstrr   )r   Úurir   r   ÚparamsÚkÚvs          r   Úprepare_request_uriÚ DeviceClient.prepare_request_uri#   sµ   € Ü" 3×'Ñ'Ü(Ó*Ð*à#™m�—
’
°ˆØ §¡Ð0°\À4Ç?Á?Ð4SÐUˆà×ÑÑ)Ø�M‰M˜?¨D×,>Ñ,>Ð?Ô@æØ�M‰M˜7¤M°%Ó$8Ð9Ô:à—<‘<–>‰CˆAßˆqØ—‘œs 1›v q˜kÖ*ñ "ô ! Ó-Ð-r   c                 ó|   • U R                   US'   XES'   Uc  U R                  OUn[        U R                  4X!US.UD6$ )aò  Add device_code to request body

The client makes a request to the token endpoint by adding the
device_code as a parameter using the
"application/x-www-form-urlencoded" format to the HTTP request
body.

:param body: Existing request body (URL encoded string) to embed parameters
             into. This may contain extra parameters. Default ''.
:param scope:   The scope of the access request as described by
                `Section 3.3`_.

:param include_client_id: `True` to send the `client_id` in the
                          body of the upstream request. This is required
                          if the client is not authenticating with the
                          authorization server as described in
                          `Section 3.2.1`_. False otherwise (default).
:type include_client_id: Boolean

:param kwargs:  Extra credentials to include in the token request.

The prepared body will include all provided device_code as well as
the ``grant_type`` parameter set to
``urn:ietf:params:oauth:grant-type:device_code``::

    >>> from oauthlib.oauth2 import DeviceClient
    >>> client = DeviceClient('your_id', 'your_code')
    >>> client.prepare_request_body(scope=['hello', 'world'])
    'grant_type=urn:ietf:params:oauth:grant-type:device_code&scope=hello+world'

.. _`Section 3.2.1`: https://datatracker.ietf.org/doc/html/rfc6749#section-3.2.1
.. _`Section 3.3`: https://datatracker.ietf.org/doc/html/rfc6749#section-3.3
.. _`Section 3.4`: https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
r   Úinclude_client_id)ÚbodyÚdevice_coder   )r   r   r   r   )r   r(   r'   r   r&   r   s         r   Úprepare_request_bodyÚ!DeviceClient.prepare_request_body6   sP   € ðJ #Ÿn™nˆˆ{ÑØ&7Ð"Ñ#Ø#™m�—
’
°ˆÜ$ T§_¡_ð <¸4Ø+0ñ<Ø4:ñ<ð 	<r   )r   )N)Ú NF)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r#   r)   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      s.   ø† ñ
ð @€Jõ9ô.ð& @DØ/4÷)<ò )<r   r   N)r0   Úoauthlib.commonr   Úoauthlib.oauth2r   r   Úoauthlib.oauth2.rfc6749.errorsr   Ú"oauthlib.oauth2.rfc6749.parametersr   Úoauthlib.oauth2.rfc6749.utilsr   r	   r   © r   r   Ú<module>r9      s)   ðñõ .ß <Ý AÝ Dß LôP<�6õ P<r   