zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
U
Þ=®d¬ ã@s6ddlmZddlmZdd„ZGdd„deeƒZdS)    é)Ú annotationsé)ÚUpdateDictMixincs,t‡fdd„‡fdd„‡fdd„dˆ›ƒS)z”Return a new property object for a content security policy header.
    Useful if you want to add support for a csp extension in a
    subclass.
    cs
| ˆ¡S©N)Ú
_get_value©Úx©Úkey©úRd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\werkzeug/datastructures/csp.pyÚ<lambda> ózcsp_property.<locals>.<lambda>cs | ˆ|¡Sr)Ú
_set_value)rÚvr    r r r rcs
| ˆ¡Sr)Ú
_del_valuerr    r r r rz accessor for )Úpropertyr    r r    r Ú csp_propertys 
 
 
ürc@seZdZdZedƒZedƒZedƒZedƒZedƒZ    edƒZ
edƒZ ed    ƒZ ed
ƒZ ed ƒZed ƒZed ƒZedƒZedƒZedƒZedƒZedƒZedƒZedƒZedƒZedƒZedƒZedƒZedƒZedƒZd+dd„Zdd „Zd!d"„Z d#d$„Z!d%d&„Z"d'd(„Z#d)d*„Z$dS),ÚContentSecurityPolicyaVSubclass of a dict that stores values for a Content Security Policy
    header. It has accessors for all the level 3 policies.
 
    Because the csp directives in the HTTP header use dashes the
    python descriptors use underscores for that.
 
    To get a header of the :class:`ContentSecuirtyPolicy` object again
    you can convert the object into a string or call the
    :meth:`to_header` method.  If you plan to subclass it and add your
    own items have a look at the sourcecode for that class.
 
    .. versionadded:: 1.0.0
       Support for Content Security Policy headers was added.
 
    zbase-uriz    child-srcz connect-srcz default-srczfont-srcz form-actionzframe-ancestorsz    frame-srczimg-srcz manifest-srcz    media-srcz navigate-toz
object-srcz prefetch-srcz plugin-typesz    report-toz
report-uriÚsandboxz
script-srczscript-src-attrzscript-src-elemz    style-srczstyle-src-attrzstyle-src-elemz
worker-srcr NcCs$t ||p d¡||_|dk    |_dS)Nr )ÚdictÚ__init__Ú    on_updateÚprovided)ÚselfÚvaluesrr r r r>szContentSecurityPolicy.__init__cCs
| |¡S)ú+Used internally by the accessor properties.)Úget©rr
r r r rCsz ContentSecurityPolicy._get_valuecCs"|dkr| |d¡n|||<dS©rN)Úpop)rr
Úvaluer r r rGsz ContentSecurityPolicy._set_valuecCs||kr||=dSrr rr r r rNsz ContentSecurityPolicy._del_valuecCsddlm}||ƒS)z6Convert the stored values into a cache control header.é)Údump_csp_header)Úhttpr#)rr#r r r Ú    to_headerSs zContentSecurityPolicy.to_headercCs| ¡Sr)r%)rr r r Ú__str__YszContentSecurityPolicy.__str__cCs4d dd„t| ¡ƒDƒ¡}dt|ƒj›d|›dS)Nú css |]\}}|›d|›VqdS)ú=Nr )Ú.0Úkrr r r Ú    <genexpr>]sz1ContentSecurityPolicy.__repr__.<locals>.<genexpr>ú<ú>)ÚjoinÚsortedÚitemsÚtypeÚ__name__)rZkv_strr r r Ú__repr__\szContentSecurityPolicy.__repr__)r N)%r2Ú
__module__Ú __qualname__Ú__doc__rZbase_uriZ    child_srcZ connect_srcZ default_srcZfont_srcZ form_actionZframe_ancestorsZ    frame_srcZimg_srcZ manifest_srcZ    media_srcZ navigate_toZ
object_srcZ prefetch_srcZ plugin_typesZ    report_toZ
report_urirZ
script_srcZscript_src_attrZscript_src_elemZ    style_srcZstyle_src_attrZstyle_src_elemZ
worker_srcrrrrr%r&r3r r r r rsB
rN)Ú
__future__rZmixinsrrrrr r r r Ú<module>s