
    aDg'                       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e G d d             Z G d dej                        ZddZddZ	 	 	 	 d dZ e
d      	 	 	 	 	 	 d!d       Z e
d      	 	 	 	 d"d       Z e
d       ed      e G d d                           Z ed      e G d d                    Zy)#    )annotations)event_classT_JSON_DICT)	dataclassN)
deprecatedc                  <     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    L/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/cdp/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                  6    e Zd ZdZdZdZdZddZed	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   str)r   r/   r   r&   )
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
dZ	e
dd       Zy	)SecurityStatez3
    The security level of a page or resource.
    unknownneutralinsecuresecureinfoc                    | 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   Nr.   )r   r/   r   r4   )r   r    r!   r"   UNKNOWNNEUTRALINSECURESECUREINFOr   r#   r   r   r   r   r4   r4   2   s;     GGHFD  r   r4   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Zded<   ddZedd       Zy)SecurityStateExplanationzI
    An explanation of an factor contributing to the security state.
    r4   security_stater/   titlesummarydescriptionr&   mixed_content_typeztyping.List[str]certificateNz!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 )NsecurityStaterD   rE   rF   mixedContentTyperH   rI   )	dictrC   r   rD   rE   rF   rG   rH   rI   )r   r   is      r   r   z SecurityStateExplanation.to_json^   s     F $ 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 )	NrK   rD   rE   rF   rL   rH   rI   )rC   rD   rE   rF   rG   rH   rI   )r4   r   r/   r&   r   r   rN   s      r   r   z"SecurityStateExplanation.from_jsonj   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   r   rB   )	r   r    r!   r"   __annotations__rI   r   r#   r   r   r   r   rB   rB   D   s[     "! J L  )( "! :>O6=
 	
 	
r   rB   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ed
<   ddZedd       Zy)InsecureContentStatusz9
    Information about insecure content on the page.
    boolran_mixed_contentdisplayed_mixed_contentcontained_mixed_formran_content_with_cert_errors"displayed_content_with_cert_errorsr4   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)	rM   rV   rW   rX   rY   rZ   r[   r   r\   )r   r   s     r   r   zInsecureContentStatus.to_json   s     F"&"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`   ra   rb   rc   rd   )rV   rW   rX   rY   rZ   r[   r\   )rU   r4   r   r   s     r   r   zInsecureContentStatus.from_json   s}    "4(9#:;$(.E)F$G!%d+?&@!A)-d3M.N)O/3D9Y4Z/['4'>'>tD]?^'_-:-D-DTJiEj-k
 	
r   NrQ   )r   r   r   rT   )r   r    r!   r"   rR   r   r#   r   r   r   r   rT   rT   w   sX      "!  #'& )-, !.- '43	 	
 	
r   rT   c                  2    e Zd ZdZdZdZddZed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_json   r,   r   c                     | |      S r   r   r   s     r   r   z CertificateErrorAction.from_json   r   r   Nr.   )r   r/   r   rg   )	r   r    r!   r"   CONTINUECANCELr   r#   r   r   r   r   rg   rg      s,     HF  r   rg   c               #     K   ddi} | }yw)z3
    Disables tracking security state changes.
    methodzSecurity.disableNr   cmd_dictr   s     r   disablerr      s     
 	$H >D   
c               #     K   ddi} | }yw)z2
    Enables tracking security state changes.
    ro   zSecurity.enableNr   rp   s     r   enableru      s     
 	#H >Drs   c              #  <   K   t               }| |d<   d|d}|}yw)z
    Enable/disable whether all certificate errors should be ignored.

    **EXPERIMENTAL**

    :param ignore: If true, all certificate errors will be ignored.
    ignorez#Security.setIgnoreCertificateErrorsro   paramsNrM   )rw   ry   rq   r   s       r   set_ignore_certificate_errorsr{      s/      &FF87H >D   z1.3)versionc              #  b   K   t               }| |d<   |j                         |d<   d|d}|}yw)z
    Handles a certificate error that fired a certificateError event.

    .. deprecated:: 1.3

    :param event_id: The ID of the event.
    :param action: The action to take on the certificate error.
    eventIdactionzSecurity.handleCertificateErrorrx   N)rM   r   )event_idr   ry   rq   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.

    .. deprecated:: 1.3

    :param override: If true, certificate errors will be overridden.
    overridez%Security.setOverrideCertificateErrorsrx   Nrz   )r   ry   rq   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   r/   
error_typerequest_urlc                `     | t        |d         t        |d         t        |d               S )Nr   	errorType
requestURL)r   r   r   )r   r/   r   s     r   r   zCertificateError.from_json  s5    i)4,-D./
 	
r   N)r   r   r   r   r   r    r!   r"   rR   r#   r   r   r   r   r   r     s+     MO
 
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)SecurityStateChangedz1
    The security state of the page changed.
    r4   rC   rU   scheme_is_cryptographicz%typing.List[SecurityStateExplanation]explanationsrT   insecure_content_statusztyping.Optional[str]rE   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 )NrK   schemeIsCryptographicr   insecureContentStatusrE   )rC   r   r   r   rE   )r4   r   rU   rB   rT   r/   rP   s      r   r   zSecurityStateChanged.from_json8  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])rw   rU   r   r   )r   r   r   rg   r   r   )r   rU   r   r   )
__future__r   cdp.utilr   r   dataclassesr   enumtypingdeprecated.sphinxr   r   r	   Enumr&   r4   rB   rT   rg   rr   ru   r{   r   r   r   r   r   r   r   <module>r      sa   # - !   )>C >tyy "DII $ /
 /
 /
d .
 .
 .
bTYY  	7& E& 
8 , E	7 ( E()

 
  * 
. ,-

 
  .
r   