From 7950dbca3c0b7ea16b2f3d718fa907eefc4475ee Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Tue, 16 Apr 2024 10:45:05 +0100 Subject: [PATCH] HPCC-31618 Internal clients use latest version of ESP services unless generated_client_version specified This change updates internal clients so that they use latest version of ESP services by default. The new generated_client_version attribute has been implemented that may be used to override this behavour and to allow a specific version to be specified for internal clients. generated_client_version has been used to ensure that this change to default behaviour does not affect any existing services other than ws_fs. FileServices plugin requires the latest version. The following services use generated_client_version to ensure that they continue to use the same version as before: ws_access, WsCloud, WsESDLConfig, WsLoggingService, ws_machine, WsResources, WsTopology, WsUseMethodName and WsUseRequestName. Signed-off-by: Shamser Ahmed --- esp/scm/ws_access.ecm | 2 +- esp/scm/ws_cloud.ecm | 2 +- esp/scm/ws_configmgr.ecm | 2 +- esp/scm/ws_esdlconfig.ecm | 2 +- esp/scm/ws_loggingservice.ecm | 2 +- esp/scm/ws_machine.ecm | 2 +- esp/scm/ws_resources.ecm | 2 +- esp/scm/ws_topology.ecm | 2 +- testing/esp/esdlcmd/inputs/ws_usemethodname.ecm | 2 +- testing/esp/esdlcmd/inputs/ws_userequestname.ecm | 2 +- tools/hidl/hidlcomp.cpp | 13 ++++++++----- 11 files changed, 18 insertions(+), 15 deletions(-) diff --git a/esp/scm/ws_access.ecm b/esp/scm/ws_access.ecm index da34ed9dd5d..a00a43e95e8 100644 --- a/esp/scm/ws_access.ecm +++ b/esp/scm/ws_access.ecm @@ -1006,7 +1006,7 @@ ESPresponse [nil_remove] UserAccountExportResponse [http_content("application/octet-stream")] binary Result; }; -ESPservice [version("1.17"), auth_feature("NONE"), exceptions_inline("./smc_xslt/exceptions.xslt")] ws_access +ESPservice [version("1.17"), generated_client_version("0.0"), auth_feature("NONE"), exceptions_inline("./smc_xslt/exceptions.xslt")] ws_access { ESPmethod [client_xslt("/esp/xslt/access_users.xslt")] Users(UserRequest, UserResponse); ESPmethod [client_xslt("/esp/xslt/access_useredit.xslt")] UserEdit(UserEditRequest, UserEditResponse); diff --git a/esp/scm/ws_cloud.ecm b/esp/scm/ws_cloud.ecm index f50f0e5b2ae..2b662bc6934 100644 --- a/esp/scm/ws_cloud.ecm +++ b/esp/scm/ws_cloud.ecm @@ -35,7 +35,7 @@ ESPresponse [encode(0)] GetServicesResponse [json_inline(1)] string Result; }; -ESPservice [auth_feature("CloudAccess:ACCESS"), version("1.01"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsCloud +ESPservice [auth_feature("CloudAccess:ACCESS"), version("1.01"), generated_client_version("0.0"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsCloud { ESPmethod [auth_feature("CloudAccess:READ")] GetPODs(GetPODsRequest, GetPODsResponse); ESPmethod [auth_feature("CloudAccess:READ"), min_ver("1.01")] GetServices(GetServicesRequest, GetServicesResponse); diff --git a/esp/scm/ws_configmgr.ecm b/esp/scm/ws_configmgr.ecm index 455b49c97f6..fa72a3588f7 100644 --- a/esp/scm/ws_configmgr.ecm +++ b/esp/scm/ws_configmgr.ecm @@ -440,7 +440,7 @@ ESPrequest WizardTestRequest -ESPservice [auth_feature("DEFERRED"),version("2.0"), default_client_version("2.0"), exceptions_inline("xslt/exceptions.xslt"), disable_profile_execution] ws_configmgr +ESPservice [auth_feature("DEFERRED"), version("2.0"), default_client_version("2.0"), exceptions_inline("xslt/exceptions.xslt"), disable_profile_execution] ws_configmgr { ESPMethod [ diff --git a/esp/scm/ws_esdlconfig.ecm b/esp/scm/ws_esdlconfig.ecm index aa2214cd4fa..a3dec5c9854 100644 --- a/esp/scm/ws_esdlconfig.ecm +++ b/esp/scm/ws_esdlconfig.ecm @@ -306,7 +306,7 @@ ESPresponse [exceptions_inline] ListESDLBindingsResponse }; #define VERSION_FOR_ESDLCMD "1.5" -ESPservice [auth_feature("ESDLConfigAccess:ACCESS"), version("1.5"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsESDLConfig +ESPservice [auth_feature("ESDLConfigAccess:ACCESS"), version("1.5"), generated_client_version("0.0"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsESDLConfig { ESPmethod Echo(EchoRequest, EchoResponse); ESPmethod [auth_feature("ESDLConfigAccess:WRITE")] PublishESDLDefinition(PublishESDLDefinitionRequest, PublishESDLDefinitionResponse); diff --git a/esp/scm/ws_loggingservice.ecm b/esp/scm/ws_loggingservice.ecm index be329b88dc6..59a43fead84 100644 --- a/esp/scm/ws_loggingservice.ecm +++ b/esp/scm/ws_loggingservice.ecm @@ -52,7 +52,7 @@ ESPresponse [exceptions_inline] UpdateLogResponse string StatusMessage; }; -ESPService [auth_feature("DEFERRED"), version("1.0"), noforms, use_method_name] WsLoggingService +ESPService [auth_feature("DEFERRED"), version("1.0"), generated_client_version("0.0"), noforms, use_method_name] WsLoggingService { ESPmethod GetTransactionSeed(GetTransactionSeedRequest, GetTransactionSeedResponse); ESPmethod UpdateLog(UpdateLogRequest, UpdateLogResponse); diff --git a/esp/scm/ws_machine.ecm b/esp/scm/ws_machine.ecm index 5224ff02b7e..78322b0d307 100644 --- a/esp/scm/ws_machine.ecm +++ b/esp/scm/ws_machine.ecm @@ -457,7 +457,7 @@ ESPresponse [encode(0), nil_remove, exceptions_inline] GetNodeGroupUsageResponse }; //-------- service --------- -ESPservice [auth_feature("DEFERRED"), version("1.18")] ws_machine +ESPservice [auth_feature("DEFERRED"), version("1.18"), generated_client_version("0.0")] ws_machine { ESPmethod [resp_xsl_default("./smc_xslt/clusterprocesses.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")] GetTargetClusterInfo(GetTargetClusterInfoRequest, GetTargetClusterInfoResponse); diff --git a/esp/scm/ws_resources.ecm b/esp/scm/ws_resources.ecm index f41d77d19ba..12f100b0cc4 100644 --- a/esp/scm/ws_resources.ecm +++ b/esp/scm/ws_resources.ecm @@ -113,7 +113,7 @@ ESPresponse [nil_remove, exceptions_inline] TargetQueryResponse ESParray Roxies; }; -ESPservice [auth_feature("ResourceQueryAccess:ACCESS"), version("1.03"), exceptions_inline("./smc_xslt/exceptions.xslt"), disable_profile_execution] WsResources +ESPservice [auth_feature("ResourceQueryAccess:ACCESS"), version("1.03"), generated_client_version("0.0"), exceptions_inline("./smc_xslt/exceptions.xslt"), disable_profile_execution] WsResources { ESPmethod [auth_feature("ResourceQueryAccess:READ"), min_ver("1.03")] TargetQuery(TargetQueryRequest, TargetQueryResponse); ESPmethod [auth_feature("ResourceQueryAccess:READ")] ServiceQuery(ServiceQueryRequest, ServiceQueryResponse); diff --git a/esp/scm/ws_topology.ecm b/esp/scm/ws_topology.ecm index ca67e8bcf78..a7e7e33c3cc 100644 --- a/esp/scm/ws_topology.ecm +++ b/esp/scm/ws_topology.ecm @@ -665,7 +665,7 @@ ESPresponse [exceptions_inline] TpListLogFilesResponse ESParray Files; }; -ESPservice [auth_feature("DEFERRED"), noforms, version("1.32"), cache_group("ESPWsTP"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsTopology +ESPservice [auth_feature("DEFERRED"), noforms, version("1.32"), generated_client_version("0.0"), cache_group("ESPWsTP"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsTopology { ESPmethod [cache_seconds(180), cache_global(1), resp_xsl_default("/esp/xslt/targetclusters.xslt")] TpTargetClusterQuery(TpTargetClusterQueryRequest, TpTargetClusterQueryResponse); ESPmethod [cache_seconds(180), cache_global(1), resp_xsl_default("/esp/xslt/topology.xslt")] TpClusterQuery(TpClusterQueryRequest, TpClusterQueryResponse); diff --git a/testing/esp/esdlcmd/inputs/ws_usemethodname.ecm b/testing/esp/esdlcmd/inputs/ws_usemethodname.ecm index 6a51a81a902..34c2172cdb0 100644 --- a/testing/esp/esdlcmd/inputs/ws_usemethodname.ecm +++ b/testing/esp/esdlcmd/inputs/ws_usemethodname.ecm @@ -25,7 +25,7 @@ ESPresponse OrangeResponse bool Peels; }; -ESPservice[version("1"), use_method_name] WsUseMethodName +ESPservice[version("1"), generated_client_version("0.0"), use_method_name] WsUseMethodName { ESPmethod Unique(FooRequest, FooResponse); ESPmethod Apple(FruitRequest, FruitResponse); diff --git a/testing/esp/esdlcmd/inputs/ws_userequestname.ecm b/testing/esp/esdlcmd/inputs/ws_userequestname.ecm index c587485a189..db0812a3095 100644 --- a/testing/esp/esdlcmd/inputs/ws_userequestname.ecm +++ b/testing/esp/esdlcmd/inputs/ws_userequestname.ecm @@ -25,7 +25,7 @@ ESPresponse OrangeResponse bool Peels; }; -ESPservice[version("1")] WsUseRequestName +ESPservice[version("1"), generated_client_version("0.0")] WsUseRequestName { ESPmethod Unique(FooRequest, FooResponse); ESPmethod Apple(FruitRequest, FruitResponse); diff --git a/tools/hidl/hidlcomp.cpp b/tools/hidl/hidlcomp.cpp index b2328b909cb..37e22303ae6 100644 --- a/tools/hidl/hidlcomp.cpp +++ b/tools/hidl/hidlcomp.cpp @@ -4914,12 +4914,15 @@ void EspServInfo::write_esp_client_ipp() outs("\tIMPLEMENT_IINTERFACE;\n\n"); outf("\tCClient%s()\n\t{\n", name_); - outs("\t\tsoap_reqid=0;\n\t"); - outf("\t\tsoap_action.append(\"%s\");\n\t", name_); - const char *ver = getMetaString("default_client_version", NULL); + outs("\t\tsoap_reqid=0;\n"); + outf("\t\tsoap_action.append(\"%s\");\n", name_); + // use latest 'version' unless 'generated_client_version' provided + const char *ver = getMetaString("generated_client_version", nullptr); + if (!ver || !*ver) + ver = getMetaString("version", nullptr); if (ver && *ver) - outf("\t\tsoap_action.append(\"?ver_=\").append(%s);\n\t", ver); - outf("}\n\tvirtual ~CClient%s(){}\n", name_); + outf("\t\tsoap_action.append(\"?ver_=\").append(%s);\n", ver); + outf("\t}\n\tvirtual ~CClient%s(){}\n", name_); outs("\tvirtual void setProxyAddress(const char *address)\n\t{\n\t\tsoap_proxy.set(address);\n\t}\n"); outs("\tvirtual void addServiceUrl(const char *url)\n\t{\n\t\tsoap_url.set(url);\n\t}\n");