Specify Content Security Policy (CSP) directives for your dynamic plugin using the contentSecurityPolicy field in ConsolePluginSpec. CSP restricts which sources supply scripts, styles, images, and fonts, mitigating risks for plugins loading resources externally.
|
The console currently uses the |
A Content Security Policy (CSP) is delivered to the browser in the Content-Security-Policy-Report-Only response header. The policy is specified as a series of directives and values. Each directive type serves a different purpose, and each directive can have a list of values representing allowed sources.
The supported directive types include DefaultSrc, ScriptSrc, StyleSrc, ImgSrc, and FontSrc. These directives allow you to specify valid sources for loading different types of content for your plugin. Each directive type serves a different purpose. For example, ScriptSrc defines valid JavaScript sources, while ImgSrc controls where images can be loaded from.
Each directive can have a list of values representing allowed sources. For example, ScriptSrc can specify multiple external scripts. These values are restricted to 1024 characters and cannot include whitespace, commas, or semicolons. Additionally, single-quoted strings and wildcard characters (*) are disallowed.