How to create CSP compatiable templates for KendoNotification?

1 Answer 68 Views
Notification Templates
Aaron
Top achievements
Rank 1
Aaron asked on 11 Jul 2023, 04:41 PM | edited on 12 Jul 2023, 04:14 PM

Wondering if someone can point out how to use CSP compatible templates with KendoNotifications.

Here is kendo's demo https://demos.telerik.com/kendo-ui/notification/templates.

 

I've added a content-policy without 'unsafe-eval' included. https://dojo.telerik.com/urImEZAk

Is there a way to convert these templates to be CSP compatible while keeping them in the script statement instead of having the html inside the kendoNotification initialize? The kendo documentation doesn't have many examples. https://docs.telerik.com/kendo-ui/framework/templates/get-started-csp-templates

This works, but would be nice to be able to separate the templates. https://dojo.telerik.com/urImEZAk/4

Thanks.

1 Answer, 1 is accepted

Sort by
0
Zornitsa
Telerik team
answered on 14 Jul 2023, 12:10 PM

Hi Aaron,

I am afraid that there is no such way for keeping the templates in the external script tags while also being compliant with the Content Security Policy. You should consider deciding upon only one case that is more suitable for you. Providing that you prefer to continue using the previous syntax, the templates could not be CSP-compatible. Accordingly, in case you consider CSP compliance to be more important, you should begin using CSP-compatible functional templates. 

Here is an article that explains the most recent circumstances when using CSP-compatible templates. Hope the provided information would be helpful for you.  

Regards,
Zornitsa
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Tags
Notification Templates
Asked by
Aaron
Top achievements
Rank 1
Answers by
Zornitsa
Telerik team
Share this question
or