
     fA                       d dl mZ ddlmZmZ d dlmZ d dlZd dlZddl	m
Z
  G d de          Z G d	 d
ej                  Z G d dej                  Ze G d d                      Z G d dej                  Ze G d d                      Ze G d d                      Ze G d d                      Ze G d d                      Z G d dej                  Zd1dZd1dZd2d!Zd3d%Zd4d'Z ed(          e G d) d*                                  Z ed+          e G d, d-                                  Z ed.          e G d/ d0                                  ZdS )5    )annotations   )event_classT_JSON_DICT)	dataclassN)networkc                  B     e Zd ZdZddZed	d            Z fdZ xZS )
CertificateIdz+
    An internal certificate ID value.
    returnintc                    | S N selfs    s/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/selenium/webdriver/common/devtools/v127/security.pyto_jsonzCertificateId.to_json   s        jsonc                     | |          S r   r   clsr   s     r   	from_jsonzCertificateId.from_json       s4yyr   c                j    d                     t                                                                S )NzCertificateId({}))formatsuper__repr__)r   	__class__s    r   r   zCertificateId.__repr__   s'    "))%''*:*:*<*<===r   )r   r   )r   r   r   r
   )	__name__
__module____qualname____doc__r   classmethodr   r   __classcell__)r   s   @r   r
   r
      sv                [> > > > > > > > >r   r
   c                  :    e Zd ZdZdZdZdZd Zed             Z	dS )MixedContentTypez
    A description of mixed content (HTTP resources on HTTPS pages), as defined by
    https://www.w3.org/TR/mixed-content/#categories
    	blockablezoptionally-blockablenonec                    | j         S r   valuer   s    r   r   zMixedContentType.to_json'   
    zr   c                     | |          S r   r   r   s     r   r   zMixedContentType.from_json*   r   r   N)
r    r!   r"   r#   	BLOCKABLEOPTIONALLY_BLOCKABLENONEr   r$   r   r   r   r   r'   r'      sZ          I1D     [  r   r'   c                  F    e Zd ZdZdZdZdZdZdZdZ	d Z
ed	             Zd
S )SecurityStatez3
    The security level of a page or resource.
    unknownneutralinsecuresecureinfozinsecure-brokenc                    | j         S r   r+   r   s    r   r   zSecurityState.to_json:   r-   r   c                     | |          S r   r   r   s     r   r   zSecurityState.from_json=   r   r   N)r    r!   r"   r#   UNKNOWNNEUTRALINSECURESECUREINFOINSECURE_BROKENr   r$   r   r   r   r   r3   r3   /   sh          GGHFD'O     [  r   r3   c                      e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded	<   d
ed<   d
ed<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   dZded<   dZded<   dZded<   d Ze	d             Z
dS )CertificateSecurityStatezC
    Details about the security state of the page certificate.
    strprotocolkey_exchangeciphertyping.List[str]certificatesubject_nameissuerznetwork.TimeSinceEpoch
valid_fromvalid_toboolcertificate_has_weak_signaturecertificate_has_sha1_signature
modern_sslobsolete_ssl_protocolobsolete_ssl_key_exchangeobsolete_ssl_cipherobsolete_ssl_signatureNtyping.Optional[str]key_exchange_groupmaccertificate_network_errorc                   t                      }| j        |d<   | j        |d<   | j        |d<   d | j        D             |d<   | j        |d<   | j        |d<   | j                                        |d<   | j	                                        |d	<   | j
        |d
<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   |S )NrD   keyExchangerF   c                    g | ]}|S r   r   .0is     r   
<listcomp>z4CertificateSecurityState.to_json.<locals>.<listcomp>       ;;;Qq;;;r   rH   subjectNamerJ   	validFromvalidTocertificateHasWeakSignaturecertificateHasSha1Signature	modernSSLobsoleteSslProtocolobsoleteSslKeyExchangeobsoleteSslCipherobsoleteSslSignaturekeyExchangeGrouprW   certificateNetworkError)dictrD   rE   rF   rH   rI   rJ   rK   r   rL   rN   rO   rP   rQ   rR   rS   rT   rV   rW   rX   r   r   s     r   r   z CertificateSecurityState.to_json}   s7   vv=Z"/]X;;$*:;;;]"/]X O3355[-//11Y.2.Q*+.2.Q*+ O[&*&@"#)-)G%&$($< !'+'B#$".'+'>D#$8(DK)5.2.LD*+r   c           	         | d!i dt          |d                   dt          |d                   dt          |d                   dd |d         D             dt          |d                   d	t          |d	                   d
t          j                            |d                   dt          j                            |d                   dt	          |d                   dt	          |d                   dt	          |d                   dt	          |d                   dt	          |d                   dt	          |d                   dt	          |d                   dd|v rt          |d                   nd dd|v rt          |d                   nd dd |v rt          |d                    nd S )"NrD   rE   rZ   rF   rH   c                ,    g | ]}t          |          S r   rC   r\   s     r   r_   z6CertificateSecurityState.from_json.<locals>.<listcomp>       ===AQ===r   rI   ra   rJ   rK   rb   rL   rc   rN   rd   rO   re   rP   rf   rQ   rg   rR   rh   rS   ri   rT   rj   rV   rk   rW   rX   rl   r   )rC   r   TimeSinceEpochr   rM   r   s     r   r   z"CertificateSecurityState.from_json   s4   s 
 
 
j)***
T-0111
 tH~&&&
 >=m)<====	

 T-0111
 tH~&&&
 -77[8IJJJ
 +55d9oFFF
 ,05R0S+T+T+T
 ,05R0S+T+T+T
 D-...
 #'t,A'B"C"C"C
 '+40H+I&J&J&J
 !%T*=%> ? ? ?
 $(-C(D#E#E#E
  ASVZ@Z@Zs4(:#;<<<`d!
" %*TMMDK   t#
$ OhkoNoNoc$/H*I&J&J&Juy%
 	
r   )r    r!   r"   r#   __annotations__rV   rW   rX   r   r$   r   r   r   r   rB   rB   B   sN          MMM  KKK "!!!  KKK '&&& %$$$ )((( )(((    $###  !    043333 !%C$$$$ 7;::::  2 
 
 [
 
 
r   rB   c                  2    e Zd ZdZdZd Zed             ZdS )SafetyTipStatusbadReputation	lookalikec                    | j         S r   r+   r   s    r   r   zSafetyTipStatus.to_json   r-   r   c                     | |          S r   r   r   s     r   r   zSafetyTipStatus.from_json   r   r   N)r    r!   r"   BAD_REPUTATION	LOOKALIKEr   r$   r   r   r   r   rv   rv      sH        $NI     [  r   rv   c                  D    e Zd ZU ded<   dZded<   d Zed             ZdS )SafetyTipInforv   safety_tip_statusNrU   safe_urlc                |    t                      }| j                                        |d<   | j        
| j        |d<   |S )NsafetyTipStatussafeUrl)rm   r   r   r   rn   s     r   r   zSafetyTipInfo.to_json   s=    vv"&"8"@"@"B"B=$"mDOr   c                     | t                               |d                   d|v rt          |d                   nd           S )Nr   r   )r   r   )rv   r   rC   r   s     r   r   zSafetyTipInfo.from_json   sP    s-77=N8OPP-6$->->Si)))D
 
 
 	
r   )r    r!   r"   rt   r   r   r$   r   r   r   r   r~   r~      sa          '&&& &*H))))   
 
 [
 
 
r   r~   c                  `    e Zd ZU dZded<   ded<   dZded<   dZd	ed
<   d Zed             Z	dS )VisibleSecurityStatez4
    Security state information about the page.
    r3   security_staterG   security_state_issue_idsNz)typing.Optional[CertificateSecurityState]certificate_security_stateztyping.Optional[SafetyTipInfo]safety_tip_infoc                   t                      }| j                                        |d<   d | j        D             |d<   | j        | j                                        |d<   | j        | j                                        |d<   |S )NsecurityStatec                    g | ]}|S r   r   r\   s     r   r_   z0VisibleSecurityState.to_json.<locals>.<listcomp>   s    (R(R(Rq(R(R(Rr   securityStateIssueIdscertificateSecurityStatesafetyTipInfo)rm   r   r   r   r   r   rn   s     r   r   zVisibleSecurityState.to_json   s    vv $ 3 ; ; = =_(R(RD4Q(R(R(R$%*6/3/N/V/V/X/XD+,+$($8$@$@$B$BD!r   c           	         | t                               |d                   d |d         D             d|v r t                              |d                   nd d|v r t                              |d                   nd           S )Nr   c                ,    g | ]}t          |          S r   rq   r\   s     r   r_   z2VisibleSecurityState.from_json.<locals>.<listcomp>   s    %T%T%Tc!ff%T%T%Tr   r   r   r   )r   r   r   r   )r3   r   rB   r~   r   s     r   r   zVisibleSecurityState.from_json   s    s(2243HII%T%Td;R6S%T%T%T pJ  NR  pR  pR'?'I'I$OiJj'k'k'k  X\N]aeNeNeM33D4IJJJko	
 
 
 	
r   )
r    r!   r"   r#   rt   r   r   r   r$   r   r   r   r   r   r      s           "!!! /... MQPPPP 7;O::::   
 
 [
 
 
r   r   c                  z    e Zd ZU dZded<   ded<   ded<   ded<   ded	<   d
ed<   dZded<   d Zed             ZdS )SecurityStateExplanationzI
    An explanation of an factor contributing to the security state.
    r3   r   rC   titlesummarydescriptionr'   mixed_content_typerG   rH   Nz!typing.Optional[typing.List[str]]recommendationsc                ,   t                      }| j                                        |d<   | j        |d<   | j        |d<   | j        |d<   | j                                        |d<   d | j        D             |d<   | j        d | j        D             |d	<   |S )
Nr   r   r   r   mixedContentTypec                    g | ]}|S r   r   r\   s     r   r_   z4SecurityStateExplanation.to_json.<locals>.<listcomp>  r`   r   rH   c                    g | ]}|S r   r   r\   s     r   r_   z4SecurityStateExplanation.to_json.<locals>.<listcomp>  s    &G&G&GQq&G&G&Gr   r   )	rm   r   r   r   r   r   r   rH   r   rn   s     r   r   z SecurityStateExplanation.to_json  s    vv $ 3 ; ; = =_
W,Y".]#'#:#B#B#D#D ;;$*:;;;]+&G&G$2F&G&G&GD"#r   c                \    | t                               |d                   t          |d                   t          |d                   t          |d                   t                              |d                   d |d         D             d|v rd	 |d         D             nd 
          S )Nr   r   r   r   r   c                ,    g | ]}t          |          S r   rq   r\   s     r   r_   z6SecurityStateExplanation.from_json.<locals>.<listcomp>$  rr   r   rH   r   c                ,    g | ]}t          |          S r   rq   r\   s     r   r_   z6SecurityStateExplanation.from_json.<locals>.<listcomp>%  s    EEESVVEEEr   )r   r   r   r   r   rH   r   )r3   r   rC   r'   r   s     r   r   z"SecurityStateExplanation.from_json  s    s(2243HIId7m$$Y((D/00/99$?Q:RSS==m)<===IZ^bIbIbEET2C-DEEEEhl
 
 
 	
r   )	r    r!   r"   r#   rt   r   r   r$   r   r   r   r   r   r      s           "!!! JJJ LLL  )((( "!!! :>O====
 
 
 	
 	
 [	
 	
 	
r   r   c                  v    e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded	<   ded
<   d Zed             ZdS )InsecureContentStatusz9
    Information about insecure content on the page.
    rM   ran_mixed_contentdisplayed_mixed_contentcontained_mixed_formran_content_with_cert_errors"displayed_content_with_cert_errorsr3   ran_insecure_content_style displayed_insecure_content_stylec                    t                      }| j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   | j                                        |d<   | j                                        |d<   |S )NranMixedContentdisplayedMixedContentcontainedMixedFormranContentWithCertErrorsdisplayedContentWithCertErrorsranInsecureContentStyledisplayedInsecureContentStyle)	rm   r   r   r   r   r   r   r   r   rn   s     r   r   zInsecureContentStatus.to_jsonC  s    vv"&"8(,(D$%%)%>!"+/+L'(151X-.*.*I*Q*Q*S*S&'040U0]0]0_0_,-r   c                \    | t          |d                   t          |d                   t          |d                   t          |d                   t          |d                   t                              |d                   t                              |d                             S )	Nr   r   r   r   r   r   r   )r   r   r   r   r   r   r   )rM   r3   r   r   s     r   r   zInsecureContentStatus.from_jsonN  s    s"4(9#:;;$(.E)F$G$G!%d+?&@!A!A)-d3M.N)O)O/3D9Y4Z/[/['4'>'>tD]?^'_'_-:-D-DTJiEj-k-k
 
 
 	
r   N)r    r!   r"   r#   rt   r   r$   r   r   r   r   r   r   )  s            "!!!  '&&& -,,, .--- 4333	 	 	 	
 	
 [	
 	
 	
r   r   c                  6    e Zd ZdZdZdZd Zed             ZdS )CertificateErrorActionz
    The action to take when a certificate error occurs. continue will continue processing the
    request and cancel will cancel the request.
    continuecancelc                    | j         S r   r+   r   s    r   r   zCertificateErrorAction.to_jsonc  r-   r   c                     | |          S r   r   r   s     r   r   z CertificateErrorAction.from_jsonf  r   r   N)	r    r!   r"   r#   CONTINUECANCELr   r$   r   r   r   r   r   r   [  sT          HF     [  r   r   r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c               #     K   ddi} | V }dS )z3
    Disables tracking security state changes.
    methodzSecurity.disableNr   cmd_dictr   s     r   disabler   k  s$      
 	$H >>DDDr   c               #     K   ddi} | V }dS )z2
    Enables tracking security state changes.
    r   zSecurity.enableNr   r   s     r   enabler   u  s$      
 	#H >>DDDr   ignorerM   c              #  B   K   t                      }| |d<   d|d}|V }dS )z
    Enable/disable whether all certificate errors should be ignored.

    :param ignore: If true, all certificate errors will be ignored.
    r   z#Security.setIgnoreCertificateErrorsr   paramsNrm   )r   r   r   r   s       r   set_ignore_certificate_errorsr     s<       &&FF87 H >>DDDr   event_idr   actionc              #  p   K   t                      }| |d<   |                                |d<   d|d}|V }dS )z
    Handles a certificate error that fired a certificateError event.

    :param event_id: The ID of the event.
    :param action: The action to take on the certificate error.
    eventIdr   zSecurity.handleCertificateErrorr   N)rm   r   )r   r   r   r   r   s        r   handle_certificate_errorr     sP       &&F F9~~''F83 H >>DDDr   overridec              #  B   K   t                      }| |d<   d|d}|V }dS )a  
    Enable/disable overriding certificate errors. If enabled, all certificate error events need to
    be handled by the DevTools client and should be answered with ``handleCertificateError`` commands.

    :param override: If true, certificate errors will be overridden.
    r   z%Security.setOverrideCertificateErrorsr   Nr   )r   r   r   r   s       r   set_override_certificate_errorsr     s<       &&F!F:9 H >>DDDr   zSecurity.certificateErrorc                  J    e Zd ZU dZded<   ded<   ded<   edd
            ZdS )CertificateErroraL  
    There is a certificate error. If overriding certificate errors is enabled, then it should be
    handled with the ``handleCertificateError`` command. Note: this event does not fire if the
    certificate error has been allowed internally. Only one client per target should override
    certificate errors at the same time.
    r   r   rC   
error_typerequest_urlr   r   r   c                     | t          |d                   t          |d                   t          |d                             S )Nr   	errorType
requestURL)r   r   r   )r   rC   r   s     r   r   zCertificateError.from_json  sJ    si))4,--D.//
 
 
 	
r   N)r   r   r   r   r    r!   r"   r#   rt   r$   r   r   r   r   r   r     s^           MMMOOO
 
 
 [
 
 
r   r   z$Security.visibleSecurityStateChangedc                  6    e Zd ZU dZded<   ed	d            ZdS )
VisibleSecurityStateChangedzG
    **EXPERIMENTAL**

    The security state of the page changed.
    r   visible_security_stater   r   r   c                V     | t                               |d                             S )NvisibleSecurityState)r   )r   r   r   s     r   r   z%VisibleSecurityStateChanged.from_json  s2    s#7#A#A$G]B^#_#_
 
 
 	
r   N)r   r   r   r   r   r   r   r   r   r     sL           1000
 
 
 [
 
 
r   r   zSecurity.securityStateChangedc                  ^    e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<   edd            ZdS )SecurityStateChangedzG
    The security state of the page changed. No longer being sent.
    r3   r   rM   scheme_is_cryptographicz%typing.List[SecurityStateExplanation]explanationsr   insecure_content_statusrU   r   r   r   r   c           
         | t                               |d                   t          |d                   d |d         D             t                              |d                   d|v rt	          |d                   nd           S )Nr   schemeIsCryptographicc                B    g | ]}t                               |          S r   )r   r   r\   s     r   r_   z2SecurityStateChanged.from_json.<locals>.<listcomp>  s'    ^^^A2<<Q??^^^r   r   insecureContentStatusr   )r   r   r   r   r   )r3   r   rM   r   rC   r   s     r   r   zSecurityStateChanged.from_json  s    s(2243HII$(.E)F$G$G^^nI]^^^$9$C$CDI`Da$b$b,5,=,=CY(((4
 
 
 	
r   N)r   r   r   r   r   r   r   r   r   r     s~           "!!!!!!! 87772222!!!!
 
 
 [
 
 
r   r   )r   r   )r   rM   r   r   )r   r   r   r   r   r   )r   rM   r   r   )
__future__r   utilr   r   dataclassesr   enumtyping r   r   r
   Enumr'   r3   rB   rv   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s   # " " " " " * * * * * * * * ! ! ! ! ! !        > > > > >C > > >    ty   "    DI   & h
 h
 h
 h
 h
 h
 h
 h
V	 	 	 	 	di 	 	 	 
 
 
 
 
 
 
 
, !
 !
 !
 !
 !
 !
 !
 !
H /
 /
 /
 /
 /
 /
 /
 /
d .
 .
 .
 .
 .
 .
 .
 .
b    TY             "   (   $ ())

 
 
 
 
 
 
  *)
. 344

 
 
 
 
 
 
  54
  ,--

 
 
 
 
 
 
  .-
 
 
r   