Ë
    cQbj  ã                   ó˜   — d dl Z d dlmZmZ d dlmZ d dlmZ  G d„ dee«      Z	 G d„ dee«      Z
 G d	„ d
«      Z G d„ d«      Zd„ Zd„ Zy)é    N)Úurlsafe_b64decodeÚurlsafe_b64encode)ÚEnum)ÚAnyc                   ó   — e Zd ZdZdZdZy)ÚProtocolz/Protocol to communicate with the authenticator.Úctap2z	ctap1/u2fN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚCTAP2ÚU2F© ó    úb/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/common/virtual_authenticator.pyr   r      s   „ Ù9à€EØ
�Cr   r   c                   ó    — e Zd ZdZdZdZdZdZy)Ú	Transportz7Transport method to communicate with the authenticator.ÚbleÚusbÚnfcÚinternalN)r
   r   r   r   ÚBLEÚUSBÚNFCÚINTERNALr   r   r   r   r      s   „ ÙAà
€CØ
€CØ
€CØ�Hr   r   c                   óŠ   — e Zd ZeZeZej
                  ej                  ddddfdedededededed	d
fd„Z	d	e
eeez  f   fd„Zy
)ÚVirtualAuthenticatorOptionsFTÚprotocolÚ	transportÚhas_resident_keyÚhas_user_verificationÚis_user_consentingÚis_user_verifiedÚreturnNc                 óX   — || _         || _        || _        || _        || _        || _        y)zMConstructor.

        Initialize VirtualAuthenticatorOptions object.
        N©r   r    r!   r"   r#   r$   )Úselfr   r    r!   r"   r#   r$   s          r   Ú__init__z$VirtualAuthenticatorOptions.__init__.   s2   € ð &ˆŒØ'ˆŒØ&6ˆÔØ+@ˆÔ"Ø(:ˆÔØ&6ˆÕr   c                 óŒ   — | j                   | j                  | j                  | j                  | j                  | j
                  dœS )N)r   r    ÚhasResidentKeyÚhasUserVerificationÚisUserConsentingÚisUserVerifiedr'   ©r(   s    r   Úto_dictz#VirtualAuthenticatorOptions.to_dictB   s>   € àŸ™ØŸ™Ø"×3Ñ3Ø#'×#=Ñ#=Ø $× 7Ñ 7Ø"×3Ñ3ñ
ð 	
r   )r
   r   r   r   r   r   r   ÚstrÚboolr)   Údictr0   r   r   r   r   r   (   sŒ   „ ð €HØ€Ið !Ÿ™Ø"Ÿ™Ø!&Ø&+Ø#'Ø!&ñ7àð7ð ð7ð ð	7ð
  $ð7ð !ð7ð ð7ð 
ó7ð(
˜˜c 3¨¡:˜oÑ.ô 
r   r   c                   ód  — e Zd Zdedededz  dedz  dedefd„Zed	efd
„«       Z	ed	efd„«       Z
ed	edz  fd„«       Zed	edz  fd„«       Zed	efd„«       Zed	efd„«       Zededededed	d f
d„«       Zededededz  deded	d fd„«       Zd	eeef   fd„Zedeeef   d	d fd„«       Zd	efd„Zy)Ú
CredentialÚcredential_idÚis_resident_credentialÚrp_idNÚuser_handleÚprivate_keyÚ
sign_countc                 óX   — || _         || _        || _        || _        || _        || _        y)af  Constructor. A credential stored in a virtual authenticator.

        https://w3c.github.io/webauthn/#credential-parameters.

        Args:
            credential_id (bytes): Unique base64 encoded string.
            is_resident_credential (bool): Whether the credential is client-side discoverable.
            rp_id (str): Relying party identifier.
            user_handle (bytes): userHandle associated to the credential. Must be Base64 encoded string. Can be None.
            private_key (bytes): Base64 encoded PKCS#8 private key.
            sign_count (int): initial value for a signature counter.
        N)Ú_idÚ_is_resident_credentialÚ_rp_idÚ_user_handleÚ_private_keyÚ_sign_count)r(   r6   r7   r8   r9   r:   r;   s          r   r)   zCredential.__init__N   s2   € ð* !ˆŒØ'=ˆÔ$ØˆŒØ'ˆÔØ'ˆÔØ%ˆÕr   r%   c                 óH   — t        | j                  «      j                  «       S ©N)r   r=   Údecoder/   s    r   ÚidzCredential.idj   s   € ä  §¡Ó*×1Ñ1Ó3Ð3r   c                 ó   — | j                   S rD   )r>   r/   s    r   r7   z!Credential.is_resident_credentialn   s   € à×+Ñ+Ð+r   c                 ó   — | j                   S rD   )r?   r/   s    r   r8   zCredential.rp_idr   s   € à�{‰{Ðr   c                 ób   — | j                   r#t        | j                   «      j                  «       S y rD   )r@   r   rE   r/   s    r   r9   zCredential.user_handlev   s(   € à×ÒÜ$ T×%6Ñ%6Ó7×>Ñ>Ó@Ð@Ør   c                 óH   — t        | j                  «      j                  «       S rD   )r   rA   rE   r/   s    r   r:   zCredential.private_key|   s   € ä  ×!2Ñ!2Ó3×:Ñ:Ó<Ð<r   c                 ó   — | j                   S rD   )rB   r/   s    r   r;   zCredential.sign_count€   s   € à×ÑÐr   rF   c                 ó   —  | |d|d||«      S )as  Creates a non-resident (i.e. stateless) credential.

        Args:
            id (bytes): Unique base64 encoded string.
            rp_id (str): Relying party identifier.
            private_key (bytes): Base64 encoded PKCS
            sign_count (int): initial value for a signature counter.

        Returns:
            Credential: A non-resident credential.
        FNr   )ÚclsrF   r8   r:   r;   s        r   Úcreate_non_resident_credentialz)Credential.create_non_resident_credential„   s   € ñ �2�u˜e T¨;¸
ÓCÐCr   c                 ó   —  | |d||||«      S )aÓ  Creates a resident (i.e. stateful) credential.

        Args:
            id (bytes): Unique base64 encoded string.
            rp_id (str): Relying party identifier.
            user_handle (bytes): userHandle associated to the credential. Must be Base64 encoded string.
            private_key (bytes): Base64 encoded PKCS
            sign_count (int): initial value for a signature counter.

        Returns:
            Credential: A resident credential.
        Tr   )rM   rF   r8   r9   r:   r;   s         r   Úcreate_resident_credentialz%Credential.create_resident_credential“   s   € ñ  �2�t˜U K°¸jÓIÐIr   c                 ó°   — | j                   | j                  | j                  | j                  | j                  dœ}| j
                  r| j
                  |d<   |S )N)ÚcredentialIdÚisResidentCredentialÚrpIdÚ
privateKeyÚ	signCountÚ
userHandle)rF   r>   r8   r:   r;   r9   )r(   Úcredential_datas     r   r0   zCredential.to_dict¥   sQ   € à ŸG™GØ$(×$@Ñ$@Ø—J‘JØ×*Ñ*ØŸ™ñ
ˆð ×ÒØ,0×,<Ñ,<ˆO˜LÑ)àÐr   Údatac                 ó  — t        |d   › d�«      }t        |d   «      }|j                  dd «      }t        |d   › d�«      }t        |d   «      }|j                  dd «      rt        |d   › d�«      nd } | ||||||«      S )NrR   z==rS   rT   rU   rV   rW   )r   r2   ÚgetÚint)rM   rY   r=   r7   r8   r:   r;   r9   s           r   Ú	from_dictzCredential.from_dict³   s    € ä 4¨Ñ#7Ð"8¸Ð ;Ó<ˆÜ!% dÐ+AÑ&BÓ!CÐØ—‘˜ Ó&ˆÜ'¨4°Ñ+=Ð*>¸bÐ(AÓBˆÜ˜˜kÑ*Ó+ˆ
ØFJÇhÁhÈ|Ð]aÔFbÔ'¨4°Ñ+=Ð*>¸bÐ(AÔBÐhlˆá�3Ð.°°{ÀKÐQ[Ó\Ð\r   c                 ó¤   — d| j                   › d| j                  › d| j                  › d| j                  › d| j                  › d| j
                  › d�S )NzCredential(id=z, is_resident_credential=z, rp_id=z,            user_handle=z, private_key=z, sign_count=ú))rF   r7   r8   r9   r:   r;   r/   s    r   Ú__str__zCredential.__str__¾   sf   € Ø §¡˜yÐ(AÀ$×B]ÑB]ÐA^Ð^fÐgk×gqÑgqÐfrð sØ×)Ñ)Ð*¨.¸×9IÑ9IÐ8JÈ-ÐX\×XgÑXgÐWhÐhiðkð 	kr   )r
   r   r   Úbytesr2   r1   r\   r)   ÚpropertyrF   r7   r8   r9   r:   r;   ÚclassmethodrN   rP   r3   r   r0   r]   r`   r   r   r   r5   r5   M   sÔ  „ ð&àð&ð !%ð&ð �T‰zð	&ð
 ˜T‘\ð&ð ð&ð ó&ð8 ð4�Cò 4ó ð4ð ð,¨ò ,ó ð,ð ð�s˜T‘zò ó ðð ð˜S 4™Zò ó ðð
 ð=˜Sò =ó ð=ð ð ˜Cò  ó ð ð ðD°ð D¸cð DÐPUð DÐcfð DÐkwò Dó ðDð ðJØðJØ"ðJØ16¸±ðJØLQðJØ_bðJà	òJó ðJð"˜˜c 3˜h™ó ð ð]˜T # s (™^ð ]°ò ]ó ð]ðk˜ô kr   r5   c                 óB   ‡ — t        j                  ‰ «      ˆ fd„«       }|S )zEDecorator to ensure that the client used is a chromium-based browser.c                 óh   •— | j                   d   j                  «       dvsJ d«       ‚ ‰| g|¢­i |¤ŽS )NÚbrowserName)ÚfirefoxÚsafariz4This only currently works in Chromium based browsers)ÚcapsÚlower©r(   ÚargsÚkwargsÚfuncs      €r   Úwrapperz0required_chromium_based_browser.<locals>.wrapperÆ   sP   ø€ à�y‰y˜Ñ'×-Ñ-Ó/ð 8
ñ 
ð 	Bð Bó	Bð 
ñ �DÐ*˜4Ò* 6Ñ*Ð*r   )Ú	functoolsÚwraps©rn   ro   s   ` r   Úrequired_chromium_based_browserrs   Ã   s'   ø€ ô ‡_�_�TÓó+ó ð+ð €Nr   c                 óT   ‡ — t        j                  ‰ «      t        ˆ fd„«       «       }|S )zMDecorator to ensure that the function is called with a virtual authenticator.c                 óJ   •— | j                   st        d«      ‚ ‰| g|¢­i |¤ŽS )Nz9This function requires a virtual authenticator to be set.)Úvirtual_authenticator_idÚ
ValueErrorrk   s      €r   ro   z/required_virtual_authenticator.<locals>.wrapperÔ   s/   ø€ ð ×,Ò,ÜÐXÓYÐYÙ�DÐ*˜4Ò* 6Ñ*Ð*r   )rp   rq   rs   rr   s   ` r   Úrequired_virtual_authenticatorrx   Ñ   s/   ø€ ô ‡_�_�TÓÜ$ó+ó %ó ð+ð
 €Nr   )rp   Úbase64r   r   Úenumr   Útypingr   r1   r   r   r   r5   rs   rx   r   r   r   ú<module>r|      sS   ðó$ ß 7Ý Ý ôˆs�Dô ô��Tô ÷"
ñ "
÷Jskñ skòló
r   