@ui5/mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +201 -0
- package/LICENSES/Apache-2.0.txt +73 -0
- package/README.md +131 -0
- package/bin/ui5mcp.js +2 -0
- package/lib/Context.d.ts +28 -0
- package/lib/Context.js +71 -0
- package/lib/Context.js.map +1 -0
- package/lib/api.d.ts +3 -0
- package/lib/api.js +3 -0
- package/lib/api.js.map +1 -0
- package/lib/cli.d.ts +1 -0
- package/lib/cli.js +12 -0
- package/lib/cli.js.map +1 -0
- package/lib/registerTools.d.ts +133 -0
- package/lib/registerTools.js +59 -0
- package/lib/registerTools.js.map +1 -0
- package/lib/resources/documentation/getDocumentation.d.ts +18 -0
- package/lib/resources/documentation/getDocumentation.js +70 -0
- package/lib/resources/documentation/getDocumentation.js.map +1 -0
- package/lib/server.d.ts +10 -0
- package/lib/server.js +113 -0
- package/lib/server.js.map +1 -0
- package/lib/tools/create_ui5_app/ODataMetadata.d.ts +55 -0
- package/lib/tools/create_ui5_app/ODataMetadata.js +99 -0
- package/lib/tools/create_ui5_app/ODataMetadata.js.map +1 -0
- package/lib/tools/create_ui5_app/createSuccessMessage.d.ts +13 -0
- package/lib/tools/create_ui5_app/createSuccessMessage.js +45 -0
- package/lib/tools/create_ui5_app/createSuccessMessage.js.map +1 -0
- package/lib/tools/create_ui5_app/create_ui5_app.d.ts +8 -0
- package/lib/tools/create_ui5_app/create_ui5_app.js +273 -0
- package/lib/tools/create_ui5_app/create_ui5_app.js.map +1 -0
- package/lib/tools/create_ui5_app/index.d.ts +3 -0
- package/lib/tools/create_ui5_app/index.js +58 -0
- package/lib/tools/create_ui5_app/index.js.map +1 -0
- package/lib/tools/create_ui5_app/isValidUrl.d.ts +16 -0
- package/lib/tools/create_ui5_app/isValidUrl.js +59 -0
- package/lib/tools/create_ui5_app/isValidUrl.js.map +1 -0
- package/lib/tools/create_ui5_app/schema.d.ts +135 -0
- package/lib/tools/create_ui5_app/schema.js +67 -0
- package/lib/tools/create_ui5_app/schema.js.map +1 -0
- package/lib/tools/create_ui5_app/templateProcessor.d.ts +67 -0
- package/lib/tools/create_ui5_app/templateProcessor.js +59 -0
- package/lib/tools/create_ui5_app/templateProcessor.js.map +1 -0
- package/lib/tools/create_ui5_app/ui5Version.d.ts +2 -0
- package/lib/tools/create_ui5_app/ui5Version.js +6 -0
- package/lib/tools/create_ui5_app/ui5Version.js.map +1 -0
- package/lib/tools/get_api_reference/createUriForSymbol.d.ts +2 -0
- package/lib/tools/get_api_reference/createUriForSymbol.js +49 -0
- package/lib/tools/get_api_reference/createUriForSymbol.js.map +1 -0
- package/lib/tools/get_api_reference/getApiReference.d.ts +10 -0
- package/lib/tools/get_api_reference/getApiReference.js +51 -0
- package/lib/tools/get_api_reference/getApiReference.js.map +1 -0
- package/lib/tools/get_api_reference/index.d.ts +3 -0
- package/lib/tools/get_api_reference/index.js +38 -0
- package/lib/tools/get_api_reference/index.js.map +1 -0
- package/lib/tools/get_api_reference/lib/ApiReferenceProvider.d.ts +85 -0
- package/lib/tools/get_api_reference/lib/ApiReferenceProvider.js +452 -0
- package/lib/tools/get_api_reference/lib/ApiReferenceProvider.js.map +1 -0
- package/lib/tools/get_api_reference/lib/apiReferenceResources.d.ts +18 -0
- package/lib/tools/get_api_reference/lib/apiReferenceResources.js +138 -0
- package/lib/tools/get_api_reference/lib/apiReferenceResources.js.map +1 -0
- package/lib/tools/get_api_reference/lib/formatSymbol.d.ts +24 -0
- package/lib/tools/get_api_reference/lib/formatSymbol.js +109 -0
- package/lib/tools/get_api_reference/lib/formatSymbol.js.map +1 -0
- package/lib/tools/get_api_reference/schema.d.ts +16 -0
- package/lib/tools/get_api_reference/schema.js +12 -0
- package/lib/tools/get_api_reference/schema.js.map +1 -0
- package/lib/tools/get_guidelines/guidelines.d.ts +1 -0
- package/lib/tools/get_guidelines/guidelines.js +6 -0
- package/lib/tools/get_guidelines/guidelines.js.map +1 -0
- package/lib/tools/get_guidelines/index.d.ts +3 -0
- package/lib/tools/get_guidelines/index.js +30 -0
- package/lib/tools/get_guidelines/index.js.map +1 -0
- package/lib/tools/get_project_info/getProjectInfo.d.ts +2 -0
- package/lib/tools/get_project_info/getProjectInfo.js +205 -0
- package/lib/tools/get_project_info/getProjectInfo.js.map +1 -0
- package/lib/tools/get_project_info/index.d.ts +3 -0
- package/lib/tools/get_project_info/index.js +28 -0
- package/lib/tools/get_project_info/index.js.map +1 -0
- package/lib/tools/get_project_info/schema.d.ts +87 -0
- package/lib/tools/get_project_info/schema.js +28 -0
- package/lib/tools/get_project_info/schema.js.map +1 -0
- package/lib/tools/get_version_info/getVersionInfo.d.ts +8 -0
- package/lib/tools/get_version_info/getVersionInfo.js +41 -0
- package/lib/tools/get_version_info/getVersionInfo.js.map +1 -0
- package/lib/tools/get_version_info/index.d.ts +9 -0
- package/lib/tools/get_version_info/index.js +33 -0
- package/lib/tools/get_version_info/index.js.map +1 -0
- package/lib/tools/get_version_info/schema.d.ts +66 -0
- package/lib/tools/get_version_info/schema.js +16 -0
- package/lib/tools/get_version_info/schema.js.map +1 -0
- package/lib/tools/get_version_info/types.d.ts +5 -0
- package/lib/tools/get_version_info/types.js +2 -0
- package/lib/tools/get_version_info/types.js.map +1 -0
- package/lib/tools/run_ui5_linter/index.d.ts +3 -0
- package/lib/tools/run_ui5_linter/index.js +86 -0
- package/lib/tools/run_ui5_linter/index.js.map +1 -0
- package/lib/tools/run_ui5_linter/migrationGuides.d.ts +6 -0
- package/lib/tools/run_ui5_linter/migrationGuides.js +88 -0
- package/lib/tools/run_ui5_linter/migrationGuides.js.map +1 -0
- package/lib/tools/run_ui5_linter/resultContext.d.ts +3 -0
- package/lib/tools/run_ui5_linter/resultContext.js +236 -0
- package/lib/tools/run_ui5_linter/resultContext.js.map +1 -0
- package/lib/tools/run_ui5_linter/runUi5Linter.d.ts +2 -0
- package/lib/tools/run_ui5_linter/runUi5Linter.js +72 -0
- package/lib/tools/run_ui5_linter/runUi5Linter.js.map +1 -0
- package/lib/tools/run_ui5_linter/schema.d.ts +340 -0
- package/lib/tools/run_ui5_linter/schema.js +55 -0
- package/lib/tools/run_ui5_linter/schema.js.map +1 -0
- package/lib/utils/cdnHelper.d.ts +9 -0
- package/lib/utils/cdnHelper.js +50 -0
- package/lib/utils/cdnHelper.js.map +1 -0
- package/lib/utils/dataStorageHelper.d.ts +2 -0
- package/lib/utils/dataStorageHelper.js +65 -0
- package/lib/utils/dataStorageHelper.js.map +1 -0
- package/lib/utils/ui5Framework.d.ts +4 -0
- package/lib/utils/ui5Framework.js +6 -0
- package/lib/utils/ui5Framework.js.map +1 -0
- package/lib/utils.d.ts +10 -0
- package/lib/utils.js +87 -0
- package/lib/utils.js.map +1 -0
- package/npm-shrinkwrap.json +7880 -0
- package/package.json +121 -0
- package/resources/docs/1.136.7/00737d6c1b864dc3ab72ef56611491c4.md +155 -0
- package/resources/docs/1.136.7/0187ea5e2eff4166b0453b9dcc8fc64f.md +164 -0
- package/resources/docs/1.136.7/032be2cb2e1d4115af20862673bedcdb.md +12 -0
- package/resources/docs/1.136.7/28fcd55b04654977b63dacbee0552712.md +317 -0
- package/resources/docs/1.136.7/676b636446c94eada183b1218a824717.md +135 -0
- package/resources/docs/1.136.7/a87ca843bcee469f82a9072927a7dcdb.md +355 -0
- package/resources/docs/1.136.7/b0fb4de7364f4bcbb053a99aa645affe.md +126 -0
- package/resources/docs/1.136.7/fe1a6dba940e479fb7c3bc753f92b28c.md +670 -0
- package/resources/docs/1.136.7/index.json +58 -0
- package/resources/guidelines.md +104 -0
- package/resources/migrationGuides/deprecated-controller-factory.md +116 -0
- package/resources/migrationGuides/deprecated-getLibraryResourceBundle.md +62 -0
- package/resources/migrationGuides/deprecated-jquery-sap-require.md +141 -0
- package/resources/migrationGuides/deprecated-messagePage.md +162 -0
- package/resources/migrationGuides/deprecated-table-table-property.md +154 -0
- package/resources/template-js/LICENSE +201 -0
- package/resources/template-js/README.md +87 -0
- package/resources/template-js/_.editorconfig +22 -0
- package/resources/template-js/_.gitignore +17 -0
- package/resources/template-js/eslint.config.js +68 -0
- package/resources/template-js/karma-ci-cov.conf.js +20 -0
- package/resources/template-js/karma-ci.conf.js +9 -0
- package/resources/template-js/karma.conf.js +9 -0
- package/resources/template-js/package.json +34 -0
- package/resources/template-js/ui5-dist.yaml +18 -0
- package/resources/template-js/ui5.yaml +24 -0
- package/resources/template-js/webapp/Component.js +41 -0
- package/resources/template-js/webapp/controller/App.controller.js +10 -0
- package/resources/template-js/webapp/controller/BaseController.js +67 -0
- package/resources/template-js/webapp/controller/Main.controller.js +14 -0
- package/resources/template-js/webapp/i18n/i18n.properties +3 -0
- package/resources/template-js/webapp/i18n/i18n_en.properties +3 -0
- package/resources/template-js/webapp/index-cdn.html +34 -0
- package/resources/template-js/webapp/index.html +34 -0
- package/resources/template-js/webapp/manifest.json +103 -0
- package/resources/template-js/webapp/model/formatter.js +9 -0
- package/resources/template-js/webapp/model/models.js +11 -0
- package/resources/template-js/webapp/test/Test.qunit.html +16 -0
- package/resources/template-js/webapp/test/integration/HelloJourney.js +85 -0
- package/resources/template-js/webapp/test/integration/opaTests.qunit.js +1 -0
- package/resources/template-js/webapp/test/integration/pages/Main.js +112 -0
- package/resources/template-js/webapp/test/testsuite.qunit.html +18 -0
- package/resources/template-js/webapp/test/testsuite.qunit.js +37 -0
- package/resources/template-js/webapp/test/unit/controller/Main.qunit.js +11 -0
- package/resources/template-js/webapp/test/unit/unitTests.qunit.js +1 -0
- package/resources/template-js/webapp/test-lt1_124/integration/HelloJourney.js +85 -0
- package/resources/template-js/webapp/test-lt1_124/integration/opaTests.qunit.html +31 -0
- package/resources/template-js/webapp/test-lt1_124/integration/opaTests.qunit.js +11 -0
- package/resources/template-js/webapp/test-lt1_124/integration/pages/Main.js +112 -0
- package/resources/template-js/webapp/test-lt1_124/testsuite.qunit.html +13 -0
- package/resources/template-js/webapp/test-lt1_124/testsuite.qunit.js +9 -0
- package/resources/template-js/webapp/test-lt1_124/unit/controller/Main.qunit.js +11 -0
- package/resources/template-js/webapp/test-lt1_124/unit/unitTests.qunit.html +30 -0
- package/resources/template-js/webapp/test-lt1_124/unit/unitTests.qunit.js +12 -0
- package/resources/template-js/webapp/view/App.view.xml +9 -0
- package/resources/template-js/webapp/view/Main.view.xml +90 -0
- package/resources/template-ts/LICENSE +201 -0
- package/resources/template-ts/README.md +101 -0
- package/resources/template-ts/_.editorconfig +23 -0
- package/resources/template-ts/_.gitignore +18 -0
- package/resources/template-ts/_.nycrc.json +7 -0
- package/resources/template-ts/_tsconfig.json +21 -0
- package/resources/template-ts/eslint.config.mjs +27 -0
- package/resources/template-ts/package.json +40 -0
- package/resources/template-ts/ui5-coverage.yaml +40 -0
- package/resources/template-ts/ui5-dist.yaml +18 -0
- package/resources/template-ts/ui5.yaml +27 -0
- package/resources/template-ts/webapp/Component.ts +49 -0
- package/resources/template-ts/webapp/controller/App.controller.ts +11 -0
- package/resources/template-ts/webapp/controller/BaseController.ts +83 -0
- package/resources/template-ts/webapp/controller/Main.controller.ts +19 -0
- package/resources/template-ts/webapp/i18n/i18n.properties +3 -0
- package/resources/template-ts/webapp/i18n/i18n_en.properties +3 -0
- package/resources/template-ts/webapp/index-cdn.html +35 -0
- package/resources/template-ts/webapp/index.html +35 -0
- package/resources/template-ts/webapp/manifest.json +105 -0
- package/resources/template-ts/webapp/model/formatter.ts +5 -0
- package/resources/template-ts/webapp/model/models.ts +15 -0
- package/resources/template-ts/webapp/test/Test.qunit.html +16 -0
- package/resources/template-ts/webapp/test/integration/HelloJourney.ts +84 -0
- package/resources/template-ts/webapp/test/integration/opaTests.qunit.ts +2 -0
- package/resources/template-ts/webapp/test/integration/pages/MainPage.ts +112 -0
- package/resources/template-ts/webapp/test/testsuite.qunit.html +18 -0
- package/resources/template-ts/webapp/test/testsuite.qunit.ts +33 -0
- package/resources/template-ts/webapp/test/unit/controller/Main.qunit.ts +8 -0
- package/resources/template-ts/webapp/test/unit/unitTests.qunit.ts +2 -0
- package/resources/template-ts/webapp/test-lt1_124/integration/HelloJourney.ts +86 -0
- package/resources/template-ts/webapp/test-lt1_124/integration/opaTests.qunit.html +34 -0
- package/resources/template-ts/webapp/test-lt1_124/integration/opaTests.qunit.ts +8 -0
- package/resources/template-ts/webapp/test-lt1_124/integration/pages/MainPage.ts +112 -0
- package/resources/template-ts/webapp/test-lt1_124/testsuite.qunit.html +13 -0
- package/resources/template-ts/webapp/test-lt1_124/testsuite.qunit.ts +9 -0
- package/resources/template-ts/webapp/test-lt1_124/unit/controller/Main.qunit.ts +8 -0
- package/resources/template-ts/webapp/test-lt1_124/unit/unitTests.qunit.html +37 -0
- package/resources/template-ts/webapp/test-lt1_124/unit/unitTests.qunit.ts +8 -0
- package/resources/template-ts/webapp/view/App.view.xml +9 -0
- package/resources/template-ts/webapp/view/Main.view.xml +90 -0
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
<link rel="stylesheet" type="text/css" href="../css/sap-icons.css"/>
|
|
2
|
+
|
|
3
|
+
# Content Security Policy
|
|
4
|
+
|
|
5
|
+
Content Security Policy \(CSP\) adds an additional layer of security that can detect and mitigate certain types of attacks, such as cross-site scripting and data injection.
|
|
6
|
+
|
|
7
|
+
CSP restricts the sources from which the browser is allowed to load resources, such as scripts, fonts, and images:
|
|
8
|
+
|
|
9
|
+
- CSP mitigates and reports XSS attacks; CSP-compatible browsers only execute scripts loaded in source files that are received from allowed sources.
|
|
10
|
+
|
|
11
|
+
- CSP also mitigates packet sniffing attacks by specifying the protocols that may be used on the web server, for example, specifying that content must be loaded from HTTPS.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
CSP is either enabled via a configuration in the web server to return the Content-Security-Policy HTTP header \(preferred solution\), or via the `<meta>` element in the meta tags of an HTML page.
|
|
15
|
+
|
|
16
|
+
For generic information about CSP, see [https://www.w3.org/TR/CSP2/](https://www.w3.org/TR/CSP2/).
|
|
17
|
+
|
|
18
|
+
## CSP for SAPUI5 - Dos and Don'ts
|
|
19
|
+
|
|
20
|
+
For SAPUI5, we recommend that developers build their apps CSP-compliant, in particular regarding the loading of resources and the use of inline scripts.
|
|
21
|
+
|
|
22
|
+
### Policies Without `script-src 'unsafe-inline'`
|
|
23
|
+
|
|
24
|
+
To build CSP-compliant SAPUI5 without inline scripts, avoid the following:
|
|
25
|
+
|
|
26
|
+
- `<script>` elements with inlined source code
|
|
27
|
+
|
|
28
|
+
- Inline event handlers
|
|
29
|
+
|
|
30
|
+
- `javascript:` URLs
|
|
31
|
+
|
|
32
|
+
- `document.write()`, `createElement('script')`, and so on, if they are used to create inline scripts. Creating script references, such as `<script src="..."></script>`, or non-script content with them is okay.
|
|
33
|
+
|
|
34
|
+
### Policies Without `script-src 'unsafe-eval'`
|
|
35
|
+
|
|
36
|
+
`eval()` is currently still required in some parts of SAPUI5 for synchronous loading and other functionality. However, we recommend loading JavaScript resources asynchronously, which also avoids the use of `eval()`. For more information about asynchronous loading, see [Modules and Dependencies](../04_Essentials/modules-and-dependencies-91f23a7.md).For more information about avoiding synchronous APIs that might lead to synchronous loading, see [Deprecated Factories Replacement](../04_Essentials/deprecated-factories-replacement-491bd9c.md).
|
|
37
|
+
|
|
38
|
+
For a CSP policy that doesn't allow `eval()` you must also avoid the following elements when developing SAPUI5 apps:
|
|
39
|
+
|
|
40
|
+
- `new Function()`
|
|
41
|
+
|
|
42
|
+
- `<setTimeout(<non-fn>)`
|
|
43
|
+
|
|
44
|
+
This will be ignored silently and not create a timer without `'unsafe-eval'`, that is, `<non-fn>` is never executed. `setTimeout(<fn>)` works with and without `'unsafe-eval'`.
|
|
45
|
+
|
|
46
|
+
- `setInterval(<non-fn>)`
|
|
47
|
+
|
|
48
|
+
This will be ignored silently and not create a repeated timer without `'unsafe-eval'`, that is, the `<non-fn>` is never executed. `setInterval(<fn>)` works with and without the `'unsafe-eval'`.
|
|
49
|
+
|
|
50
|
+
## Test Your Policies with `Report-Only`
|
|
51
|
+
|
|
52
|
+
> ### Note:
|
|
53
|
+
> CSP is a complex subject with many interdependencies and dynamics. Example: A CSP-compliant control or function in your app might have a dependency to a deprecated API that is not fully CSP-compliant. In this case you may need to add `'unsafe-eval'` to the `script-src` directive. That's why it's important to test your policies to check this.
|
|
54
|
+
|
|
55
|
+
To test policies without enforcing them, set up CSP with the `Content-Security-Policy-Report-Only` response header and test with the **most restrictive** policy. Monitor the reports to add missing sources \(see [Directives](content-security-policy-fe1a6db.md#loiofe1a6dba940e479fb7c3bc753f92b28c__directives). When you have found the desired policy, replace the `Content-Security-Policy-Report-Only` header with `Content-Security-Policy` to enforce the policy.
|
|
56
|
+
|
|
57
|
+
## Directives
|
|
58
|
+
|
|
59
|
+
To run an app in an environment in which CSP has been enabled, SAPUI5 requires the following CSP directives and source entries:
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
<table>
|
|
63
|
+
<tr>
|
|
64
|
+
<th valign="top" rowspan="2">
|
|
65
|
+
|
|
66
|
+
Directive
|
|
67
|
+
|
|
68
|
+
</th>
|
|
69
|
+
<th valign="top" align="center" colspan="4">
|
|
70
|
+
|
|
71
|
+
Sources Required by the SAPUI5 Framework
|
|
72
|
+
|
|
73
|
+
</th>
|
|
74
|
+
<th valign="top" align="center">
|
|
75
|
+
|
|
76
|
+
Sources Required by the App
|
|
77
|
+
|
|
78
|
+
</th>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr>
|
|
81
|
+
<th valign="top">
|
|
82
|
+
|
|
83
|
+
<code><source hosting SAPUI5></code>
|
|
84
|
+
|
|
85
|
+
\(equals `'self'` if SAPUI5 is hosted with the app\)
|
|
86
|
+
|
|
87
|
+
</th>
|
|
88
|
+
<th valign="top">
|
|
89
|
+
|
|
90
|
+
`data:`
|
|
91
|
+
|
|
92
|
+
</th>
|
|
93
|
+
<th valign="top">
|
|
94
|
+
|
|
95
|
+
`blob:`
|
|
96
|
+
|
|
97
|
+
</th>
|
|
98
|
+
<th valign="top">
|
|
99
|
+
|
|
100
|
+
Other Sources
|
|
101
|
+
|
|
102
|
+
</th>
|
|
103
|
+
<th valign="top">
|
|
104
|
+
|
|
105
|
+
Custom Sources \(Including 'self' for the App's Own Origin\)
|
|
106
|
+
|
|
107
|
+
</th>
|
|
108
|
+
</tr>
|
|
109
|
+
<tr>
|
|
110
|
+
<td valign="top">
|
|
111
|
+
|
|
112
|
+
`script-src`
|
|
113
|
+
|
|
114
|
+
</td>
|
|
115
|
+
<td valign="top" align="center">
|
|
116
|
+
|
|
117
|
+
<span style="color:#007833;"><span class="SAP-icons-V5"></span></span>
|
|
118
|
+
|
|
119
|
+
</td>
|
|
120
|
+
<td valign="top">
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
</td>
|
|
125
|
+
<td valign="top">
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</td>
|
|
130
|
+
<td valign="top">
|
|
131
|
+
|
|
132
|
+
`'unsafe-eval'`
|
|
133
|
+
|
|
134
|
+
Required for synchronous loading of JavaScript resources.
|
|
135
|
+
|
|
136
|
+
Required for the following libraries:
|
|
137
|
+
|
|
138
|
+
- `sap.ca.ui` and scaffolding framework
|
|
139
|
+
- `sap.makit`
|
|
140
|
+
- `sap.me`
|
|
141
|
+
- `sap.ui.commons`
|
|
142
|
+
- `sap.ui.ux3`
|
|
143
|
+
- `sap.uiext.inbox`
|
|
144
|
+
- `sap.viz.*` \(deprecated part\)
|
|
145
|
+
- `sap.zen.*`
|
|
146
|
+
|
|
147
|
+
Most likely required for deprecated APIs, especially for programming model APIs, like old factories in the `sap.ui` namespace.
|
|
148
|
+
|
|
149
|
+
Certain libraries at least partly still require `'unsafe-eval'`, including the following:
|
|
150
|
+
|
|
151
|
+
- `sap.apf`
|
|
152
|
+
- `sap.collaboration`
|
|
153
|
+
- `sap.ovp`
|
|
154
|
+
- `sap.suite.ui.generic.template`
|
|
155
|
+
- `sap.rules.ui`
|
|
156
|
+
- `sap.ui.vbm`
|
|
157
|
+
- `sap.ushell`
|
|
158
|
+
|
|
159
|
+
The above list assumes that the app runs using library preloads \(recommended, see [Ensure that Library Preloads are Enabled](performance-speed-up-your-app-408b40e.md#loio408b40efed3c416681e1bd8cdd8910d4__section_LibraryPreloads)\). If the application runs without preloads, more libraries require `unsafe-eval`.
|
|
160
|
+
|
|
161
|
+
</td>
|
|
162
|
+
<td valign="top">
|
|
163
|
+
|
|
164
|
+
- Requires `'self'` for loading application resources.
|
|
165
|
+
- May require `'unsafe-inline'` or `'unsafe-eval'` depending on custom scripts.
|
|
166
|
+
|
|
167
|
+
</td>
|
|
168
|
+
</tr>
|
|
169
|
+
<tr>
|
|
170
|
+
<td valign="top">
|
|
171
|
+
|
|
172
|
+
`style-src`
|
|
173
|
+
|
|
174
|
+
</td>
|
|
175
|
+
<td valign="top" align="center">
|
|
176
|
+
|
|
177
|
+
<span style="color:#007833;"><span class="SAP-icons-V5"></span></span>
|
|
178
|
+
|
|
179
|
+
</td>
|
|
180
|
+
<td valign="top">
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
</td>
|
|
185
|
+
<td valign="top">
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
</td>
|
|
190
|
+
<td valign="top">
|
|
191
|
+
|
|
192
|
+
`'unsafe-inline'`
|
|
193
|
+
|
|
194
|
+
Required for the following libraries:
|
|
195
|
+
|
|
196
|
+
- `sap.ca.ui` and scaffolding framework
|
|
197
|
+
- `sap.makit`
|
|
198
|
+
- `sap.me`
|
|
199
|
+
- `sap.ui.richtexteditor`
|
|
200
|
+
- `sap.ui.commons`
|
|
201
|
+
- `sap.ui.ux3`
|
|
202
|
+
- `sap.uiext.inbox`
|
|
203
|
+
- `sap.viz.*` \(deprecated part\)
|
|
204
|
+
- `sap.zen.*`
|
|
205
|
+
|
|
206
|
+
Most likely required for deprecated APIs.
|
|
207
|
+
|
|
208
|
+
Certain libraries at least partly still require `'unsafe-inline'`, including:
|
|
209
|
+
|
|
210
|
+
- `sap.gantt`
|
|
211
|
+
- `sap.rules.ui`
|
|
212
|
+
- `sap.suite.ui.commons`
|
|
213
|
+
- `sap.ui.vbm`
|
|
214
|
+
- `sap.ui.vk`
|
|
215
|
+
- `sap.ushell`
|
|
216
|
+
|
|
217
|
+
</td>
|
|
218
|
+
<td valign="top">
|
|
219
|
+
|
|
220
|
+
- May require `'self'` and additional locations for application-specific styles and themes.
|
|
221
|
+
- Requires `'unsafe-inline'` for custom controls using inline styles.
|
|
222
|
+
|
|
223
|
+
</td>
|
|
224
|
+
</tr>
|
|
225
|
+
<tr>
|
|
226
|
+
<td valign="top">
|
|
227
|
+
|
|
228
|
+
`img-src`
|
|
229
|
+
|
|
230
|
+
</td>
|
|
231
|
+
<td valign="top" align="center">
|
|
232
|
+
|
|
233
|
+
<span style="color:#007833;"><span class="SAP-icons-V5"></span></span>
|
|
234
|
+
|
|
235
|
+
</td>
|
|
236
|
+
<td valign="top">
|
|
237
|
+
|
|
238
|
+
May be required by some specific SAPUI5 functionality.
|
|
239
|
+
|
|
240
|
+
</td>
|
|
241
|
+
<td valign="top">
|
|
242
|
+
|
|
243
|
+
May be required by some specific SAPUI5 functionality.
|
|
244
|
+
|
|
245
|
+
</td>
|
|
246
|
+
<td valign="top">
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
</td>
|
|
251
|
+
<td valign="top">
|
|
252
|
+
|
|
253
|
+
May require `'self'` or additional locations for application-specific images \(such as custom themes or images in the back end\).
|
|
254
|
+
|
|
255
|
+
</td>
|
|
256
|
+
</tr>
|
|
257
|
+
<tr>
|
|
258
|
+
<td valign="top">
|
|
259
|
+
|
|
260
|
+
`font-src`
|
|
261
|
+
|
|
262
|
+
</td>
|
|
263
|
+
<td valign="top" align="center">
|
|
264
|
+
|
|
265
|
+
<span style="color:#007833;"><span class="SAP-icons-V5"></span></span>
|
|
266
|
+
|
|
267
|
+
</td>
|
|
268
|
+
<td valign="top">
|
|
269
|
+
|
|
270
|
+
May be required by some specific SAPUI5 functionality.
|
|
271
|
+
|
|
272
|
+
</td>
|
|
273
|
+
<td valign="top">
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
</td>
|
|
278
|
+
<td valign="top">
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
</td>
|
|
283
|
+
<td valign="top">
|
|
284
|
+
|
|
285
|
+
May require `'self'` or additional locations for application-specific fonts.
|
|
286
|
+
|
|
287
|
+
</td>
|
|
288
|
+
</tr>
|
|
289
|
+
<tr>
|
|
290
|
+
<td valign="top">
|
|
291
|
+
|
|
292
|
+
`frame-src`
|
|
293
|
+
|
|
294
|
+
</td>
|
|
295
|
+
<td valign="top">
|
|
296
|
+
|
|
297
|
+
Required for using the support assistant and/or the diagnostics tool. Also required to avoid a fallback to `child-src`.\*
|
|
298
|
+
|
|
299
|
+
</td>
|
|
300
|
+
<td valign="top">
|
|
301
|
+
|
|
302
|
+
May be required by some specific SAPUI5 functionality.
|
|
303
|
+
|
|
304
|
+
</td>
|
|
305
|
+
<td valign="top">
|
|
306
|
+
|
|
307
|
+
May be required by some specific SAPUI5 functionality.
|
|
308
|
+
|
|
309
|
+
</td>
|
|
310
|
+
<td valign="top">
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
</td>
|
|
315
|
+
<td valign="top">
|
|
316
|
+
|
|
317
|
+
May require additional locations depending on the integration, application, or test scenario.
|
|
318
|
+
|
|
319
|
+
</td>
|
|
320
|
+
</tr>
|
|
321
|
+
<tr>
|
|
322
|
+
<td valign="top">
|
|
323
|
+
|
|
324
|
+
`worker-src`
|
|
325
|
+
|
|
326
|
+
</td>
|
|
327
|
+
<td valign="top" align="center">
|
|
328
|
+
|
|
329
|
+
<span style="color:#007833;"><span class="SAP-icons-V5"></span></span>
|
|
330
|
+
|
|
331
|
+
</td>
|
|
332
|
+
<td valign="top">
|
|
333
|
+
|
|
334
|
+
May be required by some specific SAPUI5 functionality.
|
|
335
|
+
|
|
336
|
+
</td>
|
|
337
|
+
<td valign="top">
|
|
338
|
+
|
|
339
|
+
May be required by some specific SAPUI5 functionality.
|
|
340
|
+
|
|
341
|
+
</td>
|
|
342
|
+
<td valign="top">
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
</td>
|
|
347
|
+
<td valign="top">
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
</td>
|
|
352
|
+
</tr>
|
|
353
|
+
<tr>
|
|
354
|
+
<td valign="top">
|
|
355
|
+
|
|
356
|
+
`child-src`\*\*
|
|
357
|
+
|
|
358
|
+
</td>
|
|
359
|
+
<td valign="top" align="center">
|
|
360
|
+
|
|
361
|
+
<span style="color:#007833;"><span class="SAP-icons-V5"></span></span>
|
|
362
|
+
|
|
363
|
+
</td>
|
|
364
|
+
<td valign="top">
|
|
365
|
+
|
|
366
|
+
May be required by some specific SAPUI5 functionality.
|
|
367
|
+
|
|
368
|
+
</td>
|
|
369
|
+
<td valign="top">
|
|
370
|
+
|
|
371
|
+
May be required by some specific SAPUI5 functionality.
|
|
372
|
+
|
|
373
|
+
</td>
|
|
374
|
+
<td valign="top">
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
</td>
|
|
379
|
+
<td valign="top">
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
</td>
|
|
384
|
+
</tr>
|
|
385
|
+
<tr>
|
|
386
|
+
<td valign="top">
|
|
387
|
+
|
|
388
|
+
`connect-src`
|
|
389
|
+
|
|
390
|
+
</td>
|
|
391
|
+
<td valign="top" align="center">
|
|
392
|
+
|
|
393
|
+
<span style="color:#007833;"><span class="SAP-icons-V5"></span></span>
|
|
394
|
+
|
|
395
|
+
</td>
|
|
396
|
+
<td valign="top">
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
</td>
|
|
401
|
+
<td valign="top">
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
</td>
|
|
406
|
+
<td valign="top">
|
|
407
|
+
|
|
408
|
+
Some specific SAPUI5 functionality may require `wss:`.
|
|
409
|
+
|
|
410
|
+
</td>
|
|
411
|
+
<td valign="top">
|
|
412
|
+
|
|
413
|
+
Requires `'self'` for loading application resources.
|
|
414
|
+
|
|
415
|
+
</td>
|
|
416
|
+
</tr>
|
|
417
|
+
</table>
|
|
418
|
+
|
|
419
|
+
\*In case `child-src` has been specified but no fallback for `frame-src` is intended, define `frame-src` with proper sources \(could also be `'none'`\).
|
|
420
|
+
|
|
421
|
+
\*\*`child-src` is still required for browsers that don't support `worker-src` yet.
|
|
422
|
+
|
|
423
|
+
## Specific Restrictions
|
|
424
|
+
|
|
425
|
+
The following functions and features require additional CSP source entries or have certain restrictions:
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
<table>
|
|
429
|
+
<tr>
|
|
430
|
+
<th valign="top">
|
|
431
|
+
|
|
432
|
+
Library
|
|
433
|
+
|
|
434
|
+
</th>
|
|
435
|
+
<th valign="top">
|
|
436
|
+
|
|
437
|
+
Topic
|
|
438
|
+
|
|
439
|
+
</th>
|
|
440
|
+
<th valign="top">
|
|
441
|
+
|
|
442
|
+
Comment
|
|
443
|
+
|
|
444
|
+
</th>
|
|
445
|
+
</tr>
|
|
446
|
+
<tr>
|
|
447
|
+
<td valign="top" align="center" colspan="3">
|
|
448
|
+
|
|
449
|
+
<code><b>script-src 'unsafe-eval'</b></code>
|
|
450
|
+
|
|
451
|
+
</td>
|
|
452
|
+
</tr>
|
|
453
|
+
<tr>
|
|
454
|
+
<td valign="top">
|
|
455
|
+
|
|
456
|
+
`sap.ui.support`
|
|
457
|
+
|
|
458
|
+
</td>
|
|
459
|
+
<td valign="top">
|
|
460
|
+
|
|
461
|
+
Support Assistant - Temporary Rules
|
|
462
|
+
|
|
463
|
+
</td>
|
|
464
|
+
<td valign="top">
|
|
465
|
+
|
|
466
|
+
For temporary rules in the Support Assistant, dynamic code execution is essential, so it can't be removed. Support Assistant detects whether dynamic code execution is allowed and informs the user if temporary rules can be used or not.
|
|
467
|
+
|
|
468
|
+
</td>
|
|
469
|
+
</tr>
|
|
470
|
+
<tr>
|
|
471
|
+
<td valign="top">
|
|
472
|
+
|
|
473
|
+
`sap.ushell`
|
|
474
|
+
|
|
475
|
+
</td>
|
|
476
|
+
<td valign="top">
|
|
477
|
+
|
|
478
|
+
Search, App Finder, Custom Tiles
|
|
479
|
+
|
|
480
|
+
</td>
|
|
481
|
+
<td valign="top">
|
|
482
|
+
|
|
483
|
+
`script-src 'unsafe-eval'` is required for the App Finder and the rendering of custom tiles. It's also required to start the search function via a deep link.
|
|
484
|
+
|
|
485
|
+
</td>
|
|
486
|
+
</tr>
|
|
487
|
+
<tr>
|
|
488
|
+
<td valign="top">
|
|
489
|
+
|
|
490
|
+
`sap.viz`
|
|
491
|
+
|
|
492
|
+
</td>
|
|
493
|
+
<td valign="top">
|
|
494
|
+
|
|
495
|
+
VizContainer, typed charts
|
|
496
|
+
|
|
497
|
+
</td>
|
|
498
|
+
<td valign="top">
|
|
499
|
+
|
|
500
|
+
VizContainer and old typed charts require synchronous loading of JavaScript.
|
|
501
|
+
|
|
502
|
+
</td>
|
|
503
|
+
</tr>
|
|
504
|
+
<tr>
|
|
505
|
+
<td valign="top">
|
|
506
|
+
|
|
507
|
+
`unified.shell`
|
|
508
|
+
|
|
509
|
+
</td>
|
|
510
|
+
<td valign="top">
|
|
511
|
+
|
|
512
|
+
Factsheets, Smart Business
|
|
513
|
+
|
|
514
|
+
</td>
|
|
515
|
+
<td valign="top">
|
|
516
|
+
|
|
517
|
+
Factsheets and Smart Business \(tiles\) have not been fully adopted to run without synchronous loading yet.
|
|
518
|
+
|
|
519
|
+
</td>
|
|
520
|
+
</tr>
|
|
521
|
+
<tr>
|
|
522
|
+
<td valign="top" align="center" colspan="3">
|
|
523
|
+
|
|
524
|
+
<code><b>script-src 'unsafe-inline'</b></code>
|
|
525
|
+
|
|
526
|
+
</td>
|
|
527
|
+
</tr>
|
|
528
|
+
<tr>
|
|
529
|
+
<td valign="top">
|
|
530
|
+
|
|
531
|
+
`sap.ui.richtexteditor`
|
|
532
|
+
|
|
533
|
+
</td>
|
|
534
|
+
<td valign="top">
|
|
535
|
+
|
|
536
|
+
RichTextEditor
|
|
537
|
+
|
|
538
|
+
</td>
|
|
539
|
+
<td valign="top">
|
|
540
|
+
|
|
541
|
+
The following cases can cause CSP-relevant issues for inline scripts when the RichTextEditor is used:
|
|
542
|
+
|
|
543
|
+
- If you're using one of the following plugins: `linkchecker`, `preview`
|
|
544
|
+
- If you're using the `tinymce.ui.Iframe` widget
|
|
545
|
+
|
|
546
|
+
See also [sap.ui.richtexteditor.RichTextEditor](../10_More_About_Controls/sap-ui-richtexteditor-richtexteditor-d4f3f15.md).
|
|
547
|
+
|
|
548
|
+
</td>
|
|
549
|
+
</tr>
|
|
550
|
+
<tr>
|
|
551
|
+
<td valign="top" align="center" colspan="3">
|
|
552
|
+
|
|
553
|
+
<code><b>script-src 'wasm-unsafe-eval'</b></code>
|
|
554
|
+
|
|
555
|
+
</td>
|
|
556
|
+
</tr>
|
|
557
|
+
<tr>
|
|
558
|
+
<td valign="top">
|
|
559
|
+
|
|
560
|
+
`sap.ui.core`
|
|
561
|
+
|
|
562
|
+
</td>
|
|
563
|
+
<td valign="top">
|
|
564
|
+
|
|
565
|
+
Hyphenation
|
|
566
|
+
|
|
567
|
+
</td>
|
|
568
|
+
<td valign="top">
|
|
569
|
+
|
|
570
|
+
`script-src` requires `wasm-unsafe-eval`
|
|
571
|
+
|
|
572
|
+
When native hyphenation is not available, a third-party library \(Hyphenopoly\) is used. This library uses WASM, which leads to CSP issues due to browser limitations. There is a fallback to `asm.js`, if WASM can't be used.
|
|
573
|
+
|
|
574
|
+
</td>
|
|
575
|
+
</tr>
|
|
576
|
+
<tr>
|
|
577
|
+
<td valign="top" align="center" colspan="3">
|
|
578
|
+
|
|
579
|
+
<code><b>style-src 'unsafe-inline'</b></code>
|
|
580
|
+
|
|
581
|
+
</td>
|
|
582
|
+
</tr>
|
|
583
|
+
<tr>
|
|
584
|
+
<td valign="top">
|
|
585
|
+
|
|
586
|
+
`sap.m` and others
|
|
587
|
+
|
|
588
|
+
</td>
|
|
589
|
+
<td valign="top">
|
|
590
|
+
|
|
591
|
+
Controls that display provided HTML text \(for example `sap.m.FormattedText` and `sap.ui.core.HTML`\)
|
|
592
|
+
|
|
593
|
+
</td>
|
|
594
|
+
<td valign="top">
|
|
595
|
+
|
|
596
|
+
Certain controls display provided HTML text, for example `sap.m.FormattedText`. If the provided text contains a style attribute or a style element with inline styles, `'unsafe-inline'` is required for `style-src`.
|
|
597
|
+
|
|
598
|
+
It's recommended to use styling with the `class` attribute and external stylesheets.
|
|
599
|
+
|
|
600
|
+
</td>
|
|
601
|
+
</tr>
|
|
602
|
+
<tr>
|
|
603
|
+
<td valign="top">
|
|
604
|
+
|
|
605
|
+
`sap.ui.vk`
|
|
606
|
+
|
|
607
|
+
</td>
|
|
608
|
+
<td valign="top">
|
|
609
|
+
|
|
610
|
+
2D drawings \(`sap.ui.vk.svg.Viewport`\)
|
|
611
|
+
|
|
612
|
+
</td>
|
|
613
|
+
<td valign="top">
|
|
614
|
+
|
|
615
|
+
When a 2D drawing is loaded, `sap.ui.vk.svg.Viewport` creates an SVG document that uses inline styles to define SVG drawing elements, colors, line styles, etc.
|
|
616
|
+
|
|
617
|
+
</td>
|
|
618
|
+
</tr>
|
|
619
|
+
<tr>
|
|
620
|
+
<td valign="top">
|
|
621
|
+
|
|
622
|
+
`sap.ushell`
|
|
623
|
+
|
|
624
|
+
</td>
|
|
625
|
+
<td valign="top">
|
|
626
|
+
|
|
627
|
+
Company Logo
|
|
628
|
+
|
|
629
|
+
</td>
|
|
630
|
+
<td valign="top">
|
|
631
|
+
|
|
632
|
+
A console error related to the loading of the company logo is logged during startup of the SAP Fiori launchpad. Eventually, the logo is loaded as expected.
|
|
633
|
+
|
|
634
|
+
</td>
|
|
635
|
+
</tr>
|
|
636
|
+
<tr>
|
|
637
|
+
<td valign="top">
|
|
638
|
+
|
|
639
|
+
`sap.viz`
|
|
640
|
+
|
|
641
|
+
</td>
|
|
642
|
+
<td valign="top">
|
|
643
|
+
|
|
644
|
+
VizContainer, typed charts
|
|
645
|
+
|
|
646
|
+
</td>
|
|
647
|
+
<td valign="top">
|
|
648
|
+
|
|
649
|
+
VizContainer and old typed charts require synchronous loading of JavaScript.
|
|
650
|
+
|
|
651
|
+
</td>
|
|
652
|
+
</tr>
|
|
653
|
+
<tr>
|
|
654
|
+
<td valign="top">
|
|
655
|
+
|
|
656
|
+
`unified.shell`
|
|
657
|
+
|
|
658
|
+
</td>
|
|
659
|
+
<td valign="top">
|
|
660
|
+
|
|
661
|
+
Factsheets, Smart Business
|
|
662
|
+
|
|
663
|
+
</td>
|
|
664
|
+
<td valign="top">
|
|
665
|
+
|
|
666
|
+
Factsheets and Smart Business \(tiles\) have not been fully adopted to run without inline styles yet.
|
|
667
|
+
|
|
668
|
+
</td>
|
|
669
|
+
</tr>
|
|
670
|
+
</table>
|