csp.pyi 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. from collections.abc import Callable
  2. from collections.abc import Iterable
  3. from collections.abc import Mapping
  4. from .mixins import UpdateDictMixin
  5. def csp_property(key: str) -> property: ...
  6. class ContentSecurityPolicy(UpdateDictMixin[str, str], dict[str, str]):
  7. @property
  8. def base_uri(self) -> str | None: ...
  9. @base_uri.setter
  10. def base_uri(self, value: str | None) -> None: ...
  11. @base_uri.deleter
  12. def base_uri(self) -> None: ...
  13. @property
  14. def child_src(self) -> str | None: ...
  15. @child_src.setter
  16. def child_src(self, value: str | None) -> None: ...
  17. @child_src.deleter
  18. def child_src(self) -> None: ...
  19. @property
  20. def connect_src(self) -> str | None: ...
  21. @connect_src.setter
  22. def connect_src(self, value: str | None) -> None: ...
  23. @connect_src.deleter
  24. def connect_src(self) -> None: ...
  25. @property
  26. def default_src(self) -> str | None: ...
  27. @default_src.setter
  28. def default_src(self, value: str | None) -> None: ...
  29. @default_src.deleter
  30. def default_src(self) -> None: ...
  31. @property
  32. def font_src(self) -> str | None: ...
  33. @font_src.setter
  34. def font_src(self, value: str | None) -> None: ...
  35. @font_src.deleter
  36. def font_src(self) -> None: ...
  37. @property
  38. def form_action(self) -> str | None: ...
  39. @form_action.setter
  40. def form_action(self, value: str | None) -> None: ...
  41. @form_action.deleter
  42. def form_action(self) -> None: ...
  43. @property
  44. def frame_ancestors(self) -> str | None: ...
  45. @frame_ancestors.setter
  46. def frame_ancestors(self, value: str | None) -> None: ...
  47. @frame_ancestors.deleter
  48. def frame_ancestors(self) -> None: ...
  49. @property
  50. def frame_src(self) -> str | None: ...
  51. @frame_src.setter
  52. def frame_src(self, value: str | None) -> None: ...
  53. @frame_src.deleter
  54. def frame_src(self) -> None: ...
  55. @property
  56. def img_src(self) -> str | None: ...
  57. @img_src.setter
  58. def img_src(self, value: str | None) -> None: ...
  59. @img_src.deleter
  60. def img_src(self) -> None: ...
  61. @property
  62. def manifest_src(self) -> str | None: ...
  63. @manifest_src.setter
  64. def manifest_src(self, value: str | None) -> None: ...
  65. @manifest_src.deleter
  66. def manifest_src(self) -> None: ...
  67. @property
  68. def media_src(self) -> str | None: ...
  69. @media_src.setter
  70. def media_src(self, value: str | None) -> None: ...
  71. @media_src.deleter
  72. def media_src(self) -> None: ...
  73. @property
  74. def navigate_to(self) -> str | None: ...
  75. @navigate_to.setter
  76. def navigate_to(self, value: str | None) -> None: ...
  77. @navigate_to.deleter
  78. def navigate_to(self) -> None: ...
  79. @property
  80. def object_src(self) -> str | None: ...
  81. @object_src.setter
  82. def object_src(self, value: str | None) -> None: ...
  83. @object_src.deleter
  84. def object_src(self) -> None: ...
  85. @property
  86. def prefetch_src(self) -> str | None: ...
  87. @prefetch_src.setter
  88. def prefetch_src(self, value: str | None) -> None: ...
  89. @prefetch_src.deleter
  90. def prefetch_src(self) -> None: ...
  91. @property
  92. def plugin_types(self) -> str | None: ...
  93. @plugin_types.setter
  94. def plugin_types(self, value: str | None) -> None: ...
  95. @plugin_types.deleter
  96. def plugin_types(self) -> None: ...
  97. @property
  98. def report_to(self) -> str | None: ...
  99. @report_to.setter
  100. def report_to(self, value: str | None) -> None: ...
  101. @report_to.deleter
  102. def report_to(self) -> None: ...
  103. @property
  104. def report_uri(self) -> str | None: ...
  105. @report_uri.setter
  106. def report_uri(self, value: str | None) -> None: ...
  107. @report_uri.deleter
  108. def report_uri(self) -> None: ...
  109. @property
  110. def sandbox(self) -> str | None: ...
  111. @sandbox.setter
  112. def sandbox(self, value: str | None) -> None: ...
  113. @sandbox.deleter
  114. def sandbox(self) -> None: ...
  115. @property
  116. def script_src(self) -> str | None: ...
  117. @script_src.setter
  118. def script_src(self, value: str | None) -> None: ...
  119. @script_src.deleter
  120. def script_src(self) -> None: ...
  121. @property
  122. def script_src_attr(self) -> str | None: ...
  123. @script_src_attr.setter
  124. def script_src_attr(self, value: str | None) -> None: ...
  125. @script_src_attr.deleter
  126. def script_src_attr(self) -> None: ...
  127. @property
  128. def script_src_elem(self) -> str | None: ...
  129. @script_src_elem.setter
  130. def script_src_elem(self, value: str | None) -> None: ...
  131. @script_src_elem.deleter
  132. def script_src_elem(self) -> None: ...
  133. @property
  134. def style_src(self) -> str | None: ...
  135. @style_src.setter
  136. def style_src(self, value: str | None) -> None: ...
  137. @style_src.deleter
  138. def style_src(self) -> None: ...
  139. @property
  140. def style_src_attr(self) -> str | None: ...
  141. @style_src_attr.setter
  142. def style_src_attr(self, value: str | None) -> None: ...
  143. @style_src_attr.deleter
  144. def style_src_attr(self) -> None: ...
  145. @property
  146. def style_src_elem(self) -> str | None: ...
  147. @style_src_elem.setter
  148. def style_src_elem(self, value: str | None) -> None: ...
  149. @style_src_elem.deleter
  150. def style_src_elem(self) -> None: ...
  151. @property
  152. def worker_src(self) -> str | None: ...
  153. @worker_src.setter
  154. def worker_src(self, value: str | None) -> None: ...
  155. @worker_src.deleter
  156. def worker_src(self) -> None: ...
  157. provided: bool
  158. def __init__(
  159. self,
  160. values: Mapping[str, str] | Iterable[tuple[str, str]] = (),
  161. on_update: Callable[[ContentSecurityPolicy], None] | None = None,
  162. ) -> None: ...
  163. def _get_value(self, key: str) -> str | None: ...
  164. def _set_value(self, key: str, value: str) -> None: ...
  165. def _del_value(self, key: str) -> None: ...
  166. def to_header(self) -> str: ...