Newer Version Available
CspTrustedSite
Declarative Metadata File Suffix and Directory Location
CspTrustedSite components are stored in the cspTrustedSites directory of the corresponding package directory. The file name matches the unique name of the trusted site, and the extension is .cspTrustedSite.
Version
CspTrustedSite components are available in API version 39.0 and later.
Fields
| Field | Field Type | Description |
|---|---|---|
| context | CspTrustedSiteContext (enumeration of type string) | Declares the scope of trust for the listed third-party host.
For custom Visualforce pages, content is restricted to CSP Trusted Sites only if the page’s cspHeader attribute is set to true. This field is available in API version 44.0 and later. |
| description | string | The description explaining what this trusted site is used for. |
| endpointUrl | string | Required. The URL for the trusted site. |
| isActive | boolean | Required. Indicates if the trusted site is active (true) or not (false). |
| isApplicableToConnectSrc | boolean | Indicates if Lightning components can load URLs using script interfaces from this site (true) or not (false). This field has a default value of false. This field is available in API version 48.0 and later. |
| isApplicableToFontSrc | boolean | Indicates if Lightning components can load fonts from this site (true) or not (false). This field has a default value of false. This field is available in API version 48.0 and later. |
| isApplicableToFrameSrc | boolean | Indicates if Lightning components can load resources contained in <iframe> elements from this site (true) or not (false). This field has a default value of false. This field is available in API version 48.0 and later. |
| isApplicableToImgSrc | boolean | Indicates if Lightning components can load images from this site (true) or not (false). This field has a default value of false. This field is available in API version 48.0 and later. |
| isApplicableToMediaSrc | boolean | Indicates if Lightning components can load audio and video from this site (true) or not (false). This field has a default value of false. This field is available in API version 48.0 and later. |
| isApplicableToStyleSrc | boolean | Indicates if Lightning components can load style sheets from this site (true) or not (false). This field has a default value of false. This field is available in API version 48.0 and later. |
| mobileExtension | string | Reserved for future use. |
Usage
CSP is a W3C standard that defines rules to control the source of content that can be loaded on a page. All CSP rules work at the page level, and apply to all components and libraries. By default, the framework’s headers allow content to be loaded only from secure (HTTPS) URLs and forbid XHR requests from JavaScript.
- connect-src
- frame-src
- img-src
- style-src
- font-src
- media-src
Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.