diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2018-12-04 14:50:31 -0500 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2018-12-04 14:50:31 -0500 |
commit | 2c3ef60575f48b1b239076be6b2831b19e5fa491 (patch) | |
tree | c2b6b017ecf2a3dd4c6814808ddce4d41d6c5e01 | |
parent | a751881e1f4e04a6af24552be70d691d8076c933 (diff) | |
download | sdl_core-fix/cloud_app_certificate_policies.tar.gz |
Fix incorrect value of string in policy table parsingfix/cloud_app_certificate_policies
The default value for a string field in the policy table was applied regardless of whether the field was present or not.
4 files changed, 4 insertions, 3 deletions
diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index 977448dacd..0fe54a683d 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -242,7 +242,7 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) , moduleType(impl::ValueMember(value__, "moduleType")) - , certificate(impl::ValueMember(value__, "certificate"), "not_specified") + , certificate(impl::ValueMember(value__, "certificate")) , hybrid_app_preference(impl::ValueMember(value__, "hybrid_app_preference")) , endpoint(impl::ValueMember(value__, "endpoint")) , enabled(impl::ValueMember(value__, "enabled")) diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 58f07492c4..18f909bb99 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -142,7 +142,7 @@ struct ApplicationParams : PolicyBase { Optional<RequestSubTypes> RequestSubType; Optional<Integer<uint16_t, 0, 65225> > memory_kb; Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms; - Optional<String<0, 255> > certificate; + Optional<String<0, 65535> > certificate; mutable Optional<ModuleTypes> moduleType; // Cloud application params Optional<Enum<HybridAppPreference> > hybrid_app_preference; diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index 88564df050..5faf96a232 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -167,7 +167,7 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , RequestSubType(impl::ValueMember(value__, "RequestSubType")) , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) - , certificate(impl::ValueMember(value__, "certificate"), "not_specified") + , certificate(impl::ValueMember(value__, "certificate")) , moduleType(impl::ValueMember(value__, "moduleType")) , hybrid_app_preference(impl::ValueMember(value__, "hybrid_app_preference")) , endpoint(impl::ValueMember(value__, "endpoint")) diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h index 6c8bb359af..960ca10e21 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h @@ -206,6 +206,7 @@ String<minlen, maxlen>::String(const Json::Value* value, if (!is_initialized()) { value_state_ = kValid; } else if (is_valid()) { + value_ = value->asString(); value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid; } } |