Ë
    ]jŒ  ã                   óF   — d dl Z d dlmZ d dlmZ d dlmZ  G d„ de«      Zy)é    N)Úsettings)ÚCSPMiddleware)Úbuild_policyc                   ó   — e Zd ZdZd„ Zy)ÚRateLimitedCSPMiddlewarez|A CSP middleware that rate-limits the number of violation reports sent
    to report-uri by excluding it from some requests.c                 óä   — t        |dd «      }t        |dd «      }t        |di «      }t        |dd «      }t        t        d«      }t        j                  «       |k  }|sd |d<   t        ||||¬«      S )NÚ_csp_configÚ_csp_updateÚ_csp_replaceÚ
_csp_nonceÚCSP_REPORT_PERCENTAGEz
report-uri)ÚconfigÚupdateÚreplaceÚnonce)Úgetattrr   Úrandomr   )	ÚselfÚrequestÚresponser   r   r   r   Úreport_percentageÚinclude_report_uris	            úC/root/env/lib/python3.12/site-packages/csp/contrib/rate_limiting.pyr   z%RateLimitedCSPMiddleware.build_policy   s}   € Ü˜ =°$Ó7ˆÜ˜ =°$Ó7ˆÜ˜( N°BÓ7ˆÜ˜ ¨tÓ4ˆä#¤HÐ.EÓFÐÜ#Ÿ]™]›_Ð/@Ñ@ÐÙ!Ø$(ˆGLÑ!ä 6°&À'Ø"'ô)ð 	)ó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © r   r   r   r   	   s   „ ñ9ó)r   r   )r   Údjango.confr   Úcsp.middlewarer   Ú	csp.utilsr   r   r   r   r   ú<module>r#      s   ðÛ å  å (Ý "ô)˜}õ )r   