arnaucube
arnaucube/openEventsPlatformAppPublic Self-hosted repository
openEventsPlatformApp/plugins/cordova-plugin-whitelist/doc/it/README.md
plugins/cordova-plugin-whitelist/doc/it/README.mdRaw
  1<!--
  2# license: Licensed to the Apache Software Foundation (ASF) under one
  3#         or more contributor license agreements.  See the NOTICE file
  4#         distributed with this work for additional information
  5#         regarding copyright ownership.  The ASF licenses this file
  6#         to you under the Apache License, Version 2.0 (the
  7#         "License"); you may not use this file except in compliance
  8#         with the License.  You may obtain a copy of the License at
  9#
 10#           http://www.apache.org/licenses/LICENSE-2.0
 11#
 12#         Unless required by applicable law or agreed to in writing,
 13#         software distributed under the License is distributed on an
 14#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15#         KIND, either express or implied.  See the License for the
 16#         specific language governing permissions and limitations
 17#         under the License.
 18-->
 19
 20# cordova-plugin-whitelist
 21
 22Questo plugin attua una politica di whitelist per spostarsi all'interno dell'applicazione webview in Cordova 4.0
 23
 24## Piattaforme supportate Cordova
 25
 26  * Android 4.0.0 o superiore
 27  * iOS 4.0.0 o superiore
 28
 29## Navigazione Whitelist
 30
 31Controlla quali URL WebView stessa può essere esplorato. Si applica al solo primo livello navigazioni.
 32
 33Stranezze: su Android vale anche per gli iframe per non-schemi di http (s).
 34
 35Per impostazione predefinita, navigazioni solo agli URL `file://` , sono ammessi. Per consentire altri altri URL, è necessario aggiungere `<allow-navigation>` tag per il tuo `config. XML`:
 36
 37    <!-- Allow links to example.com -->
 38    <allow-navigation href="http://example.com/*" />
 39    
 40    <!-- Wildcards are allowed for the protocol, as a prefix
 41         to the host, or as a suffix to the path -->
 42    <allow-navigation href="*://*.example.com/*" />
 43    
 44    <!-- A wildcard can be used to whitelist the entire network,
 45         over HTTP and HTTPS.
 46         *NOT RECOMMENDED* -->
 47    <allow-navigation href="*" />
 48    
 49    <!-- The above is equivalent to these three declarations -->
 50    <allow-navigation href="http://*/*" />
 51    <allow-navigation href="https://*/*" />
 52    <allow-navigation href="data:*" />
 53    
 54
 55## Whitelist intento
 56
 57Controlla quali URL app è consentito richiedere il sistema di apertura. Per impostazione predefinita, nessun esterno URL sono ammessi.
 58
 59Su Android, ciò equivale all'invio di un intento di tipo BROWSEABLE.
 60
 61Questa whitelist non si applica ai plugin, solo i collegamenti ipertestuali e chiamate a `Window`.
 62
 63In `config. XML`, aggiungere tag `<allow-intent>` , simile al seguente:
 64
 65    <!-- Allow links to web pages to open in a browser -->
 66    <allow-intent href="http://*/*" />
 67    <allow-intent href="https://*/*" />
 68    
 69    <!-- Allow links to example.com to open in a browser -->
 70    <allow-intent href="http://example.com/*" />
 71    
 72    <!-- Wildcards are allowed for the protocol, as a prefix
 73         to the host, or as a suffix to the path -->
 74    <allow-intent href="*://*.example.com/*" />
 75    
 76    <!-- Allow SMS links to open messaging app -->
 77    <allow-intent href="sms:*" />
 78    
 79    <!-- Allow tel: links to open the dialer -->
 80    <allow-intent href="tel:*" />
 81    
 82    <!-- Allow geo: links to open maps -->
 83    <allow-intent href="geo:*" />
 84    
 85    <!-- Allow all unrecognized URLs to open installed apps
 86         *NOT RECOMMENDED* -->
 87    <allow-intent href="*" />
 88    
 89
 90## Rete richiesta Whitelist
 91
 92Controlli che le richieste di rete (immagini, XHRs, ecc.) sono consentiti (tramite ganci nativo di cordova).
 93
 94Nota: Si consiglia di che utilizzare un criterio di protezione contenuti (Vedi sotto), che è più sicuro. La whitelist è principalmente storico per visualizzazioni Web che non supportano la CSP.
 95
 96In `config. XML`, aggiungere tag `< access >` , simile al seguente:
 97
 98    <!-- Allow images, xhrs, etc. to google.com -->
 99    <access origin="http://google.com" />
100    <access origin="https://google.com" />
101    
102    <!-- Access to the subdomain maps.google.com -->
103    <access origin="http://maps.google.com" />
104    
105    <!-- Access to all the subdomains on google.com -->
106    <access origin="http://*.google.com" />
107    
108    <!-- Enable requests to content: URLs -->
109    <access origin="content:///*" />
110    
111    <!-- Don't block any requests -->
112    <access origin="*" />
113    
114
115Senza qualsiasi tag `< access >` , sono consentite solo le richieste di URL `file://` . Tuttavia, l'applicazione di Cordova predefinito include `< access origin = "*" >` per impostazione predefinita.
116
117Stranezza: Android consente anche alle richieste di https://ssl.gstatic.com/accessibility/javascript/android/ per impostazione predefinita, poiché questa operazione è necessaria per TalkBack funzionare correttamente.
118
119### Politica di sicurezza del contenuto
120
121Controlli che le richieste di rete (immagini, XHRs, ecc.) possono essere effettuate (via webview direttamente).
122
123Su Android e iOS, la rete richiesta whitelist (Vedi sopra) non è in grado di filtrare tutti i tipi di richieste (ad esempio non sono bloccate `< video >` & WebSockets). Così, oltre alla whitelist, è necessario utilizzare un tag `< meta >` [Content Security Policy](http://content-security-policy.com/) su tutte le pagine.
124
125Su Android, supporto per CSP all'interno webview sistema inizia con KitKat (ma è disponibile su tutte le versioni usando Crosswalk WebView).
126
127Ecco alcuni esempi di dichiarazioni di CSP per le pagine `HTML` :
128
129    <!-- Good default declaration:
130        * gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
131        * https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
132        * Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
133            * Enable inline JS: add 'unsafe-inline' to default-src
134            * Enable eval(): add 'unsafe-eval' to default-src
135    -->
136    <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *">
137    
138    <!-- Allow requests to foo.com -->
139    <meta http-equiv="Content-Security-Policy" content="default-src 'self' foo.com">
140    
141    <!-- Enable all requests, inline styles, and eval() -->
142    <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
143    
144    <!-- Allow XHRs via https only -->
145    <meta http-equiv="Content-Security-Policy" content="default-src 'self' https:">
146    
147    <!-- Allow iframe to https://cordova.apache.org/ -->
148    <meta http-equiv="Content-Security-Policy" content="default-src 'self'; frame-src 'self' https://cordova.apache.org">