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 86819ab..a58c478 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 b11158a..b52a2b0 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 5eb7f6e..ee09d08 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 8152d4d..95f0365 100644 (file)
@@ -504,6 +504,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.
      *
      * @return Common Name of Distribuotor End Entity certificate.
index 2aa4cd2..4f5f136 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)