effectiveDirectives.tsx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import {t} from 'sentry/locale';
  2. const effectiveDirectives = {
  3. 'base-uri': t(
  4. `The <code>base-uri</code> directive defines the URIs that a user agent
  5. may use as the document base URL. If this value is absent, then any URI
  6. is allowed. If this directive is absent, the user agent will use the
  7. value in the <code>&lt;base&gt;</code> element.`
  8. ),
  9. 'child-src': t(
  10. `The <code>child-src</code> directive defines the valid sources for
  11. web workers and nested browsing contexts loaded using elements such as
  12. <code>&lt;frame&gt;</code> and <code>&lt;iframe&gt;</code>.`
  13. ),
  14. 'connect-src': t(
  15. `The <code>connect-src</code> directive defines valid sources for fetch,
  16. <code>XMLHttpRequest</code>, <code>WebSocket</code>, and
  17. <code>EventSource</code> connections.`
  18. ),
  19. 'font-src': t(
  20. `The <code>font-src</code> directive specifies valid sources for fonts
  21. loaded using <code>@font-face</code>.`
  22. ),
  23. 'form-action': t(
  24. `The <code>form-action</code> directive specifies valid endpoints for
  25. <code>&lt;form&gt;</code> submissions.`
  26. ),
  27. 'frame-ancestors': t(
  28. `The <code>frame-ancestors</code> directive specifies valid parents that
  29. may embed a page using the <code>&lt;frame&gt;</code> and
  30. <code>&lt;iframe&gt;</code> elements.`
  31. ),
  32. 'img-src': t(
  33. `The <code>img-src</code> directive specifies valid sources of images and
  34. favicons.`
  35. ),
  36. 'prefetch-src': t(
  37. `The <code>prefetch-src</code> directive restricts the URLs
  38. from which resources may be prefetched or prerendered.`
  39. ),
  40. 'manifest-src': t(
  41. `The <code>manifest-src</code> directive specifies which manifest can be
  42. applied to the resource.`
  43. ),
  44. 'media-src': t(
  45. `The <code>media-src</code> directive specifies valid sources for loading
  46. media using the <code>&lt;audio&gt;</code> and <code>&lt;video&gt;</code>
  47. elements.`
  48. ),
  49. 'object-src': t(
  50. `The <code>object-src</code> directive specifies valid sources for the
  51. <code>&lt;object&gt;</code>, <code>&lt;embed&gt;</code>, and
  52. <code>&lt;applet&gt;</code> elements.`
  53. ),
  54. 'plugin-types': t(
  55. `The <code>plugin-types</code> directive specifies the valid plugins that
  56. the user agent may invoke.`
  57. ),
  58. referrer: t(
  59. `The <code>referrer</code> directive specifies information in the
  60. <code>Referer</code> header for links away from a page.`
  61. ),
  62. 'script-src': t(
  63. `The <code>script-src</code> directive specifies valid sources
  64. for JavaScript. When either the <code>script-src</code> or the
  65. <code>default-src</code> directive is included, inline script and
  66. <code>eval()</code> are disabled unless you specify 'unsafe-inline'
  67. and 'unsafe-eval', respectively.`
  68. ),
  69. 'script-src-elem': t(
  70. `The <code>script-src-elem</code> directive applies to all script requests
  71. and element contents. It does not apply to scripts defined in attributes.`
  72. ),
  73. 'script-src-attr': t(
  74. `The <code>script-src-attr</code> directive applies to event handlers and, if present,
  75. it will override the <code>script-src</code> directive for relevant checks.`
  76. ),
  77. 'style-src': t(
  78. `The <code>style-src</code> directive specifies valid sources for
  79. stylesheets. This includes both externally-loaded stylesheets and inline
  80. use of the <code>&lt;style&gt;</code> element and HTML style attributes.
  81. Stylesheets from sources that aren't included in the source list are not
  82. requested or loaded. When either the <code>style-src</code> or the
  83. <code>default-src</code> directive is included, inline use of the
  84. <code>&lt;style&gt;</code> element and HTML style attributes are disabled
  85. unless you specify 'unsafe-inline'.`
  86. ),
  87. 'style-src-elem': t(
  88. `The <code>style-src-elem</code> directive applies to all styles except
  89. those defined in inline attributes.`
  90. ),
  91. 'style-src-attr': t(
  92. `The <code>style-src-attr</code> directive applies to inline style attributes and, if present,
  93. it will override the <code>style-src</code> directive for relevant checks.`
  94. ),
  95. 'frame-src': t(
  96. `The <code>frame-src</code> directive specifies valid sources for nested
  97. browsing contexts loading using elements such as
  98. <code>&lt;frame&gt;</code> and <code>&lt;iframe&gt;</code>.`
  99. ),
  100. 'worker-src': t(
  101. `The <code>worker-src</code> directive specifies valid sources for
  102. <code>Worker<code>, <code>SharedWorker</code>, or
  103. <code>ServiceWorker</code> scripts.`
  104. ),
  105. };
  106. export default effectiveDirectives;