diff options
author | JackLivio <jack@livio.io> | 2019-01-23 16:12:59 -0500 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2019-01-23 16:12:59 -0500 |
commit | 6b86e197ba38f6af3ba6390e920cae6f9abe654d (patch) | |
tree | 9d3ddf26ab5e8187eea329d893ddefd5cfa59ac3 /src/components/policy/policy_external/include | |
parent | 91fc054c1f3de59944c4d7030f68a7640a34316f (diff) | |
download | sdl_core-6b86e197ba38f6af3ba6390e920cae6f9abe654d.tar.gz |
External policies
Diffstat (limited to 'src/components/policy/policy_external/include')
7 files changed, 59 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index 3344b149e4..9cc1d25bfb 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -229,6 +229,20 @@ class CacheManager : public CacheManagerInterface { const std::string& hybrid_app_preference); /** + * @brief Get app service parameters from the policy table + * @param policy_app_id Unique application id + * @param service_name Service name published by app service provider + * @param service_type Service type published by app service provider + * @param handled_rpcs Vector of allowed function ids an app service provider + * can handle + */ + virtual void GetAppServiceParameters( + const std::string& policy_app_id, + std::string& service_name, + std::string& service_type, + std::vector<uint64_t>& handled_rpcs) const; + + /** * @brief Allows to update 'vin' field in module_meta table. * * @param new 'vin' value. diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h index 6a172e6f4b..b48b6a1041 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h @@ -238,6 +238,20 @@ class CacheManagerInterface { const std::string& hybrid_app_preference) = 0; /** + * @brief Get app service parameters from the policy table + * @param policy_app_id Unique application id + * @param service_name Service name published by app service provider + * @param service_type Service type published by app service provider + * @param handled_rpcs Vector of allowed function ids an app service provider + * can handle + */ + virtual void GetAppServiceParameters( + const std::string& policy_app_id, + std::string& service_name, + std::string& service_type, + std::vector<uint64_t>& handled_rpcs) const = 0; + + /** * @brief Allows to update 'vin' field in module_meta table. * * @param new 'vin' value. diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 399c95170d..fa64614e1f 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -640,6 +640,20 @@ class PolicyManagerImpl : public PolicyManager { const std::string& hybrid_app_preference) OVERRIDE; /** + * @brief Get app service parameters from the policy table + * @param policy_app_id Unique application id + * @param service_name Service name published by app service provider + * @param service_type Service type published by app service provider + * @param handled_rpcs Vector of allowed function ids an app service provider + * can handle + */ + void GetAppServiceParameters( + const std::string& policy_app_id, + std::string& service_name, + std::string& service_type, + std::vector<uint64_t>& handled_rpcs) const OVERRIDE; + + /** * @brief OnAppRegisteredOnMobile allows to handle event when application were * succesfully registered on mobile device. * It will send OnAppPermissionSend notification and will try to start PTU. * diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index f37531eb63..ed845b1191 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -104,6 +104,8 @@ typedef Array<Enum<RequestType>, 0, 255> RequestsTypeArray; typedef Strings RequestSubTypes; +typedef Array<Integer<uint64_t, 0u, UINT_MAX>, 0, 255> HandledRpcs; + typedef Map<Strings, 0, 255> RemoteRpcs; typedef Map<RemoteRpcs, 0, 255> AccessModules; typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes; @@ -185,6 +187,11 @@ struct ApplicationParams : PolicyBase { Optional<String<0, 65535> > auth_token; Optional<String<0, 255> > cloud_transport_type; + // App Service Params + Optional<String<0, 255> > service_name; + Optional<String<0, 255> > service_type; + Optional<HandledRpcs> handled_rpcs; + public: ApplicationParams(); ApplicationParams(const Strings& groups, diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml index 5ed852cf45..3b3bc2d7a6 100644 --- a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml +++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml @@ -108,6 +108,9 @@ <param name="cloud_transport_type" type="String" minlength="0" maxlength="255" mandatory="false" /> <param name="hybrid_app_preference" type="HybridAppPreference" mandatory="false" /> + <param name="service_name" type="String" mandatory="false" /> + <param name="service_type" type="AppServiceType" mandatory="false" /> + <param name="handled_rpcs" array="true" mandatory="false"> </struct> <typedef name="HmiLevels" type="HmiLevel" array="true" diff --git a/src/components/policy/policy_external/include/policy/sql_pt_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_queries.h index dd9e0204e7..c66d878e5a 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_queries.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_queries.h @@ -66,6 +66,7 @@ extern const std::string kSelectNicknames; extern const std::string kSelectAppTypes; extern const std::string kSelectRequestTypes; extern const std::string kSelectRequestSubTypes; +extern const std::string kSelectHandledRpcs; extern const std::string kSelectSecondsBetweenRetries; extern const std::string kSelectIgnitionCycles; extern const std::string kSelectKilometers; @@ -80,6 +81,7 @@ extern const std::string kInsertNickname; extern const std::string kInsertAppType; extern const std::string kInsertRequestType; extern const std::string kInsertRequestSubType; +extern const std::string kInsertHandledRpcs; extern const std::string kInsertMessageType; extern const std::string kInsertLanguage; extern const std::string kInsertMessageString; @@ -101,6 +103,7 @@ extern const std::string kDeleteAppGroup; extern const std::string kDeleteApplication; extern const std::string kDeleteRequestType; extern const std::string kDeleteRequestSubType; +extern const std::string kDeleteHandledRpcs; extern const std::string kDeleteDevice; extern const std::string kIncrementIgnitionCycles; extern const std::string kResetIgnitionCycles; diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h index 13816eb6c5..ebc307cc8b 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h @@ -134,6 +134,8 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool GatherRequestSubType( const std::string& app_id, policy_table::RequestSubTypes* request_subtypes) const; + bool GatherHandledRpcs(const std::string& app_id, + policy_table::HandledRpcs* handled_rpcs) const; bool GatherNickName(const std::string& app_id, policy_table::Strings* nicknames) const; @@ -172,6 +174,8 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool SaveRequestSubType( const std::string& app_id, const policy_table::RequestSubTypes& request_subtypes); + bool SaveHandledRpcs(const std::string& app_id, + const policy_table::HandledRpcs& handled_rpcs); public: virtual std::string GetLockScreenIconUrl() const; |