{
DPL::String req = url;
+ DPL::String suffix;
+ DPL::String::size_type pos = req.find_first_of('#');
+ if(pos != DPL::String::npos)
+ {
+ suffix = req.substr(pos) + suffix;
+ req.resize(pos); //truncate fragment identifier
+ }
+
+ pos = req.find_first_of('?');
+ if(pos != DPL::String::npos)
+ {
+ suffix = req.substr(pos) + suffix;
+ req.resize(pos); //truncate query string
+ }
+
if (req.find(WIDGET_URI_BEGIN) == 0) {
req.erase(0, WIDGET_URI_BEGIN.length());
} else if (req.find(FILE_URI_BEGIN) == 0) {
return DPL::Optional<DPL::String>::Null;
}
- found = widgetPath + *found;
+ found = widgetPath + *found + suffix;
return found;
}
registerWidgetWarpInfo(widgetHandle, widgetRegInfo);
+ registerWidgetAllowNavigationInfo(widgetHandle, widgetRegInfo);
+
registerWidgetCertificates(widgetHandle, wacSecurity);
CertificateChainList list;
row.Set_back_supported(widgetConfigurationInfo.backSupported);
row.Set_access_network(widgetConfigurationInfo.accessNetwork);
row.Set_pkg_type(regInfo.packagingType.pkgType);
+ row.Set_security_model_version(
+ static_cast<int>(widgetConfigurationInfo.securityModelVersion));
Try
{
}
}
+void WidgetDAO::registerWidgetAllowNavigationInfo(DbWidgetHandle widgetHandle,
+ const WidgetRegisterInfo ®Info)
+{
+ using namespace DPL::DB::ORM;
+ using namespace DPL::DB::ORM::wrt;
+ const ConfigParserData& widgetConfigurationInfo = regInfo.configInfo;
+
+ FOREACH(allowNaviIt, widgetConfigurationInfo.allowNavigationInfoList)
+ {
+ WidgetAllowNavigation::Row row;
+ row.Set_app_id(widgetHandle);
+ row.Set_scheme(allowNaviIt->m_scheme);
+ row.Set_host(allowNaviIt->m_host);
+ DO_INSERT(row, WidgetAllowNavigation)
+ }
+}
+
void WidgetDAO::registerWidgetCertificates(DbWidgetHandle widgetHandle,
const IWacSecurity &wacSecurity)
{
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get accessinfo list")
}
+void WidgetDAOReadOnly::getWidgetAllowNavigationInfo(
+ WidgetAllowNavigationInfoList& allowNavigationList) const
+{
+ SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
+ {
+ WRT_DB_SELECT(select, WidgetAllowNavigation, &WrtDatabase::interface())
+ select->Where(Equals<WidgetAllowNavigation::app_id>(m_widgetHandle));
+ WidgetAllowNavigation::Select::RowList rows = select->GetRowList();
+
+ FOREACH(it, rows) {
+ WidgetAllowNavigationInfo info;
+ info.scheme = it->Get_scheme();
+ info.host = it->Get_host();
+ allowNavigationList.push_back(info);
+ }
+ }
+ SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get allow-navigation info list")
+}
+
LanguageTags WidgetDAOReadOnly::getLanguageTags() const
{
//TODO check widget existance
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get PrivilegeList")
}
+WidgetSecurityModelVersion WidgetDAOReadOnly::getSecurityModelVersion() const
+{
+ WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle);
+ DPL::OptionalInt result = row.Get_security_model_version();
+ return static_cast<WidgetSecurityModelVersion>(*result);
+}
+
#undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
#undef SQL_CONNECTION_EXCEPTION_HANDLER_END
#undef CHECK_WIDGET_EXISTENCE
info.bSubDomains == bSubDomains;
}
};
+typedef std::list<WidgetAccessInfo> WidgetAccessInfoList;
+
+struct WidgetAllowNavigationInfo
+{
+ DPL::String scheme;
+ DPL::String host;
+};
+typedef std::list<WidgetAllowNavigationInfo> WidgetAllowNavigationInfoList;
struct EncryptedFileInfo
{
}
};
-typedef std::list<WidgetAccessInfo> WidgetAccessInfoList;
-
typedef std::list<DPL::String> WindowModeList;
typedef std::list<DPL::String> PrivilegeList;
};
typedef std::list<WidgetAppControl> WidgetAppControlList;
+
+enum class WidgetSecurityModelVersion
+{
+ WIDGET_SECURITY_MODEL_V1 = 0, // WARP
+ WIDGET_SECURITY_MODEL_V2 // CSP, allow-navigation
+};
} // namespace WrtDB
#endif /* WRT_WIDGET_DAO_COMMON_DAO_TYPES_H_ */
DPL::String m_pdSrc;
DPL::String m_pdWidth;
DPL::String m_pdHeight;
+ DPL::String m_pdFastOpen;
};
typedef BoxContent BoxContentInfo;
CapabilityList m_capabilityList;
};
- LiveboxList m_livebox;
-
typedef std::list<DPL::OptionalString> DependsPkgList;
-
typedef std::set<DPL::String> CategoryList;
+ struct AllowNavigationInfo
+ {
+ AllowNavigationInfo(DPL::String scheme,
+ DPL::String host) :
+ m_scheme(scheme),
+ m_host(host)
+ { }
+ DPL::String m_scheme;
+ DPL::String m_host;
+ };
+ typedef std::list<AllowNavigationInfo> AllowNavigationInfoList;
+
+ enum class SecurityModelVersion {
+ SECURITY_MODEL_V1 = 0, // WARP
+ SECURITY_MODEL_V2 // CSP, allow-navigation
+ };
+
+ LiveboxList m_livebox;
StringsList nameSpaces;
LocalizedDataSet localizedDataSet;
DPL::OptionalString tizenPkgId;
DPL::OptionalString tizenAppId;
+ // allow-navigation
+ AllowNavigationInfoList allowNavigationInfoList;
+
//csp polic for widget
DPL::OptionalString cspPolicy;
DPL::OptionalString cspPolicyReportOnly;
CategoryList categoryList;
// For Account
AccountProvider accountProvider;
+ // security model version
+ SecurityModelVersion securityModelVersion;
ConfigParserData() :
flashNeeded(false),
minVersionRequired(),
backSupported(false),
accessNetwork(false),
- startFileEncountered(false)
+ startFileEncountered(false),
+ securityModelVersion(SecurityModelVersion::SECURITY_MODEL_V1)
{}
};
} // namespace WrtDB
* @param[out] outAccessInfoList list filled with access info structures
*/
void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) const;
+ void getWidgetAllowNavigationInfo(
+ WidgetAllowNavigationInfoList& allowNavigationInfoList) const;
/**
* WAC 2.0 extension
*/
TizenPkgId getTizenPkgId() const;
PrivilegeList getWidgetPrivilege() const;
+ WidgetSecurityModelVersion getSecurityModelVersion() const;
+
};
} // namespace WrtDB
static void registerWidgetWarpInfo(
DbWidgetHandle widgetHandle,
const WidgetRegisterInfo ®Info);
+ static void registerWidgetAllowNavigationInfo(
+ DbWidgetHandle widgetHandle,
+ const WidgetRegisterInfo ®Info);
static void registerWidgetCertificates(
DbWidgetHandle widgetHandle,
const IWacSecurity &wacSecurity);
)
CREATE_TABLE(WidgetInfo)
- COLUMN_NOT_NULL(app_id, INTEGER, PRIMARY KEY AUTOINCREMENT)
- COLUMN(widget_type, INT, DEFAULT 1)
- COLUMN(widget_id, TEXT, DEFAULT '')
- COLUMN(widget_version, TEXT, DEFAULT '')
- COLUMN(widget_width, INT, DEFAULT 0)
- COLUMN(widget_height, INT, DEFAULT 0)
- COLUMN(author_name, TEXT, DEFAULT '')
- COLUMN(author_email, TEXT, DEFAULT '')
- COLUMN(author_href, TEXT, DEFAULT '')
- COLUMN(base_folder, TEXT, DEFAULT '')
- 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)
- COLUMN(min_version, TEXT, DEFAULT '1.0')
- COLUMN_NOT_NULL(back_supported, TINYINT, DEFAULT 0)
- COLUMN(access_network, TINYINT, DEFAULT 0)
- COLUMN(defaultlocale, TEXT, DEFAULT 0)
- COLUMN_NOT_NULL(tizen_pkgid, TEXT, DEFAULT '')
- COLUMN_NOT_NULL(tizen_appid, TEXT, DEFAULT 0 UNIQUE)
- COLUMN(pkg_type, INT, DEFAULT 0)
+ COLUMN_NOT_NULL(app_id, INTEGER, PRIMARY KEY AUTOINCREMENT)
+ COLUMN(widget_type, INT, DEFAULT 1)
+ COLUMN(widget_id, TEXT, DEFAULT '')
+ COLUMN(widget_version, TEXT, DEFAULT '')
+ COLUMN(widget_width, INT, DEFAULT 0)
+ COLUMN(widget_height, INT, DEFAULT 0)
+ COLUMN(author_name, TEXT, DEFAULT '')
+ COLUMN(author_email, TEXT, DEFAULT '')
+ COLUMN(author_href, TEXT, DEFAULT '')
+ COLUMN(base_folder, TEXT, DEFAULT '')
+ 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)
+ COLUMN(min_version, TEXT, DEFAULT '1.0')
+ COLUMN_NOT_NULL(back_supported, TINYINT, DEFAULT 0)
+ COLUMN(access_network, TINYINT, DEFAULT 0)
+ COLUMN(defaultlocale, TEXT, DEFAULT 0)
+ COLUMN_NOT_NULL(tizen_pkgid, TEXT, DEFAULT '')
+ COLUMN_NOT_NULL(tizen_appid, TEXT, DEFAULT 0 UNIQUE)
+ COLUMN(pkg_type, INT, DEFAULT 0)
+ COLUMN(security_model_version, INT, DEFAULT 0)
CREATE_TABLE_END()
SQL(
)
CREATE_TABLE_END()
+CREATE_TABLE(WidgetAllowNavigation)
+ COLUMN_NOT_NULL(app_id, INT,)
+ COLUMN_NOT_NULL(scheme, TEXT,)
+ COLUMN_NOT_NULL(host, TEXT,)
+
+ TABLE_CONSTRAINTS(
+ PRIMARY KEY(app_id, scheme, host)
+ FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
+ )
+CREATE_TABLE_END()
+
CREATE_TABLE(WidgetSecuritySettings)
COLUMN_NOT_NULL(app_id, INT,)
COLUMN_NOT_NULL(security_popup_usage, INT, DEFAULT 1)
-#git:framework/web/wrt-commons wrt-commons 0.2.113
+#git:framework/web/wrt-commons wrt-commons 0.2.115
Name: wrt-commons
Summary: Wrt common library
-Version: 0.2.113
+Version: 0.2.115
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0