Newer Version Available
CspTrustedSite
Represents a CSP Trusted Site. The Lightning Component framework uses Content Security Policy (CSP), which is a W3C standard, to control the source of content that can be loaded on a page. To use third-party APIs that make requests to an external (non-Salesforce) server, add the server as a CSP Trusted Site.
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 |
|---|---|---|
| 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). |
Usage
CSP is a Candidate Recommendation of the W3C working group on Web Application Security. The framework uses the Content-Security-Policy HTTP header recommended by the W3C. 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