
    k7i0                     0    S SK Jr  S SKJr   " S S5      rg)    )	to_native)OAuth2Errorc                       \ rS rSrSrSr0 rSr\r	      SS jr
\S 5       r\R                  S 5       rS rS rS	 rS
 rSrg)AssertionClient   zConstructs a new Assertion Framework for OAuth 2.0 Authorization Grants
per RFC7521_.

.. _RFC7521: https://tools.ietf.org/html/rfc7521
Nc                     Xl         Uc  UnX l        Uc  U R                  nX`l        X0l        X@l        XPl        Xpl        Xl        U R                  b  U R                  S X5      U l
        Xl        Xl        g N)sessiontoken_endpointDEFAULT_GRANT_TYPE
grant_typeissuersubjectaudienceclaimsscopetoken_auth_class
token_auth_kwargsleeway)selfr
   r   r   r   r   r   r   token_placementr   r   kwargss               W/home/james-whalen/.local/lib/python3.13/site-packages/authlib/oauth2/rfc7521/client.py__init__AssertionClient.__init__   su     %H,00J$  
  ,"33D/PDO    c                 .    U R                   R                  $ r	   )r   tokenr   s    r   r   AssertionClient.token6   s    $$$r   c                 :    U R                   R                  U5        g r	   )r   	set_token)r   r   s     r   r   r!   :   s    !!%(r   c                 D   U R                   U R                     nU" SU R                  U R                  U R                  U R
                  S.U R                  D6n[        U5      U R                  S.nU R                  (       a  U R                  US'   U R                  U5      $ )zUsing Assertions as Authorization Grants to refresh token as
described in `Section 4.1`_.

.. _`Section 4.1`: https://tools.ietf.org/html/rfc7521#section-4.1
)r   r   r   r   )	assertionr   r    )
ASSERTION_METHODSr   r   r   r   r   r   r   r   _refresh_token)r   generate_assertionr%   datas       r   refresh_tokenAssertionClient.refresh_token>   s     "33DOOD& 
;;LL]];;	

 ll
	 #9-//
 :: JJDM""4((r   c                     UR                   S:  a  UR                  5         UR                  5       nSU;   a"  U R                  US   UR	                  S5      S9eX l        U R
                  $ )Ni  errorerror_description)r.   description)status_coderaise_for_statusjsonoauth_error_classgetr   )r   respr   s      r   parse_response_token$AssertionClient.parse_response_tokenU   sk    s"!!#		e((Gn%))<O2P )   
zzr   c                 p    U R                   R                  SU R                  USS9nU R                  U5      $ )NPOSTT)r*   withhold_token)r
   requestr   r7   )r   r*   r6   s      r   r(   AssertionClient._refresh_tokenb   s=    ||##D''d4 $ 
 ((..r   c                 ,    U R                   (       a  U ? g g r	   )r
   r    s    r   __del__AssertionClient.__del__i   s    << r   )r   r   r   r   r   r   r   r
   r   r   r   r   )NNNheaderN<   )__name__
__module____qualname____firstlineno____doc__r   r'   r   r   r4   r   propertyr   setterr+   r7   r(   r?   __static_attributes__r&   r   r   r   r      s{     #  #J % % \\) ))./r   r   N)authlib.common.encodingr   authlib.oauth2.baser   r   r&   r   r   <module>rM      s    - +f fr   