Skip to content

Commit b4cc59f

Browse files
committed
docs(common): Update CSP documentation
1 parent 60d1c6f commit b4cc59f

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,10 @@ baseurl: /blazor-ui
673673
enable_blazorRepl: true
674674

675675
## Latest UI for Blazor version. Used in some articles
676-
uiForBlazorLatestVersion: "6.2.0"
676+
uiForBlazorLatestVersion: "7.0.0"
677677

678678
## Compatible theme version for CDN URLs
679-
themesVersion: "8.2.1"
679+
themesVersion: "9.1.0"
680680

681681
## Product
682682
product: "Telerik UI for Blazor"

troubleshooting/csp.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,42 @@ Telerik UI for Blazor components need the following exceptions to strict CSP. So
2828

2929
* Allow inline styles (`'unsafe-inline'`) to use component parameters such as `Width`, `Height`, `RowHeight`, `ItemHeight`, `Top`, `Left`, etc. In addition, some components rely on inline styles for their rich functionality and UX.
3030
* Allow data URIs (`data:`) for images that are embedded in the [CSS themes]({%slug themes-overview%}). These images are used for styled checkboxes and radio buttons, Slider ticks, and others.
31-
* *(starting from version 6.0.0)* Allow script evaluation (`'unsafe-eval'`), which is required by the [Spreadsheet]({%slug spreadsheet-overview%}) for cell validation and formula compilation. If you don't use the Spreadsheet component in your Blazor app, then check section [Build CSP Compliant telerik-blazor.js](#build-csp-compliant-telerik-blazorjs) below.
32-
* Allow `https://blazor.cdn.telerik.com` as a source when using [the Telerik CDN]({%slug common-features-cdn%}) for styles or scripts.
31+
* (optional) Allow `https://blazor.cdn.telerik.com` as a source when using [the Telerik CDN]({%slug common-features-cdn%}) for styles or scripts.
32+
* (optional) Allow `https://unpkg.com` as a source when using it as a <a href="https://www.telerik.com/design-system/docs/themes/get-started/introduction/#available-themes" target="_blank">CDN for styles</a>.
33+
34+
### Legacy Settings
3335

3436
The following items concern older product versions:
3537

36-
* *(up to version 4.4.0)* Allow `unsafe-eval` to use [Chart label templates]({%slug components/chart/label-template-format%}). These templates used to rely on `eval()`. Since version 4.5.0, the Chart labels support a different template mechanism, which doesn't require `unsafe-eval`.
38+
* *(for versions 6.x)* Allow script evaluation (`'unsafe-eval'`), which is required by the [Spreadsheet]({%slug spreadsheet-overview%}) for cell validation and formula compilation. If you don't use the Spreadsheet component in your Blazor app, you can [build a CSP compliant `telerik-blazor.js` file without the Spreadsheet]({%slug common-kb-remove-components-from-telerik-blazor-js%}).
3739
* *(up to version 4.6.0)* Allow `data:` URIs for `font-src` to use [font icons]({%slug common-features-icons%}). Later versions use a separate file for the `WebComponentsIcons` icon font. This font file is referenced by the [font icon stylesheet]({%slug common-features-icons%}#font-icon-stylesheet).
40+
* *(up to version 4.4.0)* Allow `unsafe-eval` to use [Chart label templates]({%slug components/chart/label-template-format%}). These templates used to rely on `eval()`. Since version 4.5.0, the Chart labels support a different template mechanism, which doesn't require `unsafe-eval`.
3841

39-
## Example
42+
## Examples
4043

41-
The CSP policy directives below ensure that the Telerik Blazor components work as expected. You can remove the Telerik domain or `font-src` if you don't use our CDN or font icons.
44+
The CSP policy directives below ensure that the Telerik Blazor components work as expected.
4245

43-
>caption CSP for Telerik UI for Blazor {{site.uiForBlazorLatestVersion}}
46+
>caption CSP for Telerik UI for Blazor {{site.uiForBlazorLatestVersion}} with SVG icon support and without CDN
4447
4548
<div class="skip-repl"></div>
4649

4750
````HTML
4851
<meta http-equiv="Content-Security-Policy" content="
49-
script-src 'self' 'unsafe-eval' https://blazor.cdn.telerik.com;
50-
style-src 'self' 'unsafe-inline' https://blazor.cdn.telerik.com;
52+
script-src 'self';
53+
style-src 'self' 'unsafe-inline';
5154
img-src 'self' data:;
52-
font-src 'self' https://blazor.cdn.telerik.com;
5355
" />
5456
````
5557

56-
## Build CSP Compliant telerik-blazor.js
58+
>caption CSP for Telerik UI for Blazor {{site.uiForBlazorLatestVersion}} with CDN and font icon support
59+
60+
<div class="skip-repl"></div>
5761

58-
If strict CSP compliance is a hard requirement and your Blazor app is not using the Spreadsheet component, then you can [rebuild the `telerik-blazor.js` file without the Spreadsheet component]({%slug common-kb-remove-components-from-telerik-blazor-js%}).
62+
````HTML
63+
<meta http-equiv="Content-Security-Policy" content="
64+
script-src 'self' https://blazor.cdn.telerik.com https://unpkg.com;
65+
style-src 'self' 'unsafe-inline' https://blazor.cdn.telerik.com https://unpkg.com;
66+
img-src 'self' data:;
67+
font-src 'self' https://blazor.cdn.telerik.com https://unpkg.com;
68+
" />
69+
````

0 commit comments

Comments
 (0)