
    ,hA                    |   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d)dZd)dZ	 	 	 	 d*dZ	 	 	 	 	 	 d+dZ	 	 	 	 d,dZ ed       e G d! d"                    Z ed#      e G d$ d%                    Z ed&      e G d' d(                    Zy)-    )annotations   )event_classT_JSON_DICT)	dataclassN)networkc                  <     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.
    c                    | S N selfs    r/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v134/security.pyto_jsonzCertificateId.to_json   s        c                     | |      S r   r   clsjsons     r   	from_jsonzCertificateId.from_json       4yr   c                >    dj                  t        | 	               S )NzCertificateId({}))formatsuper__repr__)r   	__class__s    r   r   zCertificateId.__repr__   s    "))%'*:*<==r   )returnint)r   r   r   r
   )	__name__
__module____qualname____doc__r   classmethodr   r   __classcell__)r   s   @r   r
   r
      s+      > >r   r
   c                  2    e Zd ZdZdZdZdZd Zed        Z	y)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'       zz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'      s2     I1D  r   r'   c                  >    e Zd ZdZdZdZdZdZdZdZ	d Z
ed	        Zy
)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   /   s@     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
y)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<   | j                  D cg c]  }| c}|d<   | j
                  |d<   | j                  |d<   | j                  j                         |d<   | j                  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 c c}w )NrD   keyExchangerF   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   is      r   r   z CertificateSecurityState.to_json}   sh   v==Z"//]X*.*:*:;Qq;]"//]X OO335[--//1Y.2.Q.Q*+.2.Q.Q*+ OO[&*&@&@"#)-)G)G%&$($<$< !'+'B'B#$"".'+'>'>D#$88((DK))5.2.L.LD*+% <s   	E)c                    | d i dt        |d         dt        |d         dt        |d         d|d   D cg c]  }t        |       c}dt        |d         dt        |d         d	t        j                  j                  |d
         dt        j                  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         S d S c c}w )!NrD   rE   rZ   rF   rH   rI   r[   rJ   rK   r\   rL   r]   rN   r^   rO   r_   rP   r`   rQ   ra   rR   rb   rS   rc   rT   rd   rV   re   rW   rX   rf   r   )rC   r   TimeSinceEpochr   rM   r   r   ri   s      r   r   z"CertificateSecurityState.from_json   s    
j)*
T-01
 tH~&
 *.m)<=AQ=	

 T-01
 tH~&
 --77[8IJ
 ++55d9oF
 ,05R0S+T
 ,05R0S+T
 D-.
 #'t,A'B"C
 '+40H+I&J
 !%T*=%> ?
 $(-C(D#E
  ASVZ@Zs4(:#;<`d!
" %*TMDK t#
$ OhkoNoc$/H*I&J%
 	
$ vz%
 	
 >s   E)r    r!   r"   r#   __annotations__rV   rW   rX   r   r$   r   r   r   r   rB   rB   B   s     M  K "!  K '& %$ %)( %)(     $#  !  04,3 !%C	$ 7;3:2 
 
r   rB   c                  *    e Zd ZdZdZd Zed        Zy)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   ro   ro      s%    $NI  r   ro   c                  <    e Zd ZU ded<   dZded<   d Zed        Zy)SafetyTipInforo   safety_tip_statusNrU   safe_urlc                    t               }| j                  j                         |d<   | j                  | j                  |d<   |S )NsafetyTipStatussafeUrl)rg   rx   r   ry   r   r   s     r   r   zSafetyTipInfo.to_json   s?    v"&"8"8"@"@"B==$"mmDOr   c                p     | t         j                  |d         d|v rt        |d               S d       S )Nr{   r|   )rx   ry   )ro   r   rC   r   s     r   r   zSafetyTipInfo.from_json   sC    -77=N8OP-6$->Si)
 	
DH
 	
r   )r    r!   r"   rm   ry   r   r$   r   r   r   r   rw   rw      s0     '& &*H") 
 
r   rw   c                  X    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	y)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                  j                         |d<   | j                  D cg c]  }| c}|d<   | j                  | j                  j                         |d<   | j
                  | j
                  j                         |d<   |S c c}w )NsecurityStatesecurityStateIssueIdscertificateSecurityStatesafetyTipInfo)rg   r   r   r   r   r   rh   s      r   r   zVisibleSecurityState.to_json   s    v $ 3 3 ; ; =_484Q4Q(Rq(R$%**6/3/N/N/V/V/XD+,+$($8$8$@$@$BD! )Ss   	Bc           	          | t         j                  |d         |d   D cg c]  }t        |       c}d|v rt        j                  |d         nd d|v rt        j                  |d               S d       S c c}w )Nr   r   r   r   )r   r   r   r   )r3   r   rC   rB   rw   rl   s      r   r   zVisibleSecurityState.from_json   s    (2243HI6:;R6S%Tc!f%T pJ  NR  pR'?'I'I$OiJj'k  X\N]aeNeM33D4IJ	
 	
 lp	
 	
%Ts   A:
)
r    r!   r"   r#   rm   r   r   r   r$   r   r   r   r   r   r      sM     "! /. MQ IP 7;O3: 
 
r   r   c                  r    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y)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                  j                         |d<   | j                  |d<   | j                  |d<   | j
                  |d<   | j                  j                         |d<   | j                  D cg c]  }| c}|d<   | j                  | j                  D cg c]  }| c}|d<   |S c c}w c c}w )Nr   r   r   r   mixedContentTyperH   r   )	rg   r   r   r   r   r   r   rH   r   rh   s      r   r   z SecurityStateExplanation.to_json  s    v $ 3 3 ; ; =_

W,,Y"..]#'#:#:#B#B#D *.*:*:;Qq;]+262F2F&GQq&GD"# <&Gs    	B:)	B?c                R    | t         j                  |d         t        |d         t        |d         t        |d         t        j                  |d         |d   D cg c]  }t        |       c}d|v r!|d   D cg c]  }t        |       c}      S d       S c c}w c c}w )	Nr   r   r   r   r   rH   r   )r   r   r   r   r   rH   r   )r3   r   rC   r'   rl   s      r   r   z"SecurityStateExplanation.from_json  s    (2243HId7m$Y(D/0/99$?Q:RS)-m)<=AQ=IZ^bIbT2C-DESVE
 	
 im
 	
 >Es   B>B$)	r    r!   r"   r#   rm   r   r   r$   r   r   r   r   r   r      s[     "! J L  )( "! :>O6=
 	
 	
r   r   c                  n    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y)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                  j                         |d<   | j                  j                         |d<   |S )NranMixedContentdisplayedMixedContentcontainedMixedFormranContentWithCertErrorsdisplayedContentWithCertErrorsranInsecureContentStyledisplayedInsecureContentStyle)	rg   r   r   r   r   r   r   r   r   r}   s     r   r   zInsecureContentStatus.to_jsonC  s    v"&"8"8(,(D(D$%%)%>%>!"+/+L+L'(151X1X-.*.*I*I*Q*Q*S&'040U0U0]0]0_,-r   c                     | t        |d         t        |d         t        |d         t        |d         t        |d         t        j                  |d         t        j                  |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}    "4(9#:;$(.E)F$G!%d+?&@!A)-d3M.N)O/3D9Y4Z/['4'>'>tD]?^'_-:-D-DTJiEj-k
 	
r   N)r    r!   r"   r#   rm   r   r$   r   r   r   r   r   r   )  sX      "!  #'& )-, !.- '43	 	
 	
r   r   c                  .    e Zd ZdZdZdZd Zed        Zy)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   [  s,     HF  r   r   c               #     K   ddi} | }yw)z3
    Disables tracking security state changes.
    methodzSecurity.disableNr   cmd_dictr   s     r   disabler   k  s     
 	$H >D   
c               #     K   ddi} | }yw)z2
    Enables tracking security state changes.
    r   zSecurity.enableNr   r   s     r   enabler   u  s     
 	#H >Dr   c              #  <   K   t               }| |d<   d|d}|}yw)z
    Enable/disable whether all certificate errors should be ignored.

    :param ignore: If true, all certificate errors will be ignored.
    ignorez#Security.setIgnoreCertificateErrorsr   paramsNrg   )r   r   r   r   s       r   set_ignore_certificate_errorsr     s/      &FF87H >D   c              #  b   K   t               }| |d<   |j                         |d<   d|d}|}yw)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.
    eventIdactionzSecurity.handleCertificateErrorr   N)rg   r   )event_idr   r   r   r   s        r   handle_certificate_errorr     s@      &F F9~~'F83H >Ds   -/c              #  <   K   t               }| |d<   d|d}|}yw)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.
    overridez%Security.setOverrideCertificateErrorsr   Nr   )r   r   r   r   s       r   set_override_certificate_errorsr     s/      &F!F:9H >Dr   zSecurity.certificateErrorc                  B    e Zd ZU dZded<   ded<   ded<   ed	d       Zy)
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_urlc                `     | t        |d         t        |d         t        |d               S )Nr   	errorType
requestURL)r   r   r   )r   rC   r   s     r   r   zCertificateError.from_json  s5    i)4,-D./
 	
r   N)r   r   r   r   r    r!   r"   r#   rm   r$   r   r   r   r   r   r     s+     MO
 
r   r   z$Security.visibleSecurityStateChangedc                  .    e Zd ZU dZded<   edd       Zy)VisibleSecurityStateChangedzG
    **EXPERIMENTAL**

    The security state of the page changed.
    r   visible_security_statec                @     | t         j                  |d               S )NvisibleSecurityState)r   )r   r   r   s     r   r   z%VisibleSecurityStateChanged.from_json  s#    #7#A#A$G]B^#_
 	
r   N)r   r   r   r   r   r   r   r   r   r     s!     10
 
r   r   zSecurity.securityStateChangedc                  V    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y)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   c           
         | t         j                  |d         t        |d         |d   D cg c]  }t        j                  |       c}t        j                  |d         d|v rt        |d               S d       S c c}w )Nr   schemeIsCryptographicr   insecureContentStatusr   )r   r   r   r   r   )r3   r   rM   r   r   rC   rl   s      r   r   zSecurityStateChanged.from_json  s    (2243HI$(.E)F$GIMnI]^A2<<Q?^$9$C$CDI`Da$b,5,=CY(
 	

 DH
 	
 _s   BN)r   r   r   r   r   r   r   r   r   r     s;     "!!! 8722!!
 
r   r   )r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])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   ro   rw   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s   # * !   >C >tyy "DII & h
 h
 h
V	dii 	 
 
 
, !
 !
 !
H /
 /
 /
d .
 .
 .
bTYY  	7"& 
8(	7$ ()

 
  *
. 34

 
  5
  ,-

 
  .
r   