Log in
Model

FetchPolicy

Magento\Csp\Model\Policy\FetchPolicy

What it does

This class represents a Content Security Policy (CSP) fetch directive in Magento 2, defining what sources are allowed to load resources like scripts, styles, images, and fonts.

Developers use this to configure CSP rules, specifying allowed hosts, schemes (https:, data:), inline content, eval usage, nonces, and hashes to control where resources can be loaded from for enhanced security.

Public Methods

  • getId()
  • getHostSources()
  • getSchemeSources()
  • isSelfAllowed()
  • isInlineAllowed()
  • isEvalAllowed()
  • isNoneAllowed()
  • getValue()
  • getNonceValues()
  • getHashes()
  • isDynamicAllowed()
  • areEventHandlersAllowed()