You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/08/30 14:54:47 UTC

svn commit: r1806697 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/ tobago-core/src/main/resources/META-INF/ tobago-core/src/main/resou...

Author: lofwyr
Date: Wed Aug 30 14:54:46 2017
New Revision: 1806697

URL: http://svn.apache.org/viewvc?rev=1806697&view=rev
Log:
TOBAGO-1790: CSP definition must be appendable 
TOBAGO-1791: There should be a "nonce" for each request to protect CSS and JavaScript with CSP
TOBAGO-1792: CSP: using CSP Level 2 syntax

Added:
    myfaces/tobago/trunk/tobago-core/src/main/resources/META-INF/tobago-config.xml
    myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-merge-3.xml
Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/ResponseUtils.java
    myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-4.0.xsd
    myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java
    myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java
    myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-2.0.xml
    myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-4.0.xml
    myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-untidy-2.0.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/ContentSecurityPolicy.java Wed Aug 30 14:54:46 2017
@@ -19,14 +19,14 @@
 
 package org.apache.myfaces.tobago.internal.config;
 
-import java.util.ArrayList;
 import java.util.Collections;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
 
 public class ContentSecurityPolicy {
 
   private Mode mode;
-  private List<String> directiveList;
+  private Map<String, String> directiveMap;
 
   private boolean unmodifiable = false;
 
@@ -41,22 +41,33 @@ public class ContentSecurityPolicy {
    */
   public void lock() {
     unmodifiable = true;
-    directiveList = Collections.unmodifiableList(directiveList);
+    directiveMap = Collections.unmodifiableMap(directiveMap);
   }
 
   public ContentSecurityPolicy(final String mode) {
     this.mode = Mode.parse(mode);
-    this.directiveList = new ArrayList<String>();
+    this.directiveMap = new HashMap<String, String>();
   }
 
   public void merge(final ContentSecurityPolicy other) {
     checkLocked();
-    directiveList.addAll(other.directiveList);
+    for (Map.Entry<String, String> entry : other.directiveMap.entrySet()) {
+      addDirective(entry.getKey(), entry.getValue());
+    }
     mode = other.mode;
   }
 
-  public List<String> getDirectiveList() {
-    return directiveList;
+  public void addDirective(final String name, final String text) {
+    final String old = directiveMap.get(name);
+    if (old != null) {
+      directiveMap.put(name, old + ' ' + text);
+    } else {
+      directiveMap.put(name, text);
+    }
+  }
+
+  public Map<String, String> getDirectiveMap() {
+    return directiveMap;
   }
 
   public Mode getMode() {
@@ -67,7 +78,7 @@ public class ContentSecurityPolicy {
   public String toString() {
     return "ContentSecurityPolicy{"
         + "mode=" + mode
-        + ", directiveList=" + directiveList
+        + ", directiveMap=" + directiveMap
         + '}';
   }
 

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParser.java Wed Aug 30 14:54:46 2017
@@ -95,6 +95,7 @@ public class TobagoConfigParser extends
   private StringBuilder buffer;
   private Properties properties;
   private String entryKey;
+  private String directiveName;
   private String extension;
   private String type;
 
@@ -225,6 +226,10 @@ public class TobagoConfigParser extends
         entryKey = attributes.getValue("key");
         break;
 
+      case DIRECTIVE:
+        directiveName = attributes.getValue("name");
+        break;
+
       case NAME:
       case ORDERING:
       case BEFORE:
@@ -239,7 +244,6 @@ public class TobagoConfigParser extends
       case SECURITY_ANNOTATION:
       case PREVENT_FRAME_ATTACKS:
       case SET_NOSNIFF_HEADER:
-      case DIRECTIVE:
       case THEME_DEFINITIONS:
       case DISPLAY_NAME:
       case VERSIONED:
@@ -334,7 +338,16 @@ public class TobagoConfigParser extends
         break;
 
       case DIRECTIVE:
-        tobagoConfig.getContentSecurityPolicy().getDirectiveList().add(text);
+        if (directiveName == null) { // before Tobago 4.0
+          final int i = text.indexOf(' ');
+          if (i < 1) {
+            throw new RuntimeException("CSP directive can't be parsed!");
+          }
+          tobagoConfig.getContentSecurityPolicy().addDirective(text.substring(0, i), text.substring(i + 1));
+        } else {
+          tobagoConfig.getContentSecurityPolicy().addDirective(directiveName, text);
+        }
+        directiveName = null;
         break;
 
       case MARKUP:

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/ResponseUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/ResponseUtils.java?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/ResponseUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/ResponseUtils.java Wed Aug 30 14:54:46 2017
@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
 import javax.faces.context.FacesContext;
 import javax.portlet.MimeResponse;
 import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
 
 public final class ResponseUtils {
 
@@ -99,7 +100,8 @@ public final class ResponseUtils {
     final Object response = facesContext.getExternalContext().getResponse();
     if (response instanceof HttpServletResponse) {
       final HttpServletResponse servletResponse = (HttpServletResponse) response;
-      final UserAgent userAgent = TobagoContext.getInstance(facesContext).getUserAgent();
+      final TobagoContext tobagoContext = TobagoContext.getInstance(facesContext);
+      final UserAgent userAgent = tobagoContext.getUserAgent();
       final String[] cspHeaders;
       switch (contentSecurityPolicy.getMode()) {
         case OFF:
@@ -115,16 +117,15 @@ public final class ResponseUtils {
           throw new IllegalArgumentException("Undefined mode: " + contentSecurityPolicy.getMode());
       }
       final StringBuilder builder = new StringBuilder();
-      builder.append("style-src 'nonce-");
-      builder.append(TobagoContext.getInstance(facesContext).getNonce());
-      builder.append("';");
-      for (final String directive : contentSecurityPolicy.getDirectiveList()) {
-        builder.append(directive);
+      final String nonce = tobagoContext.getNonce();
+      for (final Map.Entry<String, String> directive : contentSecurityPolicy.getDirectiveMap().entrySet()) {
+        builder.append(directive.getKey());
+        builder.append(" ");
+        builder.append(directive.getValue().replace("${nonce}", nonce));
         builder.append(";");
       }
-      final String value = builder.toString();
       for (final String cspHeader : cspHeaders) {
-        servletResponse.setHeader(cspHeader, value);
+        servletResponse.setHeader(cspHeader, builder.toString());
       }
     } else if (PortletUtils.isPortletApiAvailable() && response instanceof MimeResponse) {
      // TODO Portlet

Added: myfaces/tobago/trunk/tobago-core/src/main/resources/META-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/resources/META-INF/tobago-config.xml?rev=1806697&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/resources/META-INF/tobago-config.xml (added)
+++ myfaces/tobago/trunk/tobago-core/src/main/resources/META-INF/tobago-config.xml Wed Aug 30 14:54:46 2017
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<tobago-config
+    xmlns="http://myfaces.apache.org/tobago/tobago-config"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://myfaces.apache.org/tobago/tobago-config http://myfaces.apache.org/tobago/tobago-config-4.0.xsd"
+    version="4.0">
+
+  <name>tobago-config</name>
+
+  <content-security-policy mode="on">
+    <directive name="style-src">'nonce-${nonce}'</directive>
+  </content-security-policy>
+
+</tobago-config>

Modified: myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-4.0.xsd
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-4.0.xsd?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-4.0.xsd (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config-4.0.xsd Wed Aug 30 14:54:46 2017
@@ -107,11 +107,19 @@
 
   <xs:complexType name="content-security-policy-type">
     <xs:sequence>
-      <xs:element name="directive" type="xs:string" maxOccurs="unbounded" minOccurs="0"/>
+      <xs:element name="directive" type="tobago:directive-type" maxOccurs="unbounded" minOccurs="0"/>
     </xs:sequence>
     <xs:attribute name="mode" type="tobago:scp-mode-type" use="required"/>
   </xs:complexType>
 
+  <xs:complexType name="directive-type">
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:attribute name="name" type="xs:string" use="required"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
   <xs:complexType name="sanitizer-type">
     <xs:sequence>
       <xs:element name="sanitizer-class" type="xs:string" maxOccurs="1" minOccurs="1"/>

Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigMergingUnitTest.java Wed Aug 30 14:54:46 2017
@@ -70,8 +70,9 @@ public class TobagoConfigMergingUnitTest
         "tobago-config-merge-0.xml");
 
     Assert.assertTrue(config.getContentSecurityPolicy().getMode() == ContentSecurityPolicy.Mode.ON);
-    Assert.assertEquals(1, config.getContentSecurityPolicy().getDirectiveList().size());
-    Assert.assertEquals("default-src 'self'", config.getContentSecurityPolicy().getDirectiveList().get(0));
+    final Map<String, String> directiveMap = config.getContentSecurityPolicy().getDirectiveMap();
+    Assert.assertEquals(1, directiveMap.size());
+    Assert.assertEquals("'self'", directiveMap.get("default-src"));
   }
 
   @Test
@@ -83,9 +84,10 @@ public class TobagoConfigMergingUnitTest
         "tobago-config-merge-1.xml");
 
     Assert.assertTrue(config.getContentSecurityPolicy().getMode() == ContentSecurityPolicy.Mode.REPORT_ONLY);
-    Assert.assertEquals(2, config.getContentSecurityPolicy().getDirectiveList().size());
-    Assert.assertEquals("default-src 'self'", config.getContentSecurityPolicy().getDirectiveList().get(0));
-    Assert.assertEquals("image-src http://apache.org", config.getContentSecurityPolicy().getDirectiveList().get(1));
+    final Map<String, String> directiveMap = config.getContentSecurityPolicy().getDirectiveMap();
+    Assert.assertEquals(2, directiveMap.size());
+    Assert.assertEquals("'self'", directiveMap.get("default-src"));
+    Assert.assertEquals("http://apache.org", directiveMap.get("image-src"));
   }
 
   @Test
@@ -98,7 +100,21 @@ public class TobagoConfigMergingUnitTest
         "tobago-config-merge-2.xml");
 
     Assert.assertTrue(config.getContentSecurityPolicy().getMode() == ContentSecurityPolicy.Mode.OFF);
-    Assert.assertEquals(2, config.getContentSecurityPolicy().getDirectiveList().size());
+    Assert.assertEquals(2, config.getContentSecurityPolicy().getDirectiveMap().size());
+  }
+
+  @Test
+  public void testContentSecurityPolicyNameAttribute()
+      throws IOException, SAXException, ParserConfigurationException, URISyntaxException {
+
+    final TobagoConfigImpl config = loadAndMerge(
+        "tobago-config-merge-0.xml",
+        "tobago-config-merge-3.xml");
+
+    Assert.assertTrue(config.getContentSecurityPolicy().getMode() == ContentSecurityPolicy.Mode.ON);
+    final Map<String, String> directiveMap = config.getContentSecurityPolicy().getDirectiveMap();
+    Assert.assertEquals(1, directiveMap.size());
+    Assert.assertEquals("'self' https:", directiveMap.get("default-src"));
   }
 
   @Test

Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/config/TobagoConfigParserUnitTest.java Wed Aug 30 14:54:46 2017
@@ -32,6 +32,7 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 public class TobagoConfigParserUnitTest {
@@ -67,9 +68,11 @@ public class TobagoConfigParserUnitTest
     Assert.assertEquals(false, fragment.getCheckSessionSecret().booleanValue());
     Assert.assertEquals(false, fragment.getPreventFrameAttacks().booleanValue());
 
-    Assert.assertEquals(2, fragment.getContentSecurityPolicy().getDirectiveList().size());
-    Assert.assertEquals("default-src 'self'", fragment.getContentSecurityPolicy().getDirectiveList().get(0));
-    Assert.assertEquals("frame-src http://apache.org", fragment.getContentSecurityPolicy().getDirectiveList().get(1));
+    final Map<String, String> directiveMap = fragment.getContentSecurityPolicy().getDirectiveMap();
+    final Set<Map.Entry<String, String>> entries = directiveMap.entrySet();
+    Assert.assertEquals(2, entries.size());
+    Assert.assertEquals("'self'", directiveMap.get("default-src"));
+    Assert.assertEquals("http://apache.org", directiveMap.get("child-src"));
 
     Assert.assertEquals(2, fragment.getRenderersConfig().getRendererConfigs().size());
     Assert.assertTrue(fragment.getRenderersConfig().isMarkupSupported("myRenderer-1", "my-markup-1"));

Modified: myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-2.0.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-2.0.xml?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-2.0.xml (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-2.0.xml Wed Aug 30 14:54:46 2017
@@ -51,7 +51,7 @@
 
   <content-security-policy mode="on">
     <directive>default-src 'self'</directive>
-    <directive>frame-src http://apache.org</directive>
+    <directive>child-src http://apache.org</directive>
   </content-security-policy>
 
   <renderers>

Modified: myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-4.0.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-4.0.xml?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-4.0.xml (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-4.0.xml Wed Aug 30 14:54:46 2017
@@ -47,8 +47,8 @@
   <set-nosniff-header>false</set-nosniff-header>
 
   <content-security-policy mode="on">
-    <directive>default-src 'self'</directive>
-    <directive>frame-src http://apache.org</directive>
+    <directive name="default-src">'self'</directive>
+    <directive name="child-src"> http://apache.org</directive>
   </content-security-policy>
 
   <security-annotation>ignore</security-annotation>

Added: myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-merge-3.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-merge-3.xml?rev=1806697&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-merge-3.xml (added)
+++ myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-merge-3.xml Wed Aug 30 14:54:46 2017
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<tobago-config
+    xmlns="http://myfaces.apache.org/tobago/tobago-config"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://myfaces.apache.org/tobago/tobago-config http://myfaces.apache.org/tobago/tobago-config-4.0.xsd"
+    version="4.0">
+
+  <name>name-3</name>
+
+  <ordering>
+    <after>
+      <name>name-0</name>
+    </after>
+  </ordering>
+
+  <content-security-policy mode="on">
+    <directive name="default-src">https:</directive>
+  </content-security-policy>
+
+</tobago-config>

Modified: myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-untidy-2.0.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-untidy-2.0.xml?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-untidy-2.0.xml (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/resources/tobago-config-untidy-2.0.xml Wed Aug 30 14:54:46 2017
@@ -92,7 +92,7 @@
       default-src 'self'
     </directive>
     <directive>
-      frame-src http://apache.org
+      child-src http://apache.org
     </directive>
   </content-security-policy>
 

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml Wed Aug 30 14:54:46 2017
@@ -48,8 +48,8 @@
   <content-security-policy mode="off">
     <!-- XXX With CSP Tobago 3.0.x is currently not working 100% see TOBAGO-1534,
          XXX because of JSF-AJAX we need 'unsafe-eval' -->
-    <directive>script-src 'self' 'unsafe-eval'</directive>
-    <directive>frame-src https://maps.google.com</directive>
+    <directive name="script-src">'self' 'unsafe-eval'</directive>
+    <directive name="child-src">https://maps.google.com</directive>
   </content-security-policy>
 
   <!-- "disable" is the default -->

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/60-object/object.xhtml Wed Aug 30 14:54:46 2017
@@ -27,7 +27,7 @@
 
   <p>The <code class="language-markup">&lt;tc:object/></code> tag create an iframe.
     External objects can be included, when Content Security Policy is activated.
-    You may add a frame-src policy to the 'tobago-config.xml'.</p>
+    You may add a child-src policy to the 'tobago-config.xml'.</p>
   <tc:link label="Tag Library Documentation" image="#{request.contextPath}/image/feather-leaf.png"
            link="#{demoBundle.tagDocUrl}/#{info.stableVersion}/tld/tc/object.html"/>
   <tc:section label="Basics">

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml?rev=1806697&r1=1806696&r2=1806697&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml Wed Aug 30 14:54:46 2017
@@ -25,8 +25,14 @@
 
   <name>tobago-theme-standard</name>
 
+  <ordering>
+    <after>
+      <name>tobago-core</name>
+    </after>
+  </ordering>
+
   <content-security-policy mode="on">
-    <directive>default-src 'self'</directive>
+    <directive name="default-src">'self'</directive>
   </content-security-policy>
 
   <theme-definitions>