CSP report only support
authorAndrzej Surdej <a.surdej@samsung.com>
Wed, 27 Feb 2013 13:28:31 +0000 (14:28 +0100)
committerGerrit Code Review <gerrit2@kim11>
Tue, 5 Mar 2013 13:34:51 +0000 (22:34 +0900)
[Issue#] N/A
[Problem] csp report only tag is not supported by wrt database
[Cause] N/A
[Solution] Added place for csp-report-only policy
[Verification] Build repo.

Change-Id: I61a5967964631d85d729114e544d345da74e785f

modules/widget_dao/dao/widget_dao.cpp
modules/widget_dao/dao/widget_dao_read_only.cpp
modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h
modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h
modules/widget_dao/orm/wrt_db

index 86819ab7656009d86518a5962ed09befd186b962..a58c4786bdd0056b60b6422feff426ee3aa15385 100644 (file)
@@ -394,6 +394,7 @@ DbWidgetHandle WidgetDAO::registerWidgetInfo(
     row.Set_author_email(widgetConfigurationInfo.authorEmail);
     row.Set_author_href(widgetConfigurationInfo.authorHref);
     row.Set_csp_policy(widgetConfigurationInfo.cspPolicy);
+    row.Set_csp_policy_report_only(widgetConfigurationInfo.cspPolicyReportOnly);
     row.Set_base_folder(DPL::FromUTF8String(regInfo.baseFolder));
     row.Set_webkit_plugins_required(widgetConfigurationInfo.flashNeeded);
     row.Set_recognized(wacSecurity.isRecognized());
index b11158a8f12bb7311ba72b06e5969234b83b3716..b52a2b003d3b17e1c663df5feb6628a60762afe8 100644 (file)
@@ -695,6 +695,12 @@ DPL::OptionalString WidgetDAOReadOnly::getCspPolicy() const
     return row.Get_csp_policy();
 }
 
+DPL::OptionalString WidgetDAOReadOnly::getCspPolicyReportOnly() const
+{
+    WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
+    return row.Get_csp_policy_report_only();
+}
+
 bool WidgetDAOReadOnly::getWebkitPluginsRequired() const
 {
     WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
index 5eb7f6e3d4732c916acc314a3d4d4b9a878f672e..ee09d08485464e6b6471636254a1cc58f8b90152 100644 (file)
@@ -312,6 +312,7 @@ class ConfigParserData
 
     //csp polic for widget
     DPL::OptionalString cspPolicy;
+    DPL::OptionalString cspPolicyReportOnly;
 
     //Application service model list
     ServiceInfoList appServiceList; //It will be removed.
index 8152d4d5e56596607845624eb23c9e07091e563a..95f036509981d0caf0fb48284539ea4059005eca 100644 (file)
@@ -503,6 +503,13 @@ class WidgetDAOReadOnly
      */
     DPL::OptionalString getCspPolicy() const;
 
+    /**
+     * This method is used as a getter for report only csp policy of widget.
+     * It may be provided in configuration file.
+     * @return global csp report only policy for widget
+     */
+    DPL::OptionalString getCspPolicyReportOnly() const;
+
     /**
      * This method returns list filed with Common Name entries from certificate.
      *
index 2aa4cd28524dc9135f4c35017ae77c5664480c97..4f5f1363d9f78db941ca4bd9e95149666d838273 100755 (executable)
@@ -32,6 +32,7 @@ CREATE_TABLE(WidgetInfo)
     COLUMN(webkit_plugins_required, TINYINT,       DEFAULT 0)
     COLUMN(security_domain,         INT,           DEFAULT 0)
     COLUMN(csp_policy,              TEXT,          DEFAULT '')
+    COLUMN(csp_policy_report_only,  TEXT,          DEFAULT '')
     COLUMN(recognized,              INT,           DEFAULT 0)
     COLUMN(wac_signed,              INT,           DEFAULT 0)
     COLUMN(distributor_signed,      INT,           DEFAULT 0)