diff --git a/bazel/BUILD b/bazel/BUILD index 1f4853b1b027..e0a820aee8f9 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -673,11 +673,11 @@ config_setting( define_values = {"FUZZING_ENGINE": "oss-fuzz"}, ) -# By default we enable AliMesh build. If want to build community -# version then build Envoy with flag of '--define alimesh=false'. +# By default we enable Higress build. If want to build community +# version then build Envoy with flag of '--define higress=false'. config_setting( - name = "alimesh", - values = {"define": "alimesh=false"}, + name = "higress", + values = {"define": "higress=false"}, ) alias( diff --git a/bazel/envoy_binary.bzl b/bazel/envoy_binary.bzl index b95d36e92498..86aea5c49bb0 100644 --- a/bazel/envoy_binary.bzl +++ b/bazel/envoy_binary.bzl @@ -9,7 +9,7 @@ load( "envoy_select_exported_symbols", "envoy_stdlib_deps", "tcmalloc_external_dep", - "envoy_select_alimesh", + "envoy_select_higress", ) # Envoy C++ binary targets should be specified with this function. @@ -87,7 +87,7 @@ def _envoy_linkopts(): "@envoy//bazel:boringssl_fips": [], "@envoy//bazel:windows_x86_64": [], "//conditions:default": ["-pie"], - }) + envoy_select_exported_symbols(["-Wl,-E"]) + envoy_select_alimesh(["-lcrypt"]) + }) + envoy_select_exported_symbols(["-Wl,-E"]) + envoy_select_higress(["-lcrypt"]) def _envoy_stamped_deps(): return select({ diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index a4608d6a7d60..62b89d2f0daa 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -126,7 +126,7 @@ def envoy_copts(repository, test = False): _envoy_select_perf_annotation(["-DENVOY_PERF_ANNOTATION"]) + \ _envoy_select_perfetto(["-DENVOY_PERFETTO"]) + \ envoy_select_google_grpc(["-DENVOY_GOOGLE_GRPC"], repository) + \ - envoy_select_alimesh(["-DALIMESH"]) + \ + envoy_select_higress(["-DHIGRESS"]) + \ envoy_select_signal_trace(["-DENVOY_HANDLE_SIGNALS"], repository) + \ _envoy_select_path_normalization_by_default(["-DENVOY_NORMALIZE_PATH_BY_DEFAULT"], repository) @@ -193,9 +193,9 @@ def _envoy_select_perf_annotation(xs): "//conditions:default": [], }) -def envoy_select_alimesh(xs): +def envoy_select_higress(xs): return select({ - "@envoy//bazel:alimesh": [], + "@envoy//bazel:higress": [], "//conditions:default": xs, }) diff --git a/bazel/envoy_library.bzl b/bazel/envoy_library.bzl index 828e70b15c51..e12841eb222b 100644 --- a/bazel/envoy_library.bzl +++ b/bazel/envoy_library.bzl @@ -103,7 +103,7 @@ def envoy_cc_library( tags = [], deps = [], strip_include_prefix = None, - alimesh_deps = [], + higress_deps = [], include_prefix = None, textual_hdrs = None, alwayslink = None, @@ -113,8 +113,8 @@ def envoy_cc_library( deps += tcmalloc_external_deps(repository) deps = deps + select({ - "@envoy//bazel:alimesh": [], - "//conditions:default": alimesh_deps, + "@envoy//bazel:higress": [], + "//conditions:default": higress_deps, }) # If alwayslink is not specified, allow turning it off via --define=library_autolink=disabled diff --git a/bazel/envoy_test.bzl b/bazel/envoy_test.bzl index 8bc7bc4327f8..9e13c3fdad29 100644 --- a/bazel/envoy_test.bzl +++ b/bazel/envoy_test.bzl @@ -16,7 +16,7 @@ load( "envoy_select_force_libcpp", "envoy_stdlib_deps", "tcmalloc_external_dep", - "envoy_select_alimesh", + "envoy_select_higress", ) # Envoy C++ related test infrastructure (that want gtest, gmock, but may be @@ -73,7 +73,7 @@ def _envoy_test_linkopts(): # TODO(mattklein123): It's not great that we universally link against the following libs. # In particular, -latomic and -lrt are not needed on all platforms. Make this more granular. "//conditions:default": ["-pthread", "-lrt", "-ldl"], - }) + envoy_select_force_libcpp([], ["-lstdc++fs", "-latomic"]) + envoy_select_alimesh(["-lcrypt"]) + envoy_dbg_linkopts() + envoy_select_exported_symbols(["-Wl,-E"]) + }) + envoy_select_force_libcpp([], ["-lstdc++fs", "-latomic"]) + envoy_select_higress(["-lcrypt"]) + envoy_dbg_linkopts() + envoy_select_exported_symbols(["-Wl,-E"]) # Envoy C++ fuzz test targets. These are not included in coverage runs. def envoy_cc_fuzz_test( @@ -152,7 +152,7 @@ def envoy_cc_test( repository = "", external_deps = [], deps = [], - alimesh_deps = [], + higress_deps = [], tags = [], args = [], copts = [], @@ -167,8 +167,8 @@ def envoy_cc_test( coverage_tags = tags + ([] if coverage else ["nocoverage"]) deps = deps + select({ - "@envoy//bazel:alimesh": [], - "//conditions:default": alimesh_deps, + "@envoy//bazel:higress": [], + "//conditions:default": higress_deps, }) native.cc_test( @@ -205,7 +205,7 @@ def envoy_cc_test_library( data = [], external_deps = [], deps = [], - alimesh_deps = [], + higress_deps = [], repository = "", tags = [], include_prefix = None, @@ -214,8 +214,8 @@ def envoy_cc_test_library( **kargs): deps = deps + select({ - "@envoy//bazel:alimesh": [], - "//conditions:default": alimesh_deps, + "@envoy//bazel:higress": [], + "//conditions:default": higress_deps, }) disable_pch = kargs.pop("disable_pch", True) diff --git a/contrib/contrib_build_config.bzl b/contrib/contrib_build_config.bzl index adc5998da57a..4667b31e3b16 100644 --- a/contrib/contrib_build_config.bzl +++ b/contrib/contrib_build_config.bzl @@ -43,11 +43,6 @@ CONTRIB_EXTENSIONS = { "envoy.tls.key_providers.cryptomb": "//contrib/cryptomb/private_key_providers/source:config", "envoy.tls.key_providers.qat": "//contrib/qat/private_key_providers/source:config", - # - # Tracers - # - - "envoy.tracers.eagleeye": "//contrib/eagleeye/tracers/source:config", # # Custom cluster plugins @@ -71,7 +66,7 @@ CONTRIB_EXTENSIONS = { # Connection Balance extensions # - # "envoy.network.connection_balance.dlb": "//contrib/network/connection_balance/dlb/source:connection_balancer", + "envoy.network.connection_balance.dlb": "//contrib/network/connection_balance/dlb/source:connection_balancer", # # Regex engines diff --git a/envoy/http/filter.h b/envoy/http/filter.h index 39ef8d12182d..124176cdd47b 100644 --- a/envoy/http/filter.h +++ b/envoy/http/filter.h @@ -494,7 +494,7 @@ class StreamDecoderFilterCallbacks : public virtual StreamFilterCallbacks, * Allows modifying the decoding buffer. May only be called before any data has been continued * past the calling filter. */ -#if defined(ALIMESH) +#if defined(HIGRESS) virtual void modifyDecodingBuffer(std::function callback, bool /* backup_for_replace */) { return modifyDecodingBuffer(callback); @@ -729,7 +729,7 @@ class StreamDecoderFilterCallbacks : public virtual StreamFilterCallbacks, * @param original_response_headers Headers used for logging in the access logs and for charging * stats. Ignored if null. */ -#if defined(ALIMESH) +#if defined(HIGRESS) virtual bool recreateStream(const ResponseHeaderMap* original_response_headers, bool /* use_original_request_body */) { return recreateStream(original_response_headers); @@ -764,7 +764,7 @@ class StreamDecoderFilterCallbacks : public virtual StreamFilterCallbacks, */ virtual absl::optional upstreamOverrideHost() const PURE; -#if defined(ALIMESH) +#if defined(HIGRESS) virtual bool needBuffering() const { return false; } virtual void setNeedBuffering(bool) {} #endif diff --git a/envoy/http/header_map.h b/envoy/http/header_map.h index 1d45282f9c4b..bc8f8c512a5e 100644 --- a/envoy/http/header_map.h +++ b/envoy/http/header_map.h @@ -84,7 +84,7 @@ class LowerCaseString { // Implicit conversion to absl::string_view. operator absl::string_view() const { return string_; } -#if defined(ALIMESH) +#if defined(HIGRESS) virtual ~LowerCaseString() = default; protected: diff --git a/envoy/router/BUILD b/envoy/router/BUILD index 4f9011831520..881c582b2a02 100644 --- a/envoy/router/BUILD +++ b/envoy/router/BUILD @@ -61,7 +61,7 @@ envoy_cc_library( envoy_cc_library( name = "router_interface", hdrs = ["router.h"], - alimesh_deps = [ + higress_deps = [ "//contrib/envoy/http:active_redirect_policy_interface", ], external_deps = ["abseil_optional"], diff --git a/envoy/router/router.h b/envoy/router/router.h index db7b71832f8c..f7a2c1ea80c6 100644 --- a/envoy/router/router.h +++ b/envoy/router/router.h @@ -33,7 +33,7 @@ #include "absl/types/optional.h" -#if defined(ALIMESH) +#if defined(HIGRESS) #include "contrib/envoy/http/active_redirect_policy.h" #endif @@ -1102,7 +1102,7 @@ class RouteEntry : public ResponseEntry { */ virtual const std::string& routeName() const PURE; -#if defined(ALIMESH) +#if defined(HIGRESS) virtual const InternalActiveRedirectPolicy& internalActiveRedirectPolicy() const PURE; #endif /** diff --git a/envoy/router/scopes.h b/envoy/router/scopes.h index 5dbe09e25d25..8e4dbb7a646b 100644 --- a/envoy/router/scopes.h +++ b/envoy/router/scopes.h @@ -92,7 +92,7 @@ class ScopeKeyBuilder { public: virtual ~ScopeKeyBuilder() = default; -#if defined(ALIMESH) +#if defined(HIGRESS) virtual ScopeKeyPtr computeScopeKey(const Http::HeaderMap& headers, const StreamInfo::StreamInfo* info, std::function& recompute) const PURE; @@ -122,7 +122,7 @@ class ScopedConfig : public Envoy::Config::ConfigProvider::Config { */ virtual ConfigConstSharedPtr getRouteConfig(const ScopeKeyPtr& scope_key) const PURE; -#if defined(ALIMESH) +#if defined(HIGRESS) virtual ConfigConstSharedPtr getRouteConfig(const ScopeKeyBuilder* builder, const Http::HeaderMap& headers, const StreamInfo::StreamInfo* info = nullptr) const PURE; diff --git a/envoy/stream_info/stream_info.h b/envoy/stream_info/stream_info.h index d2f0bae9cfb7..0e274326546d 100644 --- a/envoy/stream_info/stream_info.h +++ b/envoy/stream_info/stream_info.h @@ -911,7 +911,7 @@ class StreamInfo { */ virtual void setDownstreamTransportFailureReason(absl::string_view failure_reason) PURE; -#ifdef ALIMESH +#ifdef HIGRESS /** * @param key the filter state key set by wasm filter. * @param value the filter state value set by wasm filter. diff --git a/envoy/upstream/BUILD b/envoy/upstream/BUILD index 9b43ecc3bc2e..a4a31a39ec82 100644 --- a/envoy/upstream/BUILD +++ b/envoy/upstream/BUILD @@ -39,7 +39,7 @@ envoy_cc_library( "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", ], - alimesh_deps = [ + higress_deps = [ "//envoy/redis:async_client_interface", ], ) @@ -145,7 +145,7 @@ envoy_cc_library( "//envoy/http:async_client_interface", "//envoy/tcp:async_tcp_client_interface", ], - alimesh_deps = [ + higress_deps = [ "//envoy/redis:async_client_interface", ], ) diff --git a/envoy/upstream/outlier_detection.h b/envoy/upstream/outlier_detection.h index aefd450cac1d..cf09deef8575 100644 --- a/envoy/upstream/outlier_detection.h +++ b/envoy/upstream/outlier_detection.h @@ -111,7 +111,7 @@ class DetectorHostMonitor { */ virtual double successRate(SuccessRateMonitorType type) const PURE; -#if defined(ALIMESH) +#if defined(HIGRESS) virtual void forceEjectHost() PURE; #endif }; diff --git a/envoy/upstream/thread_local_cluster.h b/envoy/upstream/thread_local_cluster.h index 0dd4162950c5..7787acd751a6 100644 --- a/envoy/upstream/thread_local_cluster.h +++ b/envoy/upstream/thread_local_cluster.h @@ -143,7 +143,7 @@ class ThreadLocalCluster { * owns the client. */ virtual Http::AsyncClient& httpAsyncClient() PURE; -#if defined(ALIMESH) +#if defined(HIGRESS) virtual Redis::AsyncClient& redisAsyncClient() PURE; #endif diff --git a/source/common/http/async_client_impl.cc b/source/common/http/async_client_impl.cc index 977f897f7f69..a35509dcc626 100644 --- a/source/common/http/async_client_impl.cc +++ b/source/common/http/async_client_impl.cc @@ -33,7 +33,7 @@ const AsyncStreamImpl::RouteEntryImpl::ConnectConfigOptRef AsyncStreamImpl::RouteEntryImpl::connect_config_nullopt_; const std::list AsyncStreamImpl::NullCommonConfig::internal_only_headers_; -#if defined(ALIMESH) +#if defined(HIGRESS) const Router::InternalActiveRedirectPoliciesImpl AsyncStreamImpl::RouteEntryImpl::internal_active_redirect_policy_; #endif diff --git a/source/common/http/async_client_impl.h b/source/common/http/async_client_impl.h index 68f7f33014e5..65f78f388246 100644 --- a/source/common/http/async_client_impl.h +++ b/source/common/http/async_client_impl.h @@ -324,7 +324,7 @@ class AsyncStreamImpl : public virtual AsyncClient::Stream, const ConnectConfigOptRef connectConfig() const override { return connect_config_nullopt_; } -#if defined(ALIMESH) +#if defined(HIGRESS) const Router::InternalActiveRedirectPolicy& internalActiveRedirectPolicy() const override { return internal_active_redirect_policy_; } @@ -349,7 +349,7 @@ class AsyncStreamImpl : public virtual AsyncClient::Stream, static const std::multimap opaque_config_; static const NullPathMatchCriterion path_match_criterion_; -#if defined(ALIMESH) +#if defined(HIGRESS) static const Router::InternalActiveRedirectPoliciesImpl internal_active_redirect_policy_; #endif diff --git a/source/common/http/conn_manager_config.h b/source/common/http/conn_manager_config.h index 7d4ec929aecf..ce2910e4182b 100644 --- a/source/common/http/conn_manager_config.h +++ b/source/common/http/conn_manager_config.h @@ -539,7 +539,7 @@ class ConnectionManagerConfig { */ virtual bool addProxyProtocolConnectionState() const PURE; -#if defined(ALIMESH) +#if defined(HIGRESS) /** * @return the timeout seconds will be set in the "Keep-Alive" response header. * Zero indicates this behavior is disabled. diff --git a/source/common/http/conn_manager_impl.cc b/source/common/http/conn_manager_impl.cc index 97bdcc537272..8b23cf77edc8 100644 --- a/source/common/http/conn_manager_impl.cc +++ b/source/common/http/conn_manager_impl.cc @@ -750,7 +750,7 @@ void ConnectionManagerImpl::RdsRouteConfigUpdateRequester::requestRouteConfigUpd const auto& host_header = absl::AsciiStrToLower(parent_.request_headers_->getHostValue()); requestVhdsUpdate(host_header, thread_local_dispatcher, std::move(route_config_updated_cb)); return; -#if defined(ALIMESH) +#if defined(HIGRESS) Router::ScopeKeyPtr scope_key = parent_.snapped_scoped_routes_config_->computeScopeKey( scope_key_builder_.ptr(), *parent_.request_headers_, &parent_.connection()->streamInfo()); #else @@ -1003,7 +1003,7 @@ void ConnectionManagerImpl::ActiveStream::onStreamMaxDurationReached() { void ConnectionManagerImpl::ActiveStream::chargeStats(const ResponseHeaderMap& headers) { uint64_t response_code = Utility::getResponseStatus(headers); -#if defined(ALIMESH) +#if defined(HIGRESS) if (Grpc::Common::hasGrpcContentType(headers)) { absl::optional grpc_status = Grpc::Common::getGrpcStatus(headers); if (grpc_status.has_value()) { @@ -1516,7 +1516,7 @@ void ConnectionManagerImpl::startDrainSequence() { } void ConnectionManagerImpl::ActiveStream::snapScopedRouteConfig() { -#if defined(ALIMESH) +#if defined(HIGRESS) snapped_route_config_ = snapped_scoped_routes_config_->getRouteConfig( connection_manager_.config_.scopeKeyBuilder().ptr(), *request_headers_, &connection()->streamInfo()); @@ -1796,7 +1796,7 @@ void ConnectionManagerImpl::ActiveStream::encodeHeaders(ResponseHeaderMap& heade blockRouteCache(); } -#if defined(ALIMESH) +#if defined(HIGRESS) if (!state_.is_tunneling_ && connection_manager_.codec_->protocol() < Protocol::Http2) { if (connection_manager_.drain_state_ != DrainState::NotDraining) { // If the connection manager is draining send "Connection: Close" on HTTP/1.1 connections. @@ -2153,7 +2153,7 @@ void ConnectionManagerImpl::ActiveStream::onRequestDataTooLarge() { connection_manager_.stats_.named_.downstream_rq_too_large_.inc(); } -#if defined(ALIMESH) +#if defined(HIGRESS) void ConnectionManagerImpl::ActiveStream::recreateStream( StreamInfo::FilterStateSharedPtr filter_state) { return recreateStream(filter_state, false); @@ -2168,7 +2168,7 @@ void ConnectionManagerImpl::ActiveStream::recreateStream( response_encoder_ = nullptr; Buffer::InstancePtr request_data = std::make_unique(); -#if defined(ALIMESH) +#if defined(HIGRESS) bool proxy_body = false; const auto& original_buffered_request_data = filter_manager_.originalBufferedRequestData(); if (use_original_request_body && original_buffered_request_data != nullptr && diff --git a/source/common/http/conn_manager_impl.h b/source/common/http/conn_manager_impl.h index 9cd02c97fbe3..859fd18a546f 100644 --- a/source/common/http/conn_manager_impl.h +++ b/source/common/http/conn_manager_impl.h @@ -285,7 +285,7 @@ class ConnectionManagerImpl : Logger::Loggable, } void disarmRequestTimeout() override; void resetIdleTimer() override; -#if defined(ALIMESH) +#if defined(HIGRESS) void recreateStream(StreamInfo::FilterStateSharedPtr filter_state, bool backup_for_replace) override; #endif diff --git a/source/common/http/conn_manager_utility.cc b/source/common/http/conn_manager_utility.cc index 810e41081f21..984b33ba9668 100644 --- a/source/common/http/conn_manager_utility.cc +++ b/source/common/http/conn_manager_utility.cc @@ -242,7 +242,7 @@ ConnectionManagerUtility::MutateRequestHeadersResult ConnectionManagerUtility::m cleanInternalHeaders(request_headers, edge_request, route_config.internalOnlyHeaders()); } -#if defined(ALIMESH) +#if defined(HIGRESS) request_headers.setReferenceKey(Http::CustomHeaders::get().AliExtendedValues.XEnvoyOriginalHost, request_headers.getHostValue()); #endif diff --git a/source/common/http/filter_manager.cc b/source/common/http/filter_manager.cc index 051c2b2258df..24bb8fa02a84 100644 --- a/source/common/http/filter_manager.cc +++ b/source/common/http/filter_manager.cc @@ -421,7 +421,7 @@ const Buffer::Instance* ActiveStreamDecoderFilter::decodingBuffer() { return parent_.buffered_request_data_.get(); } -#if defined(ALIMESH) +#if defined(HIGRESS) void ActiveStreamDecoderFilter::modifyDecodingBuffer( std::function callback) { modifyDecodingBuffer(callback, false); @@ -1549,7 +1549,7 @@ void ActiveStreamDecoderFilter::setDecoderBufferLimit(uint32_t limit) { uint32_t ActiveStreamDecoderFilter::decoderBufferLimit() { return parent_.buffer_limit_; } -#if defined(ALIMESH) +#if defined(HIGRESS) bool ActiveStreamDecoderFilter::recreateStream(const ResponseHeaderMap* headers) { return recreateStream(headers, false); } @@ -1580,7 +1580,7 @@ bool ActiveStreamDecoderFilter::recreateStream(const ResponseHeaderMap* headers) parent_.filter_manager_callbacks_.chargeStats(*headers); } -#if defined(ALIMESH) +#if defined(HIGRESS) parent_.filter_manager_callbacks_.recreateStream(parent_.streamInfo().filterState(), use_original_request_body); #else diff --git a/source/common/http/filter_manager.h b/source/common/http/filter_manager.h index 83f4e885cb14..5f3a4d99526d 100644 --- a/source/common/http/filter_manager.h +++ b/source/common/http/filter_manager.h @@ -210,7 +210,7 @@ struct ActiveStreamDecoderFilter : public ActiveStreamFilterBase, void continueDecoding() override; const Buffer::Instance* decodingBuffer() override; -#if defined(ALIMESH) +#if defined(HIGRESS) void modifyDecodingBuffer(std::function callback, bool backup_for_replace) override; #endif @@ -236,7 +236,7 @@ struct ActiveStreamDecoderFilter : public ActiveStreamFilterBase, removeDownstreamWatermarkCallbacks(DownstreamWatermarkCallbacks& watermark_callbacks) override; void setDecoderBufferLimit(uint32_t limit) override; uint32_t decoderBufferLimit() override; -#if defined(ALIMESH) +#if defined(HIGRESS) bool recreateStream(const Http::ResponseHeaderMap* original_response_headers, bool use_original_request_body) override; #endif @@ -248,7 +248,7 @@ struct ActiveStreamDecoderFilter : public ActiveStreamFilterBase, Buffer::BufferMemoryAccountSharedPtr account() const override; void setUpstreamOverrideHost(absl::string_view host) override; absl::optional upstreamOverrideHost() const override; -#if defined(ALIMESH) +#if defined(HIGRESS) bool needBuffering() const override { return need_buffering_; } void setNeedBuffering(bool need) override { need_buffering_ = need; } #endif @@ -266,7 +266,7 @@ struct ActiveStreamDecoderFilter : public ActiveStreamFilterBase, StreamDecoderFilterSharedPtr handle_; bool is_grpc_request_{}; -#if defined(ALIMESH) +#if defined(HIGRESS) bool need_buffering_{}; #endif }; @@ -466,7 +466,7 @@ class FilterManagerCallbacks { /** * Called when the stream should be re-created, e.g. for an internal redirect. */ -#if defined(ALIMESH) +#if defined(HIGRESS) virtual void recreateStream(StreamInfo::FilterStateSharedPtr filter_state, bool /* use_original_request_body */) { recreateStream(filter_state); @@ -837,7 +837,7 @@ class FilterManager : public ScopeTrackedObject, Buffer::InstancePtr& bufferedRequestData() { return buffered_request_data_; } -#if defined(ALIMESH) +#if defined(HIGRESS) Buffer::InstancePtr& originalBufferedRequestData() { return original_buffered_request_data_; } #endif @@ -1023,7 +1023,7 @@ class FilterManager : public ScopeTrackedObject, std::unique_ptr request_metadata_map_vector_; Buffer::InstancePtr buffered_response_data_; Buffer::InstancePtr buffered_request_data_; -#if defined(ALIMESH) +#if defined(HIGRESS) Buffer::InstancePtr original_buffered_request_data_; #endif uint32_t buffer_limit_{0}; diff --git a/source/common/http/headers.h b/source/common/http/headers.h index 37fdfea890ae..ec9fa4c8ea19 100644 --- a/source/common/http/headers.h +++ b/source/common/http/headers.h @@ -129,7 +129,7 @@ class CustomHeaderValues { const std::string Wildcard{"*"}; } VaryValues; -#if defined(ALIMESH) +#if defined(HIGRESS) struct { const LowerCaseString TriArriveTime{"req-arrive-time"}; const LowerCaseString TriCostTime{"req-cost-time"}; diff --git a/source/common/protobuf/utility.cc b/source/common/protobuf/utility.cc index 1f9df858683d..0ceb95edb52e 100644 --- a/source/common/protobuf/utility.cc +++ b/source/common/protobuf/utility.cc @@ -508,7 +508,7 @@ void redact(Protobuf::Message* message, bool ancestor_is_sensitive) { redact(reflection->MutableRepeatedMessage(message, field_descriptor, i), sensitive); } } else if (reflection->HasField(*message, field_descriptor)) { -#if defined(ALIMESH) +#if defined(HIGRESS) // The content of the poll_delay field cannot be displayed because the typed_config field of // PrivateKeyProvider is set to "udpa.annotations.sensitive". However, the content of the // poll_delay field is not sensitive data. To facilitate debugging, we support outputting diff --git a/source/common/protobuf/utility.h b/source/common/protobuf/utility.h index eb15f9a3d0f2..8012a84f5fc8 100644 --- a/source/common/protobuf/utility.h +++ b/source/common/protobuf/utility.h @@ -39,7 +39,7 @@ ((message).has_##field_name() ? DurationUtil::durationToMilliseconds((message).field_name()) \ : (default_value)) -#if defined(ALIMESH) +#if defined(HIGRESS) // Obtain the seconds value of a google.protobuf.Duration field if set. Otherwise, return the // default value. #define PROTOBUF_GET_SECONDS_OR_DEFAULT(message, field_name, default_value) \ diff --git a/source/common/router/BUILD b/source/common/router/BUILD index 44c48aca4971..3e060d824cf1 100644 --- a/source/common/router/BUILD +++ b/source/common/router/BUILD @@ -35,7 +35,7 @@ envoy_cc_library( name = "config_lib", srcs = ["config_impl.cc"], hdrs = ["config_impl.h"], - alimesh_deps = [ + higress_deps = [ "//contrib/common/active_redirect/source:active_redirect_policy_lib", ], external_deps = ["abseil_optional"], @@ -217,7 +217,7 @@ envoy_cc_library( "@envoy_api//envoy/config/route/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto", ], - alimesh_deps = [ + higress_deps = [ "//source/common/http:header_utility_lib", ], ) @@ -287,7 +287,7 @@ envoy_cc_library( "router.h", "upstream_request.h", ], - alimesh_deps = [ + higress_deps = [ "//envoy/stats:timespan_interface", ], deps = [ diff --git a/source/common/router/config_impl.cc b/source/common/router/config_impl.cc index 2934520bd597..d2bead7d6219 100644 --- a/source/common/router/config_impl.cc +++ b/source/common/router/config_impl.cc @@ -525,7 +525,7 @@ RouteEntryImplBase::RouteEntryImplBase(const CommonVirtualHostSharedPtr& vhost, vhost_->globalRouteConfig().maxDirectResponseBodySizeBytes())), per_filter_configs_(route.typed_per_filter_config(), optional_http_filters, factory_context, validator), -#if !defined(ALIMESH) +#if !defined(HIGRESS) route_name_(route.name()), time_source_(factory_context.mainThreadDispatcher().timeSource()), #else route_name_(route.name()), time_source_(factory_context.mainThreadDispatcher().timeSource()), @@ -606,7 +606,7 @@ RouteEntryImplBase::RouteEntryImplBase(const CommonVirtualHostSharedPtr& vhost, weighted_clusters_config_ = std::make_unique( weighted_clusters, total_weight, route.route().weighted_clusters().header_name()); -#if defined(ALIMESH) +#if defined(HIGRESS) if (route.route().weighted_clusters().has_inline_cluster_specifier_plugin()) { cluster_specifier_plugin_ = getClusterSpecifierPluginByTheProto( route.route().weighted_clusters().inline_cluster_specifier_plugin(), validator, @@ -880,7 +880,7 @@ void RouteEntryImplBase::finalizeRequestHeaders(Http::RequestHeaderMap& headers, absl::optional container; if (!getPathRewrite(headers, container).empty() || regex_rewrite_ != nullptr || path_rewriter_ != nullptr) { -#if defined(ALIMESH) +#if defined(HIGRESS) // We need to store the original path of access log when user enable the suppress_envoy_headers // option. if (!insert_envoy_original_path) { @@ -1146,7 +1146,7 @@ std::unique_ptr RouteEntryImplBase::buildInternalRed return std::make_unique(policy_config, validator, current_route_name); } -#if defined(ALIMESH) +#if defined(HIGRESS) std::unique_ptr RouteEntryImplBase::buildActiveInternalRedirectPolicy( const envoy::config::route::v3::RouteAction& route_config, @@ -1381,7 +1381,7 @@ RouteConstSharedPtr RouteEntryImplBase::pickWeightedCluster(const Http::HeaderMa } if (selected_value >= begin && selected_value < end) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (cluster_specifier_plugin_ != nullptr) { auto request_header = dynamic_cast(&headers); if (!cluster->clusterHeaderName().get().empty() && @@ -1883,7 +1883,7 @@ VirtualHostImpl::VirtualHostImpl( } } -#if defined(ALIMESH) +#if defined(HIGRESS) for (const auto& server_name : virtual_host.allow_server_names()) { auto isWildcardServerName = absl::StartsWith(server_name, "*."); if (absl::StrContains(server_name, '*') && !isWildcardServerName) { @@ -1903,7 +1903,7 @@ VirtualHostImpl::VirtualHostImpl( const std::shared_ptr VirtualHostImpl::SSL_REDIRECT_ROUTE{ new SslRedirectRoute()}; -#if defined(ALIMESH) +#if defined(HIGRESS) const SslPermanentRedirector SslPermanentRedirectRoute::SSL_PERMANENT_REDIRECTOR; const std::shared_ptr VirtualHostImpl::SSL_PERMANENT_REDIRECT_ROUTE{new SslPermanentRedirectRoute}; @@ -1969,7 +1969,7 @@ RouteConstSharedPtr VirtualHostImpl::getRouteFromEntries(const RouteCallback& cb return nullptr; } -#if defined(ALIMESH) +#if defined(HIGRESS) // First check for sni redirect. if (allow_server_names_.empty()) { goto SNI_CHECK_PASS; diff --git a/source/common/router/config_impl.h b/source/common/router/config_impl.h index 53a7519dfe00..fd012818f04b 100644 --- a/source/common/router/config_impl.h +++ b/source/common/router/config_impl.h @@ -39,7 +39,7 @@ #include "absl/container/node_hash_map.h" #include "absl/types/optional.h" -#if defined(ALIMESH) +#if defined(HIGRESS) #include "contrib/common/active_redirect/source/active_redirect_policy_impl.h" #endif @@ -162,7 +162,7 @@ class SslRedirectRoute : public Route { typed_metadata_; }; -#if defined(ALIMESH) +#if defined(HIGRESS) class SslPermanentRedirector : public SslRedirector { public: Http::Code responseCode() const override { return Http::Code::PermanentRedirect; } @@ -446,7 +446,7 @@ class VirtualHostImpl : Logger::Loggable { enum class SslRequirements : uint8_t { None, ExternalOnly, All }; static const std::shared_ptr SSL_REDIRECT_ROUTE; -#if defined(ALIMESH) +#if defined(HIGRESS) static const std::shared_ptr SSL_PERMANENT_REDIRECT_ROUTE; static const std::shared_ptr SNI_REDIRECT_ROUTE; #endif @@ -457,7 +457,7 @@ class VirtualHostImpl : Logger::Loggable { std::vector routes_; Matcher::MatchTreeSharedPtr matcher_; -#if defined(ALIMESH) +#if defined(HIGRESS) std::vector allow_server_names_; #endif }; @@ -770,7 +770,7 @@ class RouteEntryImplBase : public RouteEntryAndRoute, } return DefaultInternalRedirectPolicy::get(); } -#if defined(ALIMESH) +#if defined(HIGRESS) const InternalActiveRedirectPolicy& internalActiveRedirectPolicy() const override { if (internal_active_redirect_policy_ != nullptr) { return *internal_active_redirect_policy_; @@ -891,7 +891,7 @@ class RouteEntryImplBase : public RouteEntryAndRoute, // path matching to ignore the path-parameters. absl::string_view sanitizePathBeforePathMatching(const absl::string_view path) const; -#if defined(ALIMESH) +#if defined(HIGRESS) class DynamicRouteEntry : public RouteEntryAndRoute, public std::enable_shared_from_this { #else @@ -1028,7 +1028,7 @@ class RouteEntryImplBase : public RouteEntryAndRoute, parent_->traversePerFilterConfig(filter_name, cb); }; -#if defined(ALIMESH) +#if defined(HIGRESS) const InternalActiveRedirectPolicy& internalActiveRedirectPolicy() const override { return parent_->internalActiveRedirectPolicy(); } @@ -1135,7 +1135,7 @@ class RouteEntryImplBase : public RouteEntryAndRoute, const Http::LowerCaseString& clusterHeaderName() const { return cluster_header_name_; } -#if defined(ALIMESH) +#if defined(HIGRESS) RouteConstSharedPtr getRouteConstSharedPtr() const override { return shared_from_this(); } #endif @@ -1268,7 +1268,7 @@ class RouteEntryImplBase : public RouteEntryAndRoute, PathRewriterSharedPtr buildPathRewriter(envoy::config::route::v3::Route route, ProtobufMessage::ValidationVisitor& validator) const; -#if defined(ALIMESH) +#if defined(HIGRESS) std::unique_ptr buildActiveInternalRedirectPolicy(const envoy::config::route::v3::RouteAction& route_config, ProtobufMessage::ValidationVisitor& validator, @@ -1329,7 +1329,7 @@ class RouteEntryImplBase : public RouteEntryAndRoute, PerFilterConfigs per_filter_configs_; const std::string route_name_; TimeSource& time_source_; -#if defined(ALIMESH) +#if defined(HIGRESS) std::unique_ptr internal_active_redirect_policy_; #endif EarlyDataPolicyPtr early_data_policy_; diff --git a/source/common/router/delegating_route_impl.h b/source/common/router/delegating_route_impl.h index 0e77d79b4f48..d05fbdd823d3 100644 --- a/source/common/router/delegating_route_impl.h +++ b/source/common/router/delegating_route_impl.h @@ -117,7 +117,7 @@ class DelegatingRouteEntry : public Router::RouteEntry { const EarlyDataPolicy& earlyDataPolicy() const override; const RouteStatsContextOptRef routeStatsContext() const override; -#if defined(ALIMESH) +#if defined(HIGRESS) const InternalActiveRedirectPolicy& internalActiveRedirectPolicy() const override { return base_route_->routeEntry()->internalActiveRedirectPolicy(); } diff --git a/source/common/router/router.cc b/source/common/router/router.cc index 72727c6512c1..b92f6a1655a0 100644 --- a/source/common/router/router.cc +++ b/source/common/router/router.cc @@ -42,7 +42,7 @@ #include "source/common/stream_info/uint32_accessor_impl.h" #include "source/common/tracing/http_tracer_impl.h" -#if defined(ALIMESH) +#if defined(HIGRESS) #include "source/common/http/path_utility.h" #endif @@ -319,7 +319,7 @@ Stats::StatName Filter::upstreamZone(Upstream::HostDescriptionConstSharedPtr ups return upstream_host ? upstream_host->localityZoneStatName() : config_.empty_stat_name_; } -#if defined(ALIMESH) +#if defined(HIGRESS) void Filter::chargeUpstreamGrpcCode(uint64_t http_status_code, uint64_t grpc_response_code, const Http::ResponseHeaderMap& response_headers, Upstream::HostDescriptionConstSharedPtr upstream_host, @@ -720,7 +720,7 @@ Http::FilterHeadersStatus Filter::decodeHeaders(Http::RequestHeaderMap& headers, } callbacks_->streamInfo().setAttemptCount(attempt_count_); -#if defined(ALIMESH) +#if defined(HIGRESS) Http::HeaderString start_time; start_time.setInteger(std::chrono::duration_cast( callbacks_->streamInfo().startTime().time_since_epoch()) @@ -871,7 +871,7 @@ Http::FilterDataStatus Filter::decodeData(Buffer::Instance& data, bool end_strea // a backoff timer. ASSERT(upstream_requests_.size() <= 1); -#if defined(ALIMESH) +#if defined(HIGRESS) bool buffering = (retry_state_ && retry_state_->enabled()) || callbacks_->needBuffering() || (!active_shadow_policies_.empty() && !streaming_shadows_) || (route_entry_ && route_entry_->internalRedirectPolicy().enabled()); @@ -1529,7 +1529,7 @@ void Filter::onUpstreamHeaders(uint64_t response_code, Http::ResponseHeaderMapPt upstream_request.upstreamHost()->outlierDetector().putHttpResponseCode(response_code); } -#if defined(ALIMESH) +#if defined(HIGRESS) static Envoy::Http::LowerCaseString shutdown_key("micro.service.shutdown.endpoint"); if (!headers->get(shutdown_key).empty()) { upstream_request.upstreamHost()->outlierDetector().forceEjectHost(); @@ -1599,7 +1599,7 @@ void Filter::onUpstreamHeaders(uint64_t response_code, Http::ResponseHeaderMapPt // next downstream. } -#if defined(ALIMESH) +#if defined(HIGRESS) if (route_entry_->internalActiveRedirectPolicy().enabled() && route_entry_->internalActiveRedirectPolicy().shouldRedirectForResponseCode( static_cast(response_code)) && @@ -1638,7 +1638,7 @@ void Filter::onUpstreamHeaders(uint64_t response_code, Http::ResponseHeaderMapPt MonotonicTime response_received_time = dispatcher.timeSource().monotonicTime(); std::chrono::milliseconds ms = std::chrono::duration_cast( response_received_time - downstream_request_complete_time_); -#if defined(ALIMESH) +#if defined(HIGRESS) std::chrono::milliseconds duration_ms = std::chrono::duration_cast( response_received_time - callbacks_->streamInfo().startTimeMonotonic()); Http::HeaderString cost_time; @@ -1674,7 +1674,7 @@ void Filter::onUpstreamHeaders(uint64_t response_code, Http::ResponseHeaderMapPt upstream_request.upstreamCanary( (headers->EnvoyUpstreamCanary() && headers->EnvoyUpstreamCanary()->value() == "true") || upstream_request.upstreamHost()->canary()); -#if defined(ALIMESH) +#if defined(HIGRESS) if (grpc_status.has_value()) { chargeUpstreamGrpcCode(response_code, grpc_to_http_status, *headers, upstream_request.upstreamHost(), false); @@ -1974,7 +1974,7 @@ bool Filter::convertRequestHeadersForInternalRedirect(Http::RequestHeaderMap& do return true; } -#if defined(ALIMESH) +#if defined(HIGRESS) bool Filter::setupActiveRedirect(const Http::ResponseHeaderMap&, UpstreamRequest&) { ENVOY_STREAM_LOG(debug, "attempting internal active redirect", *callbacks_); diff --git a/source/common/router/router.h b/source/common/router/router.h index f83f561d3ad7..f79b1d5b70f5 100644 --- a/source/common/router/router.h +++ b/source/common/router/router.h @@ -44,7 +44,7 @@ #include "source/common/upstream/load_balancer_impl.h" #include "source/common/upstream/upstream_factory_context_impl.h" -#if defined(ALIMESH) +#if defined(HIGRESS) #include "envoy/stats/timespan.h" #endif @@ -582,7 +582,7 @@ class Filter : Logger::Loggable, void onPerTryTimeoutCommon(UpstreamRequest& upstream_request, Stats::Counter& error_counter, const std::string& response_code_details); Stats::StatName upstreamZone(Upstream::HostDescriptionConstSharedPtr upstream_host); -#if defined(ALIMESH) +#if defined(HIGRESS) void chargeUpstreamGrpcCode(uint64_t http_status_code, uint64_t grpc_response_code, const Http::ResponseHeaderMap& response_headers, Upstream::HostDescriptionConstSharedPtr upstream_host, bool dropped); @@ -646,7 +646,7 @@ class Filter : Logger::Loggable, uint64_t grpc_to_http_status); Http::Context& httpContext() { return config_.http_context_; } -#if defined(ALIMESH) +#if defined(HIGRESS) bool setupActiveRedirect(const Http::ResponseHeaderMap& headers, UpstreamRequest& upstream_request); bool convertRequestHeadersForInternalActiveRedirect(Http::RequestHeaderMap& downstream_headers); diff --git a/source/common/router/scoped_config_impl.cc b/source/common/router/scoped_config_impl.cc index 20aed94c319a..bd4a6412a318 100644 --- a/source/common/router/scoped_config_impl.cc +++ b/source/common/router/scoped_config_impl.cc @@ -5,14 +5,14 @@ #include "source/common/protobuf/utility.h" -#if defined(ALIMESH) +#if defined(HIGRESS) #include "source/common/http/header_utility.h" #endif namespace Envoy { namespace Router { -#if defined(ALIMESH) +#if defined(HIGRESS) namespace { std::string maskFirstDNSLabel(absl::string_view host) { @@ -281,7 +281,7 @@ ScopeKeyBuilderImpl::ScopeKeyBuilderImpl(ScopedRoutes::ScopeKeyBuilder&& config) : ScopeKeyBuilderBase(std::move(config)) { for (const auto& fragment_builder : config_.fragments()) { switch (fragment_builder.type_case()) { -#if defined(ALIMESH) +#if defined(HIGRESS) case ScopedRoutes::ScopeKeyBuilder::FragmentBuilder::kHostValueExtractor: fragment_builders_.emplace_back(std::make_unique( ScopedRoutes::ScopeKeyBuilder::FragmentBuilder(fragment_builder))); @@ -305,7 +305,7 @@ ScopeKeyPtr ScopeKeyBuilderImpl::computeScopeKey(const Http::HeaderMap& headers) ScopeKey key; for (const auto& builder : fragment_builders_) { // returns nullopt if a null fragment is found. -#if defined(ALIMESH) +#if defined(HIGRESS) ReComputeCbPtr recompute_fragment_cb = std::make_shared(); std::unique_ptr fragment = builder->computeFragment(headers, nullptr, recompute_fragment_cb); diff --git a/source/common/router/scoped_config_impl.h b/source/common/router/scoped_config_impl.h index c8250517c792..96425a4c74a2 100644 --- a/source/common/router/scoped_config_impl.h +++ b/source/common/router/scoped_config_impl.h @@ -22,7 +22,7 @@ namespace Router { using envoy::extensions::filters::network::http_connection_manager::v3::ScopedRoutes; -#if defined(ALIMESH) +#if defined(HIGRESS) using ReComputeCb = std::function()>; using ReComputeCbPtr = std::shared_ptr; using ReComputeCbWeakPtr = std::weak_ptr; @@ -37,7 +37,7 @@ class FragmentBuilderBase { : config_(std::move(config)) {} virtual ~FragmentBuilderBase() = default; -#if defined(ALIMESH) +#if defined(HIGRESS) virtual std::unique_ptr computeFragment(const Http::HeaderMap& headers, const StreamInfo::StreamInfo* info, ReComputeCbPtr& recompute) const PURE; @@ -56,7 +56,7 @@ class HeaderValueExtractorImpl : public FragmentBuilderBase { public: explicit HeaderValueExtractorImpl(ScopedRoutes::ScopeKeyBuilder::FragmentBuilder&& config); -#if defined(ALIMESH) +#if defined(HIGRESS) std::unique_ptr computeFragment(const Http::HeaderMap& headers, const StreamInfo::StreamInfo* info, ReComputeCbPtr& recompute) const override; @@ -72,7 +72,7 @@ class HeaderValueExtractorImpl : public FragmentBuilderBase { header_value_extractor_config_; }; -#if defined(ALIMESH) +#if defined(HIGRESS) class HostValueExtractorImpl : public FragmentBuilderBase { public: explicit HostValueExtractorImpl(ScopedRoutes::ScopeKeyBuilder::FragmentBuilder&& config); @@ -118,7 +118,7 @@ class ScopeKeyBuilderImpl : public ScopeKeyBuilderBase { public: explicit ScopeKeyBuilderImpl(ScopedRoutes::ScopeKeyBuilder&& config); -#if defined(ALIMESH) +#if defined(HIGRESS) ScopeKeyPtr computeScopeKey(const Http::HeaderMap& headers, const StreamInfo::StreamInfo* info, std::function& recompute) const override; // only for test @@ -177,7 +177,7 @@ class ScopedConfigImpl : public ScopedConfig { Router::ConfigConstSharedPtr getRouteConfig(const ScopeKeyPtr& scope_key) const override; -#if defined(ALIMESH) +#if defined(HIGRESS) Router::ConfigConstSharedPtr getRouteConfig(const ScopeKeyBuilder* scope_key_builder, const Http::HeaderMap& headers, const StreamInfo::StreamInfo* info) const override; @@ -201,7 +201,7 @@ class NullScopedConfigImpl : public ScopedConfig { Router::ConfigConstSharedPtr getRouteConfig(const ScopeKeyPtr&) const override { return std::make_shared(); } -#if defined(ALIMESH) +#if defined(HIGRESS) Router::ConfigConstSharedPtr getRouteConfig(const ScopeKeyBuilder*, const Http::HeaderMap&, const StreamInfo::StreamInfo*) const override { return std::make_shared(); diff --git a/source/common/router/upstream_request.cc b/source/common/router/upstream_request.cc index 4cb4e98a2567..2b70090128f7 100644 --- a/source/common/router/upstream_request.cc +++ b/source/common/router/upstream_request.cc @@ -111,7 +111,7 @@ UpstreamRequest::UpstreamRequest(RouterFilterInterface& parent, auto upstream_host = conn_pool_->host(); if (span_ != nullptr) { span_->injectContext(*parent_.downstreamHeaders(), upstream_host); -#if defined(ALIMESH) +#if defined(HIGRESS) if (upstream_host != nullptr && upstream_host->address() != nullptr && upstream_host->address()->ip() != nullptr) { const std::string& address = upstream_host->address()->ip()->addressAsString(); diff --git a/source/common/secret/secret_manager_impl.h b/source/common/secret/secret_manager_impl.h index 28d14eca970d..90246d92ad33 100644 --- a/source/common/secret/secret_manager_impl.h +++ b/source/common/secret/secret_manager_impl.h @@ -16,7 +16,7 @@ namespace Envoy { namespace Secret { -#if defined(ALIMESH) +#if defined(HIGRESS) class SecretManagerImpl : public SecretManager, public Logger::Loggable { #else class SecretManagerImpl : public SecretManager { diff --git a/source/common/stream_info/stream_info_impl.h b/source/common/stream_info/stream_info_impl.h index 61e702667c39..21a7a098dc1d 100644 --- a/source/common/stream_info/stream_info_impl.h +++ b/source/common/stream_info/stream_info_impl.h @@ -404,7 +404,7 @@ struct StreamInfoImpl : public StreamInfo { return downstream_transport_failure_reason_; } -#ifdef ALIMESH +#ifdef HIGRESS void setCustomSpanTag(std::string_view key, std::string_view value) override { auto it = custom_span_tags_.find(key); if (it != custom_span_tags_.end()) { @@ -475,7 +475,7 @@ struct StreamInfoImpl : public StreamInfo { BytesMeterSharedPtr downstream_bytes_meter_; bool is_shadow_{false}; std::string downstream_transport_failure_reason_; -#ifdef ALIMESH +#ifdef HIGRESS absl::flat_hash_map custom_span_tags_; #endif }; diff --git a/source/common/tracing/http_tracer_impl.cc b/source/common/tracing/http_tracer_impl.cc index b99baed21318..39aedb0885e8 100644 --- a/source/common/tracing/http_tracer_impl.cc +++ b/source/common/tracing/http_tracer_impl.cc @@ -218,7 +218,7 @@ void HttpTracerUtility::setCommonTags(Span& span, const StreamInfo::StreamInfo& span.setTag(Tracing::Tags::get().Component, Tracing::Tags::get().Proxy); -#ifdef ALIMESH +#ifdef HIGRESS // Wasm filter state const auto& custom_span_tags = stream_info.getCustomSpanTagMap(); for (const auto& it: custom_span_tags) { diff --git a/source/common/tracing/tracer_impl.cc b/source/common/tracing/tracer_impl.cc index 35112b3a05f7..cf4df7a17fc2 100644 --- a/source/common/tracing/tracer_impl.cc +++ b/source/common/tracing/tracer_impl.cc @@ -156,7 +156,7 @@ SpanPtr TracerImpl::startSpan(const Config& config, TraceContext& trace_context, if (active_span) { active_span->setTag(Tracing::Tags::get().NodeId, local_info_.nodeName()); active_span->setTag(Tracing::Tags::get().Zone, local_info_.zoneName()); -#if defined(ALIMESH) +#if defined(HIGRESS) const std::string& remote_address = stream_info.downstreamAddressProvider().localAddress()->ip()->addressAsString(); if (stream_info.downstreamAddressProvider().localAddress()->ip()->version() == diff --git a/source/common/upstream/BUILD b/source/common/upstream/BUILD index 23b0e2e088aa..e3e63553be38 100644 --- a/source/common/upstream/BUILD +++ b/source/common/upstream/BUILD @@ -131,7 +131,7 @@ envoy_cc_library( "//source/common/http/http3:conn_pool_lib", "//source/common/http:conn_pool_grid", ]), - alimesh_deps = [ + higress_deps = [ "//source/common/redis:async_client_lib", ] ) diff --git a/source/common/upstream/cluster_manager_impl.cc b/source/common/upstream/cluster_manager_impl.cc index 45e0f68c2ec2..6fd11863118e 100644 --- a/source/common/upstream/cluster_manager_impl.cc +++ b/source/common/upstream/cluster_manager_impl.cc @@ -51,7 +51,7 @@ #include "source/common/quic/client_connection_factory_impl.h" #endif -#if defined(ALIMESH) +#if defined(HIGRESS) #include "source/common/redis/async_client_impl.h" #endif @@ -1207,7 +1207,7 @@ ClusterManagerImpl::ThreadLocalClusterManagerImpl::ClusterEntry::httpAsyncClient return *lazy_http_async_client_; } -#if defined(ALIMESH) +#if defined(HIGRESS) Redis::AsyncClient& ClusterManagerImpl::ThreadLocalClusterManagerImpl::ClusterEntry::redisAsyncClient() { using Extensions::NetworkFilters::Common::Redis::RedisCommandStats; diff --git a/source/common/upstream/cluster_manager_impl.h b/source/common/upstream/cluster_manager_impl.h index f01783ce7aa1..247d981379ed 100644 --- a/source/common/upstream/cluster_manager_impl.h +++ b/source/common/upstream/cluster_manager_impl.h @@ -525,7 +525,7 @@ class ClusterManagerImpl : public ClusterManager, LoadBalancerContext* context) override; Host::CreateConnectionData tcpConn(LoadBalancerContext* context) override; Http::AsyncClient& httpAsyncClient() override; -#if defined(ALIMESH) +#if defined(HIGRESS) Redis::AsyncClient& redisAsyncClient() override; #endif Tcp::AsyncTcpClientPtr @@ -576,7 +576,7 @@ class ClusterManagerImpl : public ClusterManager, // Current active LB. LoadBalancerPtr lb_; Http::AsyncClientPtr lazy_http_async_client_; -#if defined(ALIMESH) +#if defined(HIGRESS) Redis::AsyncClientPtr lazy_redis_async_client_; #endif // Stores QUICHE specific objects which live through out the life time of the cluster and can diff --git a/source/common/upstream/outlier_detection_impl.cc b/source/common/upstream/outlier_detection_impl.cc index 8eedf688b8c9..c4e1a2c300d2 100644 --- a/source/common/upstream/outlier_detection_impl.cc +++ b/source/common/upstream/outlier_detection_impl.cc @@ -65,7 +65,7 @@ void DetectorHostMonitorImpl::updateCurrentSuccessRateBucket() { local_origin_sr_monitor_.updateCurrentSuccessRateBucket(); } -#if defined(ALIMESH) +#if defined(HIGRESS) void DetectorHostMonitorImpl::forceEjectHost() { std::shared_ptr detector = detector_.lock(); if (!detector) { diff --git a/source/common/upstream/outlier_detection_impl.h b/source/common/upstream/outlier_detection_impl.h index 16da9e886a49..e8caf5dd3733 100644 --- a/source/common/upstream/outlier_detection_impl.h +++ b/source/common/upstream/outlier_detection_impl.h @@ -166,7 +166,7 @@ class DetectorHostMonitorImpl : public DetectorHostMonitor { void localOriginFailure(); void localOriginNoFailure(); -#if defined(ALIMESH) +#if defined(HIGRESS) void forceEjectHost() override; #endif // handlers for setting and getting jitter, used to add a random value diff --git a/source/common/upstream/upstream_impl.h b/source/common/upstream/upstream_impl.h index bcbebb6356f4..8cbf785d5599 100644 --- a/source/common/upstream/upstream_impl.h +++ b/source/common/upstream/upstream_impl.h @@ -190,7 +190,7 @@ class DetectorHostMonitorNullImpl : public Outlier::DetectorHostMonitor { const absl::optional& lastUnejectionTime() override { return time_; } double successRate(SuccessRateMonitorType) const override { return -1; } -#if defined(ALIMESH) +#if defined(HIGRESS) void forceEjectHost() override {} #endif diff --git a/source/exe/BUILD b/source/exe/BUILD index d56d7a99c839..dfcb358f032a 100644 --- a/source/exe/BUILD +++ b/source/exe/BUILD @@ -49,7 +49,7 @@ envoy_cc_library( "//bazel:darwin": envoy_all_extensions(DARWIN_SKIP_TARGETS), "//conditions:default": envoy_all_extensions(), }), - alimesh_deps = [ + higress_deps = [ # "//external:basic_auth_lib", ], ) diff --git a/source/extensions/common/wasm/context.cc b/source/extensions/common/wasm/context.cc index 91348a69eebb..25f45866d3ae 100644 --- a/source/extensions/common/wasm/context.cc +++ b/source/extensions/common/wasm/context.cc @@ -59,7 +59,7 @@ namespace { // FilterState prefix for CelState values. constexpr absl::string_view CelStateKeyPrefix = "wasm."; -#if defined(ALIMESH) +#if defined(HIGRESS) constexpr absl::string_view CustomeTraceSpanTagPrefix = "trace_span_tag."; constexpr std::string_view ClearRouteCacheKey = "clear_route_cache"; constexpr std::string_view DisableClearRouteCache = "off"; @@ -473,7 +473,7 @@ Context::findValue(absl::string_view name, Protobuf::Arena* arena, bool last) co using google::api::expr::runtime::CelProtoWrapper; using google::api::expr::runtime::CelValue; -#if defined(ALIMESH) +#if defined(HIGRESS) Envoy::Http::StreamFilterCallbacks* filter_callbacks = decoder_callbacks_; if (filter_callbacks == nullptr) { filter_callbacks = encoder_callbacks_; @@ -566,7 +566,7 @@ Context::findValue(absl::string_view name, Protobuf::Arena* arena, bool last) co } break; case PropertyToken::ROUTE_NAME: -#if defined(ALIMESH) +#if defined(HIGRESS) if (info && !info->getRouteName().empty()) { return CelValue::CreateString(&info->getRouteName()); } @@ -762,7 +762,7 @@ WasmResult Context::addHeaderMapValue(WasmHeaderMapType type, std::string_view k } const Http::LowerCaseString lower_key{std::string(key)}; map->addCopy(lower_key, std::string(value)); -#if defined(ALIMESH) +#if defined(HIGRESS) if (type == WasmHeaderMapType::RequestHeaders && decoder_callbacks_ && !disable_clear_route_cache_) { decoder_callbacks_->downstreamCallbacks()->clearRouteCache(); @@ -844,7 +844,7 @@ WasmResult Context::setHeaderMapPairs(WasmHeaderMapType type, const Pairs& pairs const Http::LowerCaseString lower_key{std::string(p.first)}; map->addCopy(lower_key, std::string(p.second)); } -#if defined(ALIMESH) +#if defined(HIGRESS) if (type == WasmHeaderMapType::RequestHeaders && decoder_callbacks_ && !disable_clear_route_cache_) { decoder_callbacks_->downstreamCallbacks()->clearRouteCache(); @@ -864,7 +864,7 @@ WasmResult Context::removeHeaderMapValue(WasmHeaderMapType type, std::string_vie } const Http::LowerCaseString lower_key{std::string(key)}; map->remove(lower_key); -#if defined(ALIMESH) +#if defined(HIGRESS) if (type == WasmHeaderMapType::RequestHeaders && decoder_callbacks_ && !disable_clear_route_cache_) { decoder_callbacks_->downstreamCallbacks()->clearRouteCache(); @@ -885,7 +885,7 @@ WasmResult Context::replaceHeaderMapValue(WasmHeaderMapType type, std::string_vi } const Http::LowerCaseString lower_key{std::string(key)}; map->setCopy(lower_key, toAbslStringView(value)); -#if defined(ALIMESH) +#if defined(HIGRESS) if (type == WasmHeaderMapType::RequestHeaders && decoder_callbacks_ && !disable_clear_route_cache_) { decoder_callbacks_->downstreamCallbacks()->clearRouteCache(); @@ -953,7 +953,7 @@ BufferInterface* Context::getBuffer(WasmBufferType type) { std::string_view(static_cast(body.linearize(body.length())), body.length())); } return nullptr; -#if defined(ALIMESH) +#if defined(HIGRESS) case WasmBufferType::RedisCallResponse: return buffer_.set(rootContext()->redis_call_response_); #endif @@ -964,7 +964,7 @@ BufferInterface* Context::getBuffer(WasmBufferType type) { } } -#if defined(ALIMESH) +#if defined(HIGRESS) /** * The goal here is to have the wasm filter cache the original body when replacing the entire body * using the backup_for_replace mechanism of modifyDecodingBuffer. A special case to consider here @@ -1080,7 +1080,7 @@ WasmResult Context::httpCall(std::string_view cluster, const Pairs& request_head return WasmResult::Ok; } -#if defined(ALIMESH) +#if defined(HIGRESS) WasmResult Context::redisInit(std::string_view cluster, std::string_view username, std::string_view password, int timeout_milliseconds) { auto cluster_string = std::string(cluster.substr(0, cluster.find('?'))); @@ -1306,7 +1306,7 @@ WasmResult Context::setProperty(std::string_view path, std::string_view value) { if (!stream_info) { return WasmResult::NotFound; } -#ifdef ALIMESH +#ifdef HIGRESS if (absl::StartsWith(path, CustomeTraceSpanTagPrefix)) { stream_info->setCustomSpanTag(path.substr(CustomeTraceSpanTagPrefix.size()), value); return WasmResult::Ok; @@ -1327,7 +1327,7 @@ WasmResult Context::setProperty(std::string_view path, std::string_view value) { StreamInfo::FilterState::StateType::Mutable, prototype.life_span_); } -#if defined(ALIMESH) +#if defined(HIGRESS) if (path == ClearRouteCacheKey) { disable_clear_route_cache_ = value == DisableClearRouteCache; } else if (path == SetDecoderBufferLimit && decoder_callbacks_) { @@ -1557,7 +1557,7 @@ Context::~Context() { for (auto& p : grpc_stream_) { p.second.stream_->resetStream(); } -#if defined(ALIMESH) +#if defined(HIGRESS) for (auto& p : redis_request_) { p.second.request_->cancel(); } @@ -1626,7 +1626,7 @@ Network::FilterStatus Context::onNewConnection() { }; Network::FilterStatus Context::onData(::Envoy::Buffer::Instance& data, bool end_stream) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -1643,7 +1643,7 @@ Network::FilterStatus Context::onData(::Envoy::Buffer::Instance& data, bool end_ } Network::FilterStatus Context::onWrite(::Envoy::Buffer::Instance& data, bool end_stream) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -1665,7 +1665,7 @@ Network::FilterStatus Context::onWrite(::Envoy::Buffer::Instance& data, bool end } void Context::onEvent(Network::ConnectionEvent event) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -1702,7 +1702,7 @@ void Context::log(const Http::RequestHeaderMap* request_headers, if (!stream_info.requestComplete().has_value()) { return; } -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -1911,7 +1911,7 @@ Http::FilterHeadersStatus Context::decodeHeaders(Http::RequestHeaderMap& headers } Http::FilterDataStatus Context::decodeData(::Envoy::Buffer::Instance& data, bool end_stream) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -1939,7 +1939,7 @@ Http::FilterDataStatus Context::decodeData(::Envoy::Buffer::Instance& data, bool } Http::FilterTrailersStatus Context::decodeTrailers(Http::RequestTrailerMap& trailers) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -1955,7 +1955,7 @@ Http::FilterTrailersStatus Context::decodeTrailers(Http::RequestTrailerMap& trai } Http::FilterMetadataStatus Context::decodeMetadata(Http::MetadataMap& request_metadata) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -1980,7 +1980,7 @@ Http::Filter1xxHeadersStatus Context::encode1xxHeaders(Http::ResponseHeaderMap&) Http::FilterHeadersStatus Context::encodeHeaders(Http::ResponseHeaderMap& headers, bool end_stream) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -1997,7 +1997,7 @@ Http::FilterHeadersStatus Context::encodeHeaders(Http::ResponseHeaderMap& header } Http::FilterDataStatus Context::encodeData(::Envoy::Buffer::Instance& data, bool end_stream) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -2025,7 +2025,7 @@ Http::FilterDataStatus Context::encodeData(::Envoy::Buffer::Instance& data, bool } Http::FilterTrailersStatus Context::encodeTrailers(Http::ResponseTrailerMap& trailers) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { @@ -2041,7 +2041,7 @@ Http::FilterTrailersStatus Context::encodeTrailers(Http::ResponseTrailerMap& tra } Http::FilterMetadataStatus Context::encodeMetadata(Http::MetadataMap& response_metadata) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (destroyed_ || !in_vm_context_created_) { #else if (!in_vm_context_created_) { diff --git a/source/extensions/common/wasm/context.h b/source/extensions/common/wasm/context.h index 960adb0a11f6..6006e7291f36 100644 --- a/source/extensions/common/wasm/context.h +++ b/source/extensions/common/wasm/context.h @@ -218,7 +218,7 @@ class Context : public proxy_wasm::ContextBase, Pairs additional_headers, uint32_t grpc_status, std::string_view details) override; void clearRouteCache() override { -#if defined(ALIMESH) +#if defined(HIGRESS) if (decoder_callbacks_ && !disable_clear_route_cache_) { #else if (decoder_callbacks_) { @@ -244,7 +244,7 @@ class Context : public proxy_wasm::ContextBase, // Buffer BufferInterface* getBuffer(WasmBufferType type) override; -#if defined(ALIMESH) +#if defined(HIGRESS) WasmResult setBuffer(WasmBufferType type, size_t start, size_t length, std::string_view data) override; #endif @@ -256,7 +256,7 @@ class Context : public proxy_wasm::ContextBase, std::string_view request_body, const Pairs& request_trailers, int timeout_millisconds, uint32_t* token_ptr) override; -#if defined(ALIMESH) +#if defined(HIGRESS) // Redis WasmResult redisInit(std::string_view cluster, std::string_view username, std::string_view password, int timeout_milliseconds) override; @@ -332,7 +332,7 @@ class Context : public proxy_wasm::ContextBase, Http::AsyncClient::Request* request_; }; -#if defined(ALIMESH) +#if defined(HIGRESS) struct RedisAsyncClientHandler : public Redis::AsyncClient::Callbacks { // Redis::AsyncClient::Callbacks void onSuccess(std::string_view, std::string&& response) override { @@ -397,7 +397,7 @@ class Context : public proxy_wasm::ContextBase, void onHttpCallSuccess(uint32_t token, Envoy::Http::ResponseMessagePtr&& response); void onHttpCallFailure(uint32_t token, Http::AsyncClient::FailureReason reason); -#if defined(ALIMESH) +#if defined(HIGRESS) void onRedisCallSuccess(uint32_t token, std::string&& response); void onRedisCallFailure(uint32_t token); #endif @@ -447,7 +447,7 @@ class Context : public proxy_wasm::ContextBase, // Only available during onHttpCallResponse. Envoy::Http::ResponseMessagePtr* http_call_response_{}; -#if defined(ALIMESH) +#if defined(HIGRESS) // Only available during onRedisCallResponse. std::string redis_call_response_{}; #endif @@ -479,7 +479,7 @@ class Context : public proxy_wasm::ContextBase, // MB: must be a node-type map as we take persistent references to the entries. std::map http_request_; -#if defined(ALIMESH) +#if defined(HIGRESS) std::map redis_request_; #endif std::map grpc_call_request_; @@ -496,7 +496,7 @@ class Context : public proxy_wasm::ContextBase, // Filter state prototype declaration. absl::flat_hash_map state_prototypes_; -#if defined(ALIMESH) +#if defined(HIGRESS) bool disable_clear_route_cache_ = false; #endif }; diff --git a/source/extensions/common/wasm/stats_handler.cc b/source/extensions/common/wasm/stats_handler.cc index 78678710c7cb..20f849497cf5 100644 --- a/source/extensions/common/wasm/stats_handler.cc +++ b/source/extensions/common/wasm/stats_handler.cc @@ -70,7 +70,7 @@ void LifecycleStatsHandler::onEvent(WasmEvent event) { switch (event) { case WasmEvent::VmShutDown: lifecycle_stats_.active_.set(--active_wasms); -#ifdef ALIMESH +#ifdef HIGRESS if (is_crashed_) { is_crashed_ = false; if (lifecycle_stats_.crash_.value() > 0) { @@ -83,7 +83,7 @@ void LifecycleStatsHandler::onEvent(WasmEvent event) { lifecycle_stats_.active_.set(++active_wasms); lifecycle_stats_.created_.inc(); break; -#ifdef ALIMESH +#ifdef HIGRESS case WasmEvent::RuntimeError: if (!is_crashed_) { is_crashed_ = true; diff --git a/source/extensions/common/wasm/stats_handler.h b/source/extensions/common/wasm/stats_handler.h index 5c600ffd4077..2f492cc9c77e 100644 --- a/source/extensions/common/wasm/stats_handler.h +++ b/source/extensions/common/wasm/stats_handler.h @@ -31,7 +31,7 @@ struct CreateWasmStats { CREATE_WASM_STATS(GENERATE_COUNTER_STRUCT, GENERATE_GAUGE_STRUCT) }; -#ifdef ALIMESH +#ifdef HIGRESS #define LIFECYCLE_STATS(COUNTER, GAUGE, PLUGIN_COUNTER, PLUGIN_GAUGE) \ COUNTER(created) \ GAUGE(active, NeverImport) \ @@ -46,7 +46,7 @@ struct CreateWasmStats { #endif struct LifecycleStats { -#ifdef ALIMESH +#ifdef HIGRESS LIFECYCLE_STATS(GENERATE_COUNTER_STRUCT, GENERATE_GAUGE_STRUCT, GENERATE_COUNTER_STRUCT, GENERATE_GAUGE_STRUCT) #else @@ -72,7 +72,7 @@ enum class WasmEvent : int { RuntimeError, VmCreated, VmShutDown, -#ifdef ALIMESH +#ifdef HIGRESS RecoverError, #endif }; @@ -107,7 +107,7 @@ CreateStatsHandler& getCreateStatsHandler(); class LifecycleStatsHandler { public: -#ifdef ALIMESH +#ifdef HIGRESS LifecycleStatsHandler(const Stats::ScopeSharedPtr& scope, std::string runtime, std::string plugin_name) : lifecycle_stats_(LifecycleStats{LIFECYCLE_STATS( @@ -128,13 +128,13 @@ class LifecycleStatsHandler { void onEvent(WasmEvent event); static int64_t getActiveVmCount(); -#ifdef ALIMESH +#ifdef HIGRESS LifecycleStats& stats() { return lifecycle_stats_; } #endif protected: LifecycleStats lifecycle_stats_; -#ifdef ALIMESH +#ifdef HIGRESS bool is_crashed_ = false; #endif }; diff --git a/source/extensions/common/wasm/wasm.cc b/source/extensions/common/wasm/wasm.cc index bded3d747898..ab96bed40594 100644 --- a/source/extensions/common/wasm/wasm.cc +++ b/source/extensions/common/wasm/wasm.cc @@ -60,7 +60,7 @@ inline Wasm* getWasm(WasmHandleSharedPtr& base_wasm_handle) { return static_cast(base_wasm_handle->wasm().get()); } -#ifdef ALIMESH +#ifdef HIGRESS WasmEvent failStateToWasmEvent(FailState state) { switch (state) { case FailState::Ok: @@ -111,7 +111,7 @@ Wasm::Wasm(WasmConfig& config, absl::string_view vm_key, const Stats::ScopeShare custom_stat_namespace_(stat_name_pool_.add(CustomStatNamespace)), cluster_manager_(cluster_manager), dispatcher_(dispatcher), time_source_(dispatcher.timeSource()), -#ifdef ALIMESH +#ifdef HIGRESS lifecycle_stats_handler_(LifecycleStatsHandler(scope, config.config().vm_config().runtime(), config.config().name())) { #else @@ -136,7 +136,7 @@ Wasm::Wasm(WasmHandleSharedPtr base_wasm_handle, Event::Dispatcher& dispatcher) time_source_(dispatcher.timeSource()), lifecycle_stats_handler_(getWasm(base_wasm_handle)->lifecycle_stats_handler_) { lifecycle_stats_handler_.onEvent(WasmEvent::VmCreated); -#ifdef ALIMESH +#ifdef HIGRESS auto* vm = wasm_vm(); if (vm) { vm->addFailCallback([this](FailState fail_state) { @@ -194,7 +194,7 @@ Wasm::~Wasm() { } } -#if defined(ALIMESH) +#if defined(HIGRESS) bool PluginHandleSharedPtrThreadLocal::recover() { if (handle_ == nullptr || handle_->wasmHandle() == nullptr || handle_->wasmHandle()->wasm() == nullptr) { @@ -376,7 +376,7 @@ WasmEvent toWasmEvent(const std::shared_ptr& wasm) { return WasmEvent::ConfigureFailed; case FailState::RuntimeError: return WasmEvent::RuntimeError; -#if defined(ALIMESH) +#if defined(HIGRESS) case FailState::RecoverError: return WasmEvent::RecoverError; #endif diff --git a/source/extensions/common/wasm/wasm.h b/source/extensions/common/wasm/wasm.h index aa5069e86c98..e6974a97c4d4 100644 --- a/source/extensions/common/wasm/wasm.h +++ b/source/extensions/common/wasm/wasm.h @@ -90,7 +90,7 @@ class Wasm : public WasmBase, Logger::Loggable { } void setFailStateForTesting(proxy_wasm::FailState fail_state) { failed_ = fail_state; } -#if defined(ALIMESH) +#if defined(HIGRESS) LifecycleStats& lifecycleStats() { return lifecycle_stats_handler_.stats(); } #endif @@ -157,7 +157,7 @@ class PluginHandle : public PluginHandleBase { using PluginHandleSharedPtr = std::shared_ptr; -#if defined(ALIMESH) +#if defined(HIGRESS) class PluginHandleSharedPtrThreadLocal : public ThreadLocal::ThreadLocalObject, public Logger::Loggable { public: @@ -172,7 +172,7 @@ class PluginHandleSharedPtrThreadLocal : public ThreadLocal::ThreadLocalObject { private: PluginHandleSharedPtr handle_; -#if defined(ALIMESH) +#if defined(HIGRESS) MonotonicTime last_recover_time_; #endif }; diff --git a/source/extensions/common/wasm/wasm_vm.cc b/source/extensions/common/wasm/wasm_vm.cc index e2c1a93aa4f6..ef73a3132f04 100644 --- a/source/extensions/common/wasm/wasm_vm.cc +++ b/source/extensions/common/wasm/wasm_vm.cc @@ -37,7 +37,7 @@ proxy_wasm::LogLevel EnvoyWasmVmIntegration::getLogLevel() { } void EnvoyWasmVmIntegration::error(std::string_view message) { -#ifdef ALIMESH +#ifdef HIGRESS ENVOY_LOG(error, absl::StrReplaceAll(message, {{"\n", "\\n"}})); #else ENVOY_LOG(error, message); diff --git a/source/extensions/filters/common/ext_authz/ext_authz.h b/source/extensions/filters/common/ext_authz/ext_authz.h index b17e53372600..88cea0589a36 100644 --- a/source/extensions/filters/common/ext_authz/ext_authz.h +++ b/source/extensions/filters/common/ext_authz/ext_authz.h @@ -56,7 +56,7 @@ class HeaderValues { const Http::LowerCaseString EnvoyAuthHeadersToRemove{ absl::StrCat(prefix(), "-auth-headers-to-remove")}; -#if defined(ALIMESH) +#if defined(HIGRESS) const Http::LowerCaseString XMseExternalAuthzCheckResult{"x-mse-external-authz-check-result"}; #endif const Http::LowerCaseString EnvoyAuthFailureModeAllowed{ diff --git a/source/extensions/filters/common/ext_authz/ext_authz_http_impl.cc b/source/extensions/filters/common/ext_authz/ext_authz_http_impl.cc index 3427188295b8..855a0f36d94f 100644 --- a/source/extensions/filters/common/ext_authz/ext_authz_http_impl.cc +++ b/source/extensions/filters/common/ext_authz/ext_authz_http_impl.cc @@ -276,7 +276,7 @@ void RawHttpClientImpl::onBeforeFinalizeUpstreamSpan( } } -#if defined(ALIMESH) +#if defined(HIGRESS) bool isAuthorizationPass(const Http::ResponseHeaderMap& headers) { const uint64_t status_code = Http::Utility::getResponseStatus(headers); @@ -332,7 +332,7 @@ ResponsePtr RawHttpClientImpl::toResponse(Http::ResponseMessagePtr message) { message->headers().remove(storage_header_name); // Create an Ok authorization response. -#if !defined(ALIMESH) +#if !defined(HIGRESS) if (status_code == enumToInt(Http::Code::OK)) { #else if (isAuthorizationPass(message->headers())) { diff --git a/source/extensions/filters/common/ext_authz/ext_authz_http_impl.h b/source/extensions/filters/common/ext_authz/ext_authz_http_impl.h index b6ea8f809e39..1e196f9d441a 100644 --- a/source/extensions/filters/common/ext_authz/ext_authz_http_impl.h +++ b/source/extensions/filters/common/ext_authz/ext_authz_http_impl.h @@ -110,7 +110,7 @@ class ClientConfig { using ClientConfigSharedPtr = std::shared_ptr; -#if defined(ALIMESH) +#if defined(HIGRESS) bool isAuthorizationPass(const Http::ResponseHeaderMap& headers); #endif diff --git a/source/extensions/filters/http/custom_response/config.cc b/source/extensions/filters/http/custom_response/config.cc index 21fd0aaba84e..f1ace55337c5 100644 --- a/source/extensions/filters/http/custom_response/config.cc +++ b/source/extensions/filters/http/custom_response/config.cc @@ -47,7 +47,7 @@ createMatcher(const envoy::extensions::filters::http::custom_response::v3::Custo FilterConfig::FilterConfig( const envoy::extensions::filters::http::custom_response::v3::CustomResponse& config, Server::Configuration::ServerFactoryContext& context, Stats::StatName stats_prefix) -#if defined(ALIMESH) +#if defined(HIGRESS) : stats_prefix_(stats_prefix), matcher_{createMatcher(config, context, stats_prefix)}, max_request_bytes_(config.with_request_body().max_request_bytes()) { } diff --git a/source/extensions/filters/http/custom_response/config.h b/source/extensions/filters/http/custom_response/config.h index 05de03bee3b7..0bee4b9c551a 100644 --- a/source/extensions/filters/http/custom_response/config.h +++ b/source/extensions/filters/http/custom_response/config.h @@ -36,7 +36,7 @@ class FilterConfig : public Router::RouteSpecificFilterConfig { PolicySharedPtr getPolicy(const ::Envoy::Http::ResponseHeaderMap& headers, const StreamInfo::StreamInfo& stream_info) const; -#if defined(ALIMESH) +#if defined(HIGRESS) bool withRequestBody() const { return max_request_bytes_ > 0; } uint32_t maxRequestBytes() const { return max_request_bytes_; } #endif diff --git a/source/extensions/filters/http/custom_response/custom_response_filter.cc b/source/extensions/filters/http/custom_response/custom_response_filter.cc index ad3066b40154..caf9513c5110 100644 --- a/source/extensions/filters/http/custom_response/custom_response_filter.cc +++ b/source/extensions/filters/http/custom_response/custom_response_filter.cc @@ -16,7 +16,7 @@ namespace CustomResponse { Http::FilterHeadersStatus CustomResponseFilter::decodeHeaders(Http::RequestHeaderMap& header_map, bool) { -#if defined(ALIMESH) +#if defined(HIGRESS) downstream_headers_ = &header_map; const FilterConfig* config = nullptr; if (decoder_callbacks_ && decoder_callbacks_->route()) { @@ -58,7 +58,7 @@ Http::FilterHeadersStatus CustomResponseFilter::encodeHeaders(Http::ResponseHead // If filter state for custom response exists, it means this response is a // custom response. Apply the custom response mutations to the response from // the remote source and return. -#if defined(ALIMESH) +#if defined(HIGRESS) auto filter_state = encoder_callbacks_->streamInfo().filterState()->getDataMutable( CustomResponseFilterState::kFilterStateName); @@ -77,7 +77,7 @@ Http::FilterHeadersStatus CustomResponseFilter::encodeHeaders(Http::ResponseHead // policy. Note that since the traversal is least to most specific, we can't // return early when a match is found. PolicySharedPtr policy; -#if defined(ALIMESH) +#if defined(HIGRESS) if (has_rules_) { #endif decoder_callbacks_->traversePerFilterConfig( @@ -92,7 +92,7 @@ Http::FilterHeadersStatus CustomResponseFilter::encodeHeaders(Http::ResponseHead } } }); -#if defined(ALIMESH) +#if defined(HIGRESS) } #endif if (!policy) { @@ -101,7 +101,7 @@ Http::FilterHeadersStatus CustomResponseFilter::encodeHeaders(Http::ResponseHead // A valid custom response was not found. We should just pass through. if (!policy) { -#if defined(ALIMESH) +#if defined(HIGRESS) if (filter_state) { // Trigger policy process the response filter_state->remain_redirect_times = 0; diff --git a/source/extensions/filters/http/custom_response/custom_response_filter.h b/source/extensions/filters/http/custom_response/custom_response_filter.h index ce164f6bb4d6..e9f8183e6480 100644 --- a/source/extensions/filters/http/custom_response/custom_response_filter.h +++ b/source/extensions/filters/http/custom_response/custom_response_filter.h @@ -50,7 +50,7 @@ class CustomResponseFilter : public ::Envoy::Http::PassThroughFilter, const std::shared_ptr config_; ::Envoy::Http::RequestHeaderMap* downstream_headers_ = nullptr; bool on_local_reply_called_ = false; -#if defined(ALIMESH) +#if defined(HIGRESS) bool has_rules_ = false; #endif }; diff --git a/source/extensions/filters/http/custom_response/policy.h b/source/extensions/filters/http/custom_response/policy.h index f5e0929751bf..e539e6f940f7 100644 --- a/source/extensions/filters/http/custom_response/policy.h +++ b/source/extensions/filters/http/custom_response/policy.h @@ -34,7 +34,7 @@ using PolicySharedPtr = std::shared_ptr; struct CustomResponseFilterState : public std::enable_shared_from_this, public StreamInfo::FilterState::Object { -#if defined(ALIMESH) +#if defined(HIGRESS) CustomResponseFilterState(PolicySharedPtr a_policy, absl::optional<::Envoy::Http::Code> code, int32_t max_redirect_times) : policy(a_policy), original_response_code(code), remain_redirect_times(max_redirect_times) {} @@ -45,7 +45,7 @@ struct CustomResponseFilterState : public std::enable_shared_from_this original_response_code; -#if defined(ALIMESH) +#if defined(HIGRESS) int32_t remain_redirect_times; #endif static constexpr absl::string_view kFilterStateName = "envoy.filters.http.custom_response"; diff --git a/source/extensions/filters/http/on_demand/on_demand_update.cc b/source/extensions/filters/http/on_demand/on_demand_update.cc index 4d6b348de535..ca23555019fb 100644 --- a/source/extensions/filters/http/on_demand/on_demand_update.cc +++ b/source/extensions/filters/http/on_demand/on_demand_update.cc @@ -193,7 +193,7 @@ void OnDemandRouteUpdate::onDestroy() { // This is the callback which is called when an update requested in requestRouteConfigUpdate() // has been propagated to workers, at which point the request processing is restarted from the // beginning. -#if defined(ALIMESH) +#if defined(HIGRESS) void OnDemandRouteUpdate::onRouteConfigUpdateCompletion(bool) { #else void OnDemandRouteUpdate::onRouteConfigUpdateCompletion(bool route_exists) { @@ -205,7 +205,7 @@ void OnDemandRouteUpdate::onRouteConfigUpdateCompletion(bool route_exists) { return; } -#if !defined(ALIMESH) +#if !defined(HIGRESS) if (route_exists && // route can be resolved after an on-demand // VHDS update !callbacks_->decodingBuffer() && // Redirects with body not yet supported. diff --git a/source/extensions/filters/http/wasm/wasm_filter.h b/source/extensions/filters/http/wasm/wasm_filter.h index 4e97a0a96946..b7b73f2d35d6 100644 --- a/source/extensions/filters/http/wasm/wasm_filter.h +++ b/source/extensions/filters/http/wasm/wasm_filter.h @@ -42,7 +42,7 @@ class FilterConfig : Logger::Loggable { if (handle->wasmHandle()) { wasm = handle->wasmHandle()->wasm().get(); } -#if defined(ALIMESH) +#if defined(HIGRESS) auto failed = false; if (!wasm) { failed = true; diff --git a/source/extensions/filters/network/common/redis/BUILD b/source/extensions/filters/network/common/redis/BUILD index 4ddece1186fc..f030f66a31e9 100644 --- a/source/extensions/filters/network/common/redis/BUILD +++ b/source/extensions/filters/network/common/redis/BUILD @@ -51,7 +51,7 @@ envoy_cc_library( ":redis_command_stats_lib", "//envoy/upstream:cluster_manager_interface", ], - alimesh_deps = [ + higress_deps = [ "//envoy/upstream:upstream_interface", ], ) diff --git a/source/extensions/filters/network/common/redis/client.h b/source/extensions/filters/network/common/redis/client.h index bb1ceb7e0db6..a156aa2d9562 100644 --- a/source/extensions/filters/network/common/redis/client.h +++ b/source/extensions/filters/network/common/redis/client.h @@ -7,7 +7,7 @@ #include "source/extensions/filters/network/common/redis/codec_impl.h" #include "source/extensions/filters/network/common/redis/redis_command_stats.h" -#if defined(ALIMESH) +#if defined(HIGRESS) #include "envoy/redis/async_client.h" #endif @@ -18,7 +18,7 @@ namespace Common { namespace Redis { namespace Client { -#if defined(ALIMESH) +#if defined(HIGRESS) using PoolRequest = Envoy::Redis::PoolRequest; #else /** diff --git a/source/extensions/filters/network/common/redis/codec.h b/source/extensions/filters/network/common/redis/codec.h index 1d767baf6f10..46366c930e74 100644 --- a/source/extensions/filters/network/common/redis/codec.h +++ b/source/extensions/filters/network/common/redis/codec.h @@ -165,7 +165,7 @@ class DecoderCallbacks { virtual void onRespValue(RespValuePtr&& value) PURE; }; -#if defined(ALIMESH) +#if defined(HIGRESS) class RawDecoderCallbacks { public: virtual ~RawDecoderCallbacks() = default; @@ -204,7 +204,7 @@ class DecoderFactory { virtual DecoderPtr create(DecoderCallbacks& callbacks) PURE; }; -#if defined(ALIMESH) +#if defined(HIGRESS) class RawDecoderFactory { public: virtual ~RawDecoderFactory() = default; @@ -230,7 +230,7 @@ class Encoder { using EncoderPtr = std::unique_ptr; -#if defined(ALIMESH) +#if defined(HIGRESS) class RawEncoder { public: virtual ~RawEncoder() = default; diff --git a/source/extensions/filters/network/common/redis/codec_impl.cc b/source/extensions/filters/network/common/redis/codec_impl.cc index 4b411cc74864..6b447eb39a8d 100644 --- a/source/extensions/filters/network/common/redis/codec_impl.cc +++ b/source/extensions/filters/network/common/redis/codec_impl.cc @@ -549,7 +549,7 @@ void DecoderImpl::parseSlice(const Buffer::RawSlice& slice) { } } -#if defined(ALIMESH) +#if defined(HIGRESS) void RawDecoderImpl::decode(Buffer::Instance& data) { for (const Buffer::RawSlice& slice : data.getRawSlices()) { parseSlice(slice); @@ -883,7 +883,7 @@ void EncoderImpl::encodeSimpleString(const std::string& string, Buffer::Instance out.add(string); out.add("\r\n", 2); } -#if defined(ALIMESH) +#if defined(HIGRESS) void RawEncoderImpl::encode(std::string_view value, Buffer::Instance& out) { out.add(value); } #endif diff --git a/source/extensions/filters/network/common/redis/codec_impl.h b/source/extensions/filters/network/common/redis/codec_impl.h index ffaa9cb179bd..73178b8dd020 100644 --- a/source/extensions/filters/network/common/redis/codec_impl.h +++ b/source/extensions/filters/network/common/redis/codec_impl.h @@ -64,7 +64,7 @@ class DecoderImpl : public Decoder, Logger::Loggable { std::forward_list pending_value_stack_; }; -#if defined(ALIMESH) +#if defined(HIGRESS) class RawDecoderImpl : public Decoder, Logger::Loggable { public: RawDecoderImpl(RawDecoderCallbacks& callbacks) : callbacks_(callbacks) {} @@ -122,7 +122,7 @@ class DecoderFactoryImpl : public DecoderFactory { return DecoderPtr{new DecoderImpl(callbacks)}; } }; -#if defined(ALIMESH) +#if defined(HIGRESS) class RawDecoderFactoryImpl : public RawDecoderFactory { public: // RedisProxy::RawDecoderFactory @@ -147,7 +147,7 @@ class EncoderImpl : public Encoder { void encodeInteger(int64_t integer, Buffer::Instance& out); void encodeSimpleString(const std::string& string, Buffer::Instance& out); }; -#if defined(ALIMESH) +#if defined(HIGRESS) class RawEncoderImpl : public RawEncoder { public: // RedisProxy::RawEncoder diff --git a/source/extensions/filters/network/common/redis/utility.cc b/source/extensions/filters/network/common/redis/utility.cc index 263bfc50db30..63bd8c0a34a2 100644 --- a/source/extensions/filters/network/common/redis/utility.cc +++ b/source/extensions/filters/network/common/redis/utility.cc @@ -37,7 +37,7 @@ RespValuePtr makeError(const std::string& error) { response->asString() = error; return response; } -#if defined(ALIMESH) +#if defined(HIGRESS) std::string makeRawError(const std::string& error) { std::string result; result.append(fmt::format("-{}\r\n", error)); diff --git a/source/extensions/filters/network/common/redis/utility.h b/source/extensions/filters/network/common/redis/utility.h index 139b7e832cc8..2c7259ecac17 100644 --- a/source/extensions/filters/network/common/redis/utility.h +++ b/source/extensions/filters/network/common/redis/utility.h @@ -18,7 +18,7 @@ class AuthRequest : public Redis::RespValue { }; RespValuePtr makeError(const std::string& error); -#if defined(ALIMESH) +#if defined(HIGRESS) std::string makeRawError(const std::string& error); std::string makeRawAuthRequest(const std::string& password); std::string makeRawAuthRequest(const std::string& username, const std::string& password); diff --git a/source/extensions/filters/network/http_connection_manager/config.cc b/source/extensions/filters/network/http_connection_manager/config.cc index 4ccd5a6beb34..1d6ce67d75c6 100644 --- a/source/extensions/filters/network/http_connection_manager/config.cc +++ b/source/extensions/filters/network/http_connection_manager/config.cc @@ -385,7 +385,7 @@ HttpConnectionManagerConfig::HttpConnectionManagerConfig( createHeaderValidatorFactory(config, context.getServerFactoryContext())), append_x_forwarded_port_(config.append_x_forwarded_port()), add_proxy_protocol_connection_state_( -#if defined(ALIMESH) +#if defined(HIGRESS) PROTOBUF_GET_WRAPPED_OR_DEFAULT(config, add_proxy_protocol_connection_state, true)), keepalive_header_timeout_(PROTOBUF_GET_SECONDS_OR_DEFAULT(config, keepalive_header_timeout, KeepaliveHeaderTimeoutSeconds)) { diff --git a/source/extensions/filters/network/http_connection_manager/config.h b/source/extensions/filters/network/http_connection_manager/config.h index 8915e085efbb..39c77861d6dd 100644 --- a/source/extensions/filters/network/http_connection_manager/config.h +++ b/source/extensions/filters/network/http_connection_manager/config.h @@ -267,7 +267,7 @@ class HttpConnectionManagerConfig : Logger::Loggable, bool addProxyProtocolConnectionState() const override { return add_proxy_protocol_connection_state_; } -#if defined(ALIMESH) +#if defined(HIGRESS) std::chrono::seconds keepaliveHeaderTimeout() const override { return keepalive_header_timeout_; } #endif @@ -356,7 +356,7 @@ class HttpConnectionManagerConfig : Logger::Loggable, static const uint64_t RequestTimeoutMs = 0; // request header timeout is disabled by default static const uint64_t RequestHeaderTimeoutMs = 0; -#if defined(ALIMESH) +#if defined(HIGRESS) // keep-alive response header is disabled by default static const uint64_t KeepaliveHeaderTimeoutSeconds = 0; #endif @@ -368,7 +368,7 @@ class HttpConnectionManagerConfig : Logger::Loggable, const Http::HeaderValidatorFactoryPtr header_validator_factory_; const bool append_x_forwarded_port_; const bool add_proxy_protocol_connection_state_; -#if defined(ALIMESH) +#if defined(HIGRESS) const std::chrono::seconds keepalive_header_timeout_; #endif }; diff --git a/source/extensions/filters/network/wasm/wasm_filter.h b/source/extensions/filters/network/wasm/wasm_filter.h index 1df4c08cad87..9a6e21eb8126 100644 --- a/source/extensions/filters/network/wasm/wasm_filter.h +++ b/source/extensions/filters/network/wasm/wasm_filter.h @@ -42,7 +42,7 @@ class FilterConfig : Logger::Loggable { if (handle->wasmHandle()) { wasm = handle->wasmHandle()->wasm().get(); } -#if defined(ALIMESH) +#if defined(HIGRESS) auto failed = false; if (!wasm) { failed = true; diff --git a/source/extensions/health_checkers/tcp/health_checker_impl.cc b/source/extensions/health_checkers/tcp/health_checker_impl.cc index 59e71186a0d5..43ff922f678a 100644 --- a/source/extensions/health_checkers/tcp/health_checker_impl.cc +++ b/source/extensions/health_checkers/tcp/health_checker_impl.cc @@ -137,7 +137,7 @@ void TcpHealthCheckerImpl::TcpActiveHealthCheckSession::onInterval() { client_->addReadFilter(session_callbacks_); expect_close_ = false; -#if defined(ALIMESH) +#if defined(HIGRESS) try { client_->connect(); } catch (const EnvoyException& ex) { diff --git a/source/extensions/http/custom_response/redirect_policy/redirect_policy.cc b/source/extensions/http/custom_response/redirect_policy/redirect_policy.cc index 1b2dcbc35558..39066fc58d1c 100644 --- a/source/extensions/http/custom_response/redirect_policy/redirect_policy.cc +++ b/source/extensions/http/custom_response/redirect_policy/redirect_policy.cc @@ -63,7 +63,7 @@ RedirectPolicy::RedirectPolicy( ? std::make_unique<::Envoy::Http::Utility::RedirectConfig>( createRedirectConfig(config.redirect_action())) : nullptr}, -#if defined(ALIMESH) +#if defined(HIGRESS) use_original_request_uri_( PROTOBUF_GET_WRAPPED_OR_DEFAULT(config, use_original_request_uri, false)), keep_original_response_code_( @@ -83,7 +83,7 @@ RedirectPolicy::RedirectPolicy( request_header_parser_( Envoy::Router::HeaderParser::configure(config.request_headers_to_add())), modify_request_headers_action_(createModifyRequestHeadersAction(config, context)) { -#if defined(ALIMESH) +#if defined(HIGRESS) // Ensure that exactly one of uri_ or redirect_action_ or use_original_request_uri_ is specified. ASSERT(int(uri_ != nullptr) + int(redirect_action_ != nullptr) + int(use_original_request_uri_) == 1); @@ -129,7 +129,7 @@ ::Envoy::Http::FilterHeadersStatus RedirectPolicy::encodeHeaders( // the remote source and return. auto encoder_callbacks = custom_response_filter.encoderCallbacks(); auto decoder_callbacks = custom_response_filter.decoderCallbacks(); -#if defined(ALIMESH) +#if defined(HIGRESS) auto* filter_state = encoder_callbacks->streamInfo() .filterState() @@ -220,7 +220,7 @@ ::Envoy::Http::FilterHeadersStatus RedirectPolicy::encodeHeaders( }); ::Envoy::Http::Utility::Url absolute_url; -#if defined(ALIMESH) +#if defined(HIGRESS) if (use_original_request_uri_) { std::string real_original_host; const auto x_envoy_original_host = downstream_headers->getByKey( @@ -258,7 +258,7 @@ ::Envoy::Http::FilterHeadersStatus RedirectPolicy::encodeHeaders( path_and_query = path_and_query.substr(0, fragment_pos); downstream_headers->setPath(path_and_query); -#if defined(ALIMESH) +#if defined(HIGRESS) } #endif if (decoder_callbacks->downstreamCallbacks()) { @@ -280,13 +280,13 @@ ::Envoy::Http::FilterHeadersStatus RedirectPolicy::encodeHeaders( // redirect will take place. return ::Envoy::Http::FilterHeadersStatus::Continue; } -#if !defined(ALIMESH) +#if !defined(HIGRESS) downstream_headers->setMethod(::Envoy::Http::Headers::get().MethodValues.Get); #endif downstream_headers->remove(::Envoy::Http::Headers::get().ContentLength); // Cache the original response code. absl::optional<::Envoy::Http::Code> original_response_code; -#if defined(ALIMESH) +#if defined(HIGRESS) if (keep_original_response_code_) { absl::optional current_code = ::Envoy::Http::Utility::getResponseStatusOrNullopt(headers); diff --git a/source/extensions/http/custom_response/redirect_policy/redirect_policy.h b/source/extensions/http/custom_response/redirect_policy/redirect_policy.h index 5180fa34bf23..da399a98f6b1 100644 --- a/source/extensions/http/custom_response/redirect_policy/redirect_policy.h +++ b/source/extensions/http/custom_response/redirect_policy/redirect_policy.h @@ -70,7 +70,7 @@ class RedirectPolicy : public Extensions::HttpFilters::CustomResponse::Policy, // Remote source the request should be redirected to. const std::unique_ptr uri_; const std::unique_ptr redirect_action_; -#if defined(ALIMESH) +#if defined(HIGRESS) bool use_original_request_uri_; bool keep_original_response_code_; uint32_t max_internal_redirects_; diff --git a/source/extensions/tracers/skywalking/tracer.cc b/source/extensions/tracers/skywalking/tracer.cc index 7c8953536401..a66e24513ec9 100644 --- a/source/extensions/tracers/skywalking/tracer.cc +++ b/source/extensions/tracers/skywalking/tracer.cc @@ -2,7 +2,7 @@ #include -#if defined(ALIMESH) +#if defined(HIGRESS) #include "source/common/common/base64.h" #endif @@ -20,7 +20,7 @@ const Http::LowerCaseString& skywalkingPropagationHeaderKey() { CONSTRUCT_ON_FIRST_USE(Http::LowerCaseString, "sw8"); } -#if defined(ALIMESH) +#if defined(HIGRESS) const Http::LowerCaseString& skywalkingPropagationHeaderKeyTraceId() { CONSTRUCT_ON_FIRST_USE(Http::LowerCaseString, "sw8-traceid"); } @@ -65,7 +65,7 @@ void Span::injectContext(Tracing::TraceContext& trace_context, tracing_context_->createSW8HeaderValue({remote_address.data(), remote_address.size()}); if (sw8_header.has_value()) { trace_context.setByReferenceKey(skywalkingPropagationHeaderKey(), sw8_header.value()); -#if defined(ALIMESH) +#if defined(HIGRESS) std::vector result = absl::StrSplit(sw8_header.value(), '-'); std::string sw8_trace_id = ""; if (result.size() > 1) { diff --git a/source/extensions/transport_sockets/tls/context_impl.cc b/source/extensions/transport_sockets/tls/context_impl.cc index c39d840f51c1..271fb97f9ceb 100644 --- a/source/extensions/transport_sockets/tls/context_impl.cc +++ b/source/extensions/transport_sockets/tls/context_impl.cc @@ -235,7 +235,7 @@ ContextImpl::ContextImpl(Stats::Scope& scope, const Envoy::Ssl::ContextConfig& c ctx.is_ecdsa_ = true; } break; case EVP_PKEY_RSA: { -#if !defined(ALIMESH) +#if !defined(HIGRESS) // We require RSA certificates with 2048-bit or larger keys. const RSA* rsa_public_key = EVP_PKEY_get0_RSA(public_key.get()); // Since we checked the key type above, this should be valid. diff --git a/source/server/admin/admin.h b/source/server/admin/admin.h index b3e0faac120a..6f4233d575bc 100644 --- a/source/server/admin/admin.h +++ b/source/server/admin/admin.h @@ -227,7 +227,7 @@ class AdminImpl : public Admin, } bool appendXForwardedPort() const override { return false; } bool addProxyProtocolConnectionState() const override { return true; } -#if defined(ALIMESH) +#if defined(HIGRESS) std::chrono::seconds keepaliveHeaderTimeout() const override { return {}; } #endif @@ -317,7 +317,7 @@ class AdminImpl : public Admin, NullScopeKeyBuilder() = default; ~NullScopeKeyBuilder() override = default; -#if defined(ALIMESH) +#if defined(HIGRESS) Router::ScopeKeyPtr computeScopeKey(const Http::HeaderMap&, const StreamInfo::StreamInfo*, std::function&) const override { return nullptr; diff --git a/test/common/formatter/substitution_formatter_test.cc b/test/common/formatter/substitution_formatter_test.cc index 1576d826c515..f51ad583bd86 100644 --- a/test/common/formatter/substitution_formatter_test.cc +++ b/test/common/formatter/substitution_formatter_test.cc @@ -913,7 +913,7 @@ TEST(SubstitutionFormatterTest, streamInfoFormatter) { } // The test environment does not support IPV6 -#if !defined(ALIMESH) +#if !defined(HIGRESS) // Validate for IPv6 address address = Network::Address::InstanceConstSharedPtr{new Network::Address::Ipv6Instance("::1", 9443)}; diff --git a/test/common/http/conn_manager_impl_fuzz_test.cc b/test/common/http/conn_manager_impl_fuzz_test.cc index 6aa90f7442fa..0ec5bf485599 100644 --- a/test/common/http/conn_manager_impl_fuzz_test.cc +++ b/test/common/http/conn_manager_impl_fuzz_test.cc @@ -241,7 +241,7 @@ class FuzzConfig : public ConnectionManagerConfig { } bool appendXForwardedPort() const override { return false; } bool addProxyProtocolConnectionState() const override { return true; } -#if defined(ALIMESH) +#if defined(HIGRESS) std::chrono::seconds keepaliveHeaderTimeout() const override { return keepalive_header_timeout_; } #endif @@ -297,7 +297,7 @@ class FuzzConfig : public ConnectionManagerConfig { std::vector ip_detection_extensions_{}; std::vector early_header_mutations_; std::unique_ptr proxy_status_config_; -#if defined(ALIMESH) +#if defined(HIGRESS) std::chrono::seconds keepalive_header_timeout_{}; #endif }; diff --git a/test/common/http/conn_manager_impl_test.cc b/test/common/http/conn_manager_impl_test.cc index 2d0ee4a82408..bdb2658180d8 100644 --- a/test/common/http/conn_manager_impl_test.cc +++ b/test/common/http/conn_manager_impl_test.cc @@ -1384,7 +1384,7 @@ TEST_F(HttpConnectionManagerImplTest, DateHeaderPresent) { doRemoteClose(); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(HttpConnectionManagerImplTest, KeepaliveHeaderNotAppend) { setup(false, ""); setUpEncoderAndDecoder(false, false); diff --git a/test/common/http/conn_manager_impl_test_2.cc b/test/common/http/conn_manager_impl_test_2.cc index e955fb9a117c..93c71e44bb2d 100644 --- a/test/common/http/conn_manager_impl_test_2.cc +++ b/test/common/http/conn_manager_impl_test_2.cc @@ -2750,7 +2750,7 @@ TEST_F(HttpConnectionManagerImplTest, TestSessionTrace) { TEST_F(HttpConnectionManagerImplTest, TestSrdsRouteNotFound) { setup(false, "", true, true); setupFilterChain(1, 0); // Recreate the chain for second stream. -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*static_cast( scopedRouteConfigProvider()->config().get()), getRouteConfig(_, _, _)) @@ -2793,7 +2793,7 @@ TEST_F(HttpConnectionManagerImplTest, TestSrdsRouteNotFound) { TEST_F(HttpConnectionManagerImplTest, TestSrdsUpdate) { setup(false, "", true, true); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*static_cast( scopedRouteConfigProvider()->config().get()), getRouteConfig(_, _, _)) @@ -2867,7 +2867,7 @@ TEST_F(HttpConnectionManagerImplTest, TestSrdsCrossScopeReroute) { std::shared_ptr route2 = std::make_shared>(); EXPECT_CALL(*route_config1, route(_, _, _, _)).WillRepeatedly(Return(route1)); EXPECT_CALL(*route_config2, route(_, _, _, _)).WillRepeatedly(Return(route2)); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*static_cast( scopedRouteConfigProvider()->config().get()), getRouteConfig(_, _, _)) @@ -2957,7 +2957,7 @@ TEST_F(HttpConnectionManagerImplTest, TestSrdsRouteFound) { std::shared_ptr fake_cluster1 = std::make_shared>(); EXPECT_CALL(cluster_manager_, getThreadLocalCluster(_)).WillOnce(Return(fake_cluster1.get())); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*scopedRouteConfigProvider()->config(), getRouteConfig(_, _, _)) // 1. decodeHeaders() snapping route config. diff --git a/test/common/http/conn_manager_impl_test_base.h b/test/common/http/conn_manager_impl_test_base.h index fa0e210196aa..5472fb7a8139 100644 --- a/test/common/http/conn_manager_impl_test_base.h +++ b/test/common/http/conn_manager_impl_test_base.h @@ -176,7 +176,7 @@ class HttpConnectionManagerImplMixin : public ConnectionManagerConfig { return add_proxy_protocol_connection_state_; } -#if defined(ALIMESH) +#if defined(HIGRESS) std::chrono::seconds keepaliveHeaderTimeout() const override { return keepalive_header_timeout_; } #endif // Simple helper to wrapper filter to the factory function. @@ -280,7 +280,7 @@ class HttpConnectionManagerImplMixin : public ConnectionManagerConfig { std::vector ip_detection_extensions_{}; std::vector early_header_mutations_{}; bool add_proxy_protocol_connection_state_ = true; -#if defined(ALIMESH) +#if defined(HIGRESS) std::chrono::seconds keepalive_header_timeout_{}; #endif diff --git a/test/common/protobuf/utility_test.cc b/test/common/protobuf/utility_test.cc index 485386381600..5d89275dc343 100644 --- a/test/common/protobuf/utility_test.cc +++ b/test/common/protobuf/utility_test.cc @@ -1751,7 +1751,7 @@ TEST(DurationUtilTest, NoThrow) { } } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST(DurationUtilTest, ConvertDurationToJsonString) { { ProtobufWkt::Duration duration; diff --git a/test/common/router/BUILD b/test/common/router/BUILD index 61060a0b7ce3..30d644a02828 100644 --- a/test/common/router/BUILD +++ b/test/common/router/BUILD @@ -145,7 +145,7 @@ envoy_cc_test( "@envoy_api//envoy/config/route/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto", ], - alimesh_deps = [ + higress_deps = [ "//test/mocks/stream_info:stream_info_mocks", ], ) @@ -181,7 +181,7 @@ envoy_cc_test( "@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto", "@envoy_api//envoy/service/discovery/v3:pkg_cc_proto", ], - alimesh_deps = [ + higress_deps = [ "//test/mocks/stream_info:stream_info_mocks", ], ) diff --git a/test/common/router/config_impl_test.cc b/test/common/router/config_impl_test.cc index d3db1acdaba5..02a3a86a5419 100644 --- a/test/common/router/config_impl_test.cc +++ b/test/common/router/config_impl_test.cc @@ -54,7 +54,7 @@ using ::testing::NiceMock; using ::testing::Pair; using ::testing::Return; using ::testing::ReturnRef; -#if defined(ALIMESH) +#if defined(HIGRESS) using ::testing::ReturnPointee; #endif @@ -3169,7 +3169,7 @@ TEST_F(RouterMatcherHashPolicyTest, HashIpv4DifferentAddresses) { } } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(RouterMatcherHashPolicyTest, DISABLED_HashIpv6DifferentAddresses) { #else TEST_F(RouterMatcherHashPolicyTest, HashIpv6DifferentAddresses) { @@ -3702,7 +3702,7 @@ TEST_F(RouteMatcherTest, ClusterSpecifierPlugin) { EXPECT_EQ(mock_route.get(), config.route(genHeaders("some_cluster", "/bar", "GET"), 0).get()); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(RouteMatcherTest, WeightedClusterSpecifierPlugin) { const std::string yaml = R"EOF( cluster_specifier_plugins: @@ -7397,7 +7397,7 @@ TEST_F(CustomRequestHeadersTest, AddNewHeader) { EXPECT_EQ("127.0.0.1", headers.get_("x-client-ip")); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(CustomRequestHeadersTest, AddMseOriginalPathHeader) { const std::string yaml = R"EOF( virtual_hosts: @@ -10614,7 +10614,7 @@ TEST_F(RouteConfigurationV2, InternalRedirectPolicyDropsInvalidRedirectCodeCause internal_redirect_policy.shouldRedirectForResponseCode(static_cast(200))); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(RouteConfigurationV2, InternalActiveRedirectIsDisabledWhenNotSpecifiedInRouteAction) { const std::string yaml = R"EOF( virtual_hosts: @@ -11940,7 +11940,7 @@ TEST_F(RouteMatchOverrideTest, NullRouteOnRequireTlsAll) { }, genHeaders("bat.com", "/", "GET")); EXPECT_NE(nullptr, dynamic_cast(accepted_route.get())); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_EQ(Http::Code::MovedPermanently, dynamic_cast(accepted_route.get()) ->directResponseEntry() @@ -12027,7 +12027,7 @@ TEST_F(CommonConfigImplTest, TestCommonConfig) { shared_config.ignorePathParametersInPathMatching()); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(RouteMatchOverrideTest, NullRouteOnExactAllowServerNames) { const std::string yaml = R"EOF( virtual_hosts: diff --git a/test/common/router/router_2_test.cc b/test/common/router/router_2_test.cc index 53870c1571a9..1ecafa562d38 100644 --- a/test/common/router/router_2_test.cc +++ b/test/common/router/router_2_test.cc @@ -57,9 +57,9 @@ TEST_F(RouterTestSuppressEnvoyHeaders, MaintenanceMode) { router_->decodeHeaders(headers, true); } -// if ALIMESH defined, x-envoy-upstream-service-time will be added anyway. +// if HIGRESS defined, x-envoy-upstream-service-time will be added anyway. // see https://code.alibaba-inc.com/Ingress/envoy/codereview/13276137 -#ifndef ALIMESH +#ifndef HIGRESS // Validate that x-envoy-upstream-service-time is not added when Envoy header // suppression is enabled. // TODO(htuch): Probably should be TEST_P with @@ -435,7 +435,7 @@ TEST_F(RouterTestChildSpan, BasicFlow) { EXPECT_CALL(callbacks_.active_span_, spawnChild_(_, "router observability_name egress", _)) .WillOnce(Return(child_span)); EXPECT_CALL(callbacks_, tracingConfig()).Times(2); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*child_span, setTag(Eq(Tracing::Tags::get().PeerIpv4), Eq("10.0.0.5"))); #endif router_->decodeHeaders(headers, true); @@ -489,7 +489,7 @@ TEST_F(RouterTestChildSpan, ResetFlow) { EXPECT_CALL(callbacks_.active_span_, spawnChild_(_, "router observability_name egress", _)) .WillOnce(Return(child_span)); EXPECT_CALL(callbacks_, tracingConfig()).Times(2); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*child_span, setTag(Eq(Tracing::Tags::get().PeerIpv4), Eq("10.0.0.5"))); #endif router_->decodeHeaders(headers, true); @@ -546,7 +546,7 @@ TEST_F(RouterTestChildSpan, CancelFlow) { EXPECT_CALL(callbacks_.active_span_, spawnChild_(_, "router observability_name egress", _)) .WillOnce(Return(child_span)); EXPECT_CALL(callbacks_, tracingConfig()).Times(2); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*child_span, setTag(Eq(Tracing::Tags::get().PeerIpv4), Eq("10.0.0.5"))); #endif router_->decodeHeaders(headers, true); @@ -600,7 +600,7 @@ TEST_F(RouterTestChildSpan, ResetRetryFlow) { EXPECT_CALL(callbacks_.active_span_, spawnChild_(_, "router observability_name egress", _)) .WillOnce(Return(child_span_1)); EXPECT_CALL(callbacks_, tracingConfig()).Times(2); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*child_span_1, setTag(Eq(Tracing::Tags::get().PeerIpv4), Eq("10.0.0.5"))); #endif router_->decodeHeaders(headers, true); @@ -645,7 +645,7 @@ TEST_F(RouterTestChildSpan, ResetRetryFlow) { EXPECT_CALL(callbacks_.active_span_, spawnChild_(_, "router observability_name egress", _)) .WillOnce(Return(child_span_2)); EXPECT_CALL(callbacks_, tracingConfig()).Times(2); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(*child_span_2, setTag(Eq(Tracing::Tags::get().PeerIpv4), Eq("10.0.0.5"))); #endif EXPECT_CALL(*child_span_2, setTag(Eq(Tracing::Tags::get().RetryCount), Eq("1"))); diff --git a/test/common/router/router_test.cc b/test/common/router/router_test.cc index 7b7aee44a912..48b5d7eb2110 100644 --- a/test/common/router/router_test.cc +++ b/test/common/router/router_test.cc @@ -4364,7 +4364,7 @@ TEST_F(RouterTest, CrossSchemeRedirectAllowedByPolicy) { router_->onDestroy(); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(RouterTest, InternalActiveRedirectRejectedWhenReachingMaxInternalRedirect) { enableActiveRedirects("http://www.foo.com", 3); setNumPreviousRedirect(3); @@ -6005,7 +6005,7 @@ TEST_F(RouterTest, CanaryStatusFalse) { .value()); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(RouterTest, DISABLED_AutoHostRewriteEnabled) { #else TEST_F(RouterTest, AutoHostRewriteEnabled) { diff --git a/test/common/router/router_test_base.cc b/test/common/router/router_test_base.cc index fa0ff45ab2af..df2d029f1577 100644 --- a/test/common/router/router_test_base.cc +++ b/test/common/router/router_test_base.cc @@ -243,7 +243,7 @@ void RouterTestBase::setNumPreviousRedirect(uint32_t num_previous_redirects) { StreamInfo::FilterState::StateType::Mutable, StreamInfo::FilterState::LifeSpan::Request); } -#if defined(ALIMESH) +#if defined(HIGRESS) void RouterTestBase::enableActiveRedirects(std::string redirect_url, uint32_t max_internal_redirects, bool forced_use_original_host, diff --git a/test/common/router/router_test_base.h b/test/common/router/router_test_base.h index ffd3d2616aaa..67c9bd1ca4a5 100644 --- a/test/common/router/router_test_base.h +++ b/test/common/router/router_test_base.h @@ -51,7 +51,7 @@ class RouterTestFilter : public Filter { return &downstream_connection_; } -#if defined(ALIMESH) +#if defined(HIGRESS) Http::FilterHeadersStatus decodeHeaders(Http::RequestHeaderMap& headers, bool end_stream) override { auto status = Filter::decodeHeaders(headers, end_stream); @@ -99,7 +99,7 @@ class RouterTestBase : public testing::Test { void expectNewStreamWithImmediateEncoder(Http::RequestEncoder& encoder, Http::ResponseDecoder** decoder, Http::Protocol protocol); -#if defined(ALIMESH) +#if defined(HIGRESS) void enableActiveRedirects(std::string redirect_url, uint32_t max_internal_redirects = 1, bool forced_use_original_host = false, bool forced_add_header_before_route_matcher = false); diff --git a/test/common/router/router_upstream_log_test.cc b/test/common/router/router_upstream_log_test.cc index a6ed19e56bb9..3413dbe32089 100644 --- a/test/common/router/router_upstream_log_test.cc +++ b/test/common/router/router_upstream_log_test.cc @@ -77,7 +77,7 @@ class TestFilter : public Filter { return &downstream_connection_; } -#if defined(ALIMESH) +#if defined(HIGRESS) Http::FilterHeadersStatus decodeHeaders(Http::RequestHeaderMap& headers, bool end_stream) override { auto status = Filter::decodeHeaders(headers, end_stream); diff --git a/test/common/router/scoped_config_impl_test.cc b/test/common/router/scoped_config_impl_test.cc index 3f6a245ab77f..518091bd1ead 100644 --- a/test/common/router/scoped_config_impl_test.cc +++ b/test/common/router/scoped_config_impl_test.cc @@ -6,7 +6,7 @@ #include "source/common/router/scoped_config_impl.h" -#if defined(ALIMESH) +#if defined(HIGRESS) #include "source/common/network/address_impl.h" #include "test/mocks/stream_info/mocks.h" #endif @@ -22,7 +22,7 @@ namespace { using ::Envoy::Http::TestRequestHeaderMapImpl; using ::testing::NiceMock; -#if defined(ALIMESH) +#if defined(HIGRESS) using ::testing::ReturnPointee; #endif @@ -358,7 +358,7 @@ TEST(ScopeKeyBuilderImplTest, Parse) { EXPECT_EQ(key, nullptr); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST(ScopeKeyBuilderImplTest, ParseHostAndPort) { std::string yaml_plain = R"EOF( fragments: diff --git a/test/common/router/scoped_rds_test.cc b/test/common/router/scoped_rds_test.cc index e1021771b2c4..510f59965d17 100644 --- a/test/common/router/scoped_rds_test.cc +++ b/test/common/router/scoped_rds_test.cc @@ -18,7 +18,7 @@ #include "source/common/protobuf/message_validator_impl.h" #include "source/common/router/scoped_rds.h" -#if defined(ALIMESH) +#if defined(HIGRESS) #include "source/common/network/address_impl.h" #include "test/mocks/stream_info/mocks.h" #endif @@ -46,7 +46,7 @@ using testing::IsNull; using testing::NiceMock; using testing::Return; using testing::ReturnRef; -#if defined(ALIMESH) +#if defined(HIGRESS) using testing::ReturnPointee; #endif @@ -339,7 +339,7 @@ TEST_F(InlineScopedRoutesTest, ConfigLoadAndDump) { class ScopedRdsTest : public ScopedRoutesTestBase { protected: -#if defined(ALIMESH) +#if defined(HIGRESS) void setupHostScope(const OptionalHttpFilters optional_http_filters = OptionalHttpFilters()) { ON_CALL(server_factory_context_.cluster_manager_, adsMux()) .WillByDefault(Return(std::make_shared<::Envoy::Config::NullGrpcMuxImpl>())); @@ -1916,7 +1916,7 @@ route_configuration_name: foo_routes EXPECT_EQ(config->name(), "foo_routes"); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(ScopedRdsTest, HostScopeMultipleResourcesSotw) { setupHostScope(); diff --git a/test/config_test/config_test.cc b/test/config_test/config_test.cc index 2cd465c5c804..3a20103ed467 100644 --- a/test/config_test/config_test.cc +++ b/test/config_test/config_test.cc @@ -49,7 +49,7 @@ static std::vector unsuported_win32_configs = { #if defined(WIN32) && !defined(SO_ORIGINAL_DST) "configs_original-dst-cluster_proxy_config.yaml", #endif -#if defined(ALIMESH) +#if defined(HIGRESS) // The test platform does not support udp Gro feature. "udp_envoy.yaml" #endif diff --git a/test/extensions/bootstrap/wasm/wasm_test.cc b/test/extensions/bootstrap/wasm/wasm_test.cc index 6e036339c024..f7f5ec784f99 100644 --- a/test/extensions/bootstrap/wasm/wasm_test.cc +++ b/test/extensions/bootstrap/wasm/wasm_test.cc @@ -144,7 +144,7 @@ TEST_P(WasmTestMatrix, LoggingWithEnvVars) { setWasmCode("logging"); auto wasm_weak = std::weak_ptr(wasm_); -#ifdef ALIMESH +#ifdef HIGRESS // auto wasm_handler = // std::make_unique(std::move(wasm_), *dispatcher_); auto wasm_handler = std::make_unique(std::move(wasm_)); diff --git a/test/extensions/common/wasm/context_test.cc b/test/extensions/common/wasm/context_test.cc index cdb362c3f1a8..6dac22888db2 100644 --- a/test/extensions/common/wasm/context_test.cc +++ b/test/extensions/common/wasm/context_test.cc @@ -243,7 +243,7 @@ TEST_F(ContextTest, FindValueTest) { EXPECT_FALSE(ctx_.FindValue("plugin_name", &arena).has_value()); } -#ifdef ALIMESH +#ifdef HIGRESS TEST_F(ContextTest, SetCustomSpanTagTest) { Http::MockStreamDecoderFilterCallbacks decoder_callbacks; Envoy::StreamInfo::MockStreamInfo decoder_si; diff --git a/test/extensions/common/wasm/wasm_test.cc b/test/extensions/common/wasm/wasm_test.cc index 282f4f2b92d0..8e8b7fed1101 100644 --- a/test/extensions/common/wasm/wasm_test.cc +++ b/test/extensions/common/wasm/wasm_test.cc @@ -103,7 +103,7 @@ TEST_P(WasmCommonTest, WasmFailState) { envoy::extensions::wasm::v3::PluginConfig plugin_config; auto plugin = std::make_shared( plugin_config, envoy::config::core::v3::TrafficDirection::UNSPECIFIED, local_info, nullptr); -#ifdef ALIMESH +#ifdef HIGRESS // auto wasm = std::make_shared( // std::make_unique(plugin->wasmConfig(), "", scope, *api, cluster_manager, *dispatcher), // *dispatcher); @@ -203,7 +203,7 @@ TEST_P(WasmCommonTest, Logging) { [](Wasm*, const std::shared_ptr&) -> ContextBase* { return nullptr; }); EXPECT_EQ(std::unique_ptr(wasm->createContext(plugin)), nullptr); auto wasm_weak = std::weak_ptr(wasm); -#ifdef ALIMESH +#ifdef HIGRESS // auto wasm_handle = // std::make_shared(std::move(wasm), *dispatcher); auto wasm_handle = std::make_shared(std::move(wasm)); @@ -717,7 +717,7 @@ TEST_P(WasmCommonTest, VmCache) { EXPECT_CALL(*root_context, log_(spdlog::level::info, Eq("on_delete logging"))); return root_context; }); -#ifdef ALIMESH +#ifdef HIGRESS // return std::make_shared(wasm, *dispatcher); return std::make_shared(wasm); #else @@ -839,7 +839,7 @@ TEST_P(WasmCommonTest, RemoteCode) { EXPECT_CALL(*root_context, log_(spdlog::level::info, Eq("on_delete logging"))); return root_context; }); -#ifdef ALIMESH +#ifdef HIGRESS return std::make_shared(wasm); // return std::make_shared(wasm, *dispatcher); #else @@ -965,7 +965,7 @@ TEST_P(WasmCommonTest, RemoteCodeMultipleRetry) { EXPECT_CALL(*root_context, log_(spdlog::level::info, Eq("on_delete logging"))); return root_context; }); -#ifdef ALIMESH +#ifdef HIGRESS return std::make_shared(wasm); // return std::make_shared(wasm, *dispatcher); #else @@ -1301,7 +1301,7 @@ TEST_P(WasmCommonTest, ThreadLocalCopyRetainsEnforcement) { EXPECT_TRUE(wasm->load(code, false)); EXPECT_TRUE(wasm->initialize()); -#ifdef ALIMESH +#ifdef HIGRESS // auto wasm_handle = // std::make_shared(std::move(wasm), *dispatcher); auto wasm_handle = std::make_shared(std::move(wasm)); diff --git a/test/extensions/filters/common/ext_authz/ext_authz_http_impl_test.cc b/test/extensions/filters/common/ext_authz/ext_authz_http_impl_test.cc index b4389de8ef7e..94a464a62df9 100644 --- a/test/extensions/filters/common/ext_authz/ext_authz_http_impl_test.cc +++ b/test/extensions/filters/common/ext_authz/ext_authz_http_impl_test.cc @@ -298,7 +298,7 @@ TEST_F(ExtAuthzHttpClientTest, ContentLengthEqualZeroWithAllowedHeaders) { EXPECT_EQ(message_ptr->headers().getMethodValue(), "POST"); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(ExtAuthzHttpClientTest, IsAuthorizationPass) { { // 200 code without x-mse-external-authz-check-result diff --git a/test/extensions/filters/http/cors/cors_filter_integration_test.cc b/test/extensions/filters/http/cors/cors_filter_integration_test.cc index a6374046bda3..ee58f92e19e7 100644 --- a/test/extensions/filters/http/cors/cors_filter_integration_test.cc +++ b/test/extensions/filters/http/cors/cors_filter_integration_test.cc @@ -230,7 +230,7 @@ class CorsFilterIntegrationTest : public testing::TestWithParam, Http::TestResponseHeaderMapImpl& expected_response_headers) { response_headers.remove(Envoy::Http::LowerCaseString{"date"}); response_headers.remove(Envoy::Http::LowerCaseString{"x-envoy-upstream-service-time"}); -#if defined(ALIMESH) +#if defined(HIGRESS) response_headers.remove(Envoy::Http::LowerCaseString{"req-cost-time"}); response_headers.remove(Envoy::Http::LowerCaseString{"req-start-time"}); response_headers.remove(Envoy::Http::LowerCaseString{"req-arrive-time"}); diff --git a/test/extensions/filters/http/custom_response/custom_response_filter_test.cc b/test/extensions/filters/http/custom_response/custom_response_filter_test.cc index c952c5c55ea7..2260345bf99a 100644 --- a/test/extensions/filters/http/custom_response/custom_response_filter_test.cc +++ b/test/extensions/filters/http/custom_response/custom_response_filter_test.cc @@ -39,7 +39,7 @@ class CustomResponseFilterTest : public testing::Test { filter_ = std::make_unique(config_); filter_->setEncoderFilterCallbacks(encoder_callbacks_); filter_->setDecoderFilterCallbacks(decoder_callbacks_); -#if defined(ALIMESH) +#if defined(HIGRESS) ON_CALL(decoder_callbacks_, recreateStream(_)).WillByDefault(Return(true)); ON_CALL(decoder_callbacks_, recreateStream(_, _)).WillByDefault(Return(true)); #endif @@ -95,7 +95,7 @@ TEST_F(CustomResponseFilterTest, RemoteData) { ::Envoy::Http::TestRequestHeaderMapImpl request_headers{}; EXPECT_EQ(filter_->decodeHeaders(request_headers, false), ::Envoy::Http::FilterHeadersStatus::Continue); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(decoder_callbacks_, recreateStream(_, false)); #else EXPECT_CALL(decoder_callbacks_, recreateStream(_)); @@ -214,7 +214,7 @@ TEST_F(CustomResponseFilterTest, InvalidSchemeRedirect) { stats_store_.findCounterByString("stats.custom_response_invalid_uri").value().get().value()); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_F(CustomResponseFilterTest, SingleRedirectCustomStatus) { // Create config with invalid scheme field. createConfig(R"EOF( @@ -250,7 +250,7 @@ TEST_F(CustomResponseFilterTest, SingleRedirectCustomStatus) { ::Envoy::Http::TestRequestHeaderMapImpl request_headers{{"Host", "example.foo"}}; EXPECT_EQ(filter_->decodeHeaders(request_headers, false), ::Envoy::Http::FilterHeadersStatus::Continue); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_CALL(decoder_callbacks_, recreateStream(_, false)); #else EXPECT_CALL(decoder_callbacks_, recreateStream(_)); diff --git a/test/extensions/filters/http/ext_proc/utils.cc b/test/extensions/filters/http/ext_proc/utils.cc index dda06aef0f4b..4711af69dd39 100644 --- a/test/extensions/filters/http/ext_proc/utils.cc +++ b/test/extensions/filters/http/ext_proc/utils.cc @@ -9,7 +9,7 @@ namespace ExternalProcessing { const absl::flat_hash_set ExtProcTestUtility::ignoredHeaders() { CONSTRUCT_ON_FIRST_USE(absl::flat_hash_set, "x-request-id", -#ifdef ALIMESH +#ifdef HIGRESS "x-envoy-upstream-service-time", "req-cost-time", "req-arrive-time", "resp-start-time"); #else diff --git a/test/extensions/filters/http/on_demand/on_demand_filter_test.cc b/test/extensions/filters/http/on_demand/on_demand_filter_test.cc index 4ab8b2dcfdeb..d20d02ab520b 100644 --- a/test/extensions/filters/http/on_demand/on_demand_filter_test.cc +++ b/test/extensions/filters/http/on_demand/on_demand_filter_test.cc @@ -134,7 +134,7 @@ TEST_F(OnDemandFilterTest, TEST_F(OnDemandFilterTest, TestOnRouteConfigUpdateCompletionContinuesDecodingWithRedirectWithBody) { Buffer::OwnedImpl buffer; EXPECT_CALL(decoder_callbacks_, continueDecoding()); -#ifndef ALIMESH +#ifndef HIGRESS EXPECT_CALL(decoder_callbacks_, decodingBuffer()).WillOnce(Return(&buffer)); #endif filter_->onRouteConfigUpdateCompletion(true); @@ -143,7 +143,7 @@ TEST_F(OnDemandFilterTest, TestOnRouteConfigUpdateCompletionContinuesDecodingWit // tests onRouteConfigUpdateCompletion() when ActiveStream recreation fails TEST_F(OnDemandFilterTest, OnRouteConfigUpdateCompletionContinuesDecodingIfRedirectFails) { EXPECT_CALL(decoder_callbacks_, continueDecoding()); -#ifndef ALIMESH +#ifndef HIGRESS EXPECT_CALL(decoder_callbacks_, decodingBuffer()).WillOnce(Return(nullptr)); EXPECT_CALL(decoder_callbacks_, recreateStream(_)).WillOnce(Return(false)); #endif @@ -152,7 +152,7 @@ TEST_F(OnDemandFilterTest, OnRouteConfigUpdateCompletionContinuesDecodingIfRedir // tests onRouteConfigUpdateCompletion() when route was resolved TEST_F(OnDemandFilterTest, OnRouteConfigUpdateCompletionRestartsActiveStream) { -#ifndef ALIMESH +#ifndef HIGRESS EXPECT_CALL(decoder_callbacks_, decodingBuffer()).WillOnce(Return(nullptr)); EXPECT_CALL(decoder_callbacks_, recreateStream(_)).WillOnce(Return(true)); #endif diff --git a/test/extensions/filters/http/tap/tap_filter_integration_test.cc b/test/extensions/filters/http/tap/tap_filter_integration_test.cc index db206deb8c7f..b49f259d98f2 100644 --- a/test/extensions/filters/http/tap/tap_filter_integration_test.cc +++ b/test/extensions/filters/http/tap/tap_filter_integration_test.cc @@ -333,7 +333,7 @@ config_id: test_config_id admin_response_->waitForBodyData(1); envoy::data::tap::v3::TraceWrapper trace; TestUtility::loadFromYaml(admin_response_->body(), trace); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_EQ(trace.http_buffered_trace().request().headers().size(), 10); EXPECT_EQ(trace.http_buffered_trace().response().headers().size(), 7); #else @@ -351,7 +351,7 @@ config_id: test_config_id // Wait for the tap message. admin_response_->waitForBodyData(1); TestUtility::loadFromYaml(admin_response_->body(), trace); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_EQ(trace.http_buffered_trace().request().headers().size(), 9); EXPECT_EQ(trace.http_buffered_trace().response().headers().size(), 8); #else diff --git a/test/extensions/filters/http/wasm/wasm_filter_test.cc b/test/extensions/filters/http/wasm/wasm_filter_test.cc index 256280763966..f05b1716a880 100644 --- a/test/extensions/filters/http/wasm/wasm_filter_test.cc +++ b/test/extensions/filters/http/wasm/wasm_filter_test.cc @@ -528,7 +528,7 @@ TEST_P(WasmHttpFilterTest, BodyRequestReplaceBufferedBody) { filter().onDestroy(); } -#if defined(ALIMESH) +#if defined(HIGRESS) // Script that replaces the batched buffered body. TEST_P(WasmHttpFilterTest, BodyRequestReplaceBatchedBufferedBody) { setupTest("body"); @@ -755,7 +755,7 @@ TEST_P(WasmHttpFilterTest, AccessLogCreate) { AccessLog::AccessLogType::NotSet); filter().onDestroy(); } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_P(WasmHttpFilterTest, RedisCall) { if (std::get<1>(GetParam()) == "rust") { // This feature is not supported in rust @@ -1832,7 +1832,7 @@ TEST_P(WasmHttpFilterTest, GrpcStreamOpenAtShutdown) { } } -#if defined(ALIMESH) +#if defined(HIGRESS) TEST_P(WasmHttpFilterTest, GetRouteName) { if (std::get<1>(GetParam()) == "rust") { return; diff --git a/test/extensions/filters/network/common/redis/BUILD b/test/extensions/filters/network/common/redis/BUILD index 7a066e8495fe..4e7fa6c85982 100644 --- a/test/extensions/filters/network/common/redis/BUILD +++ b/test/extensions/filters/network/common/redis/BUILD @@ -20,7 +20,7 @@ envoy_cc_mock( "//source/extensions/filters/network/common/redis:codec_lib", "//test/test_common:printers_lib", ], - alimesh_deps = [ + higress_deps = [ "//source/extensions/filters/network/common/redis:raw_client_lib", ], ) @@ -63,7 +63,7 @@ envoy_cc_test( "//test/test_common:simulated_time_system_lib", "@envoy_api//envoy/extensions/filters/network/redis_proxy/v3:pkg_cc_proto", ], - alimesh_deps = [ + higress_deps = [ "//source/extensions/filters/network/common/redis:raw_client_lib", ], ) diff --git a/test/extensions/filters/network/common/redis/client_impl_test.cc b/test/extensions/filters/network/common/redis/client_impl_test.cc index 41a9fb419ff7..3fe9f0596277 100644 --- a/test/extensions/filters/network/common/redis/client_impl_test.cc +++ b/test/extensions/filters/network/common/redis/client_impl_test.cc @@ -1224,7 +1224,7 @@ TEST(RedisClientFactoryImplTest, Basic) { *stats_.rootScope(), auth_username, auth_password, false); client->close(); } -#if defined(ALIMESH) +#if defined(HIGRESS) class RedisRawClientDefaultConfig : public Config { std::chrono::milliseconds opTimeout() const override { return std::chrono::milliseconds(20); } // Cluster is not supported diff --git a/test/extensions/filters/network/common/redis/codec_impl_test.cc b/test/extensions/filters/network/common/redis/codec_impl_test.cc index 26af8f0254be..aaaf6698f515 100644 --- a/test/extensions/filters/network/common/redis/codec_impl_test.cc +++ b/test/extensions/filters/network/common/redis/codec_impl_test.cc @@ -426,7 +426,7 @@ TEST_F(RedisEncoderDecoderImplTest, InvalidBulkStringExpectLF) { buffer_.add("$1\r\na\ra"); EXPECT_THROW(decoder_.decode(buffer_), ProtocolError); } -#if defined(ALIMESH) +#if defined(HIGRESS) class RedisRawEncoderDecoderImplTest : public testing::Test, RawDecoderCallbacks { public: RedisRawEncoderDecoderImplTest() : decoder_(*this) {} diff --git a/test/extensions/filters/network/common/redis/mocks.cc b/test/extensions/filters/network/common/redis/mocks.cc index 6107d8ae5568..56cf240dff71 100644 --- a/test/extensions/filters/network/common/redis/mocks.cc +++ b/test/extensions/filters/network/common/redis/mocks.cc @@ -29,7 +29,7 @@ MockEncoder::MockEncoder() { } MockEncoder::~MockEncoder() = default; -#if defined(ALIMESH) +#if defined(HIGRESS) MockRawEncoder::MockRawEncoder() { ON_CALL(*this, encode(_, _)) .WillByDefault(Invoke([this](std::string_view value, Buffer::Instance& out) -> void { @@ -62,7 +62,7 @@ MockPoolRequest::~MockPoolRequest() = default; MockClientCallbacks::MockClientCallbacks() = default; MockClientCallbacks::~MockClientCallbacks() = default; -#if defined(ALIMESH) +#if defined(HIGRESS) MockRawClientCallbacks::MockRawClientCallbacks() = default; MockRawClientCallbacks::~MockRawClientCallbacks() = default; #endif diff --git a/test/extensions/filters/network/common/redis/mocks.h b/test/extensions/filters/network/common/redis/mocks.h index a9be66ad1c53..5f6bc3f57e29 100644 --- a/test/extensions/filters/network/common/redis/mocks.h +++ b/test/extensions/filters/network/common/redis/mocks.h @@ -35,7 +35,7 @@ class MockEncoder : public Common::Redis::Encoder { private: Common::Redis::EncoderImpl real_encoder_; }; -#if defined(ALIMESH) +#if defined(HIGRESS) class MockRawEncoder : public Common::Redis::RawEncoder { public: MockRawEncoder(); @@ -122,7 +122,7 @@ class MockClientCallbacks : public ClientCallbacks { (Common::Redis::RespValuePtr & value, const std::string& host_address, bool ask_redirection)); }; -#if defined(ALIMESH) +#if defined(HIGRESS) class MockRawClientCallbacks : public RawClientCallbacks { public: MockRawClientCallbacks(); diff --git a/test/extensions/filters/network/wasm/config_test.cc b/test/extensions/filters/network/wasm/config_test.cc index cb7cac3886fd..4a07e66324f9 100644 --- a/test/extensions/filters/network/wasm/config_test.cc +++ b/test/extensions/filters/network/wasm/config_test.cc @@ -190,7 +190,7 @@ TEST_P(WasmNetworkFilterConfigTest, FilterConfigFailClosed) { NetworkFilters::Wasm::FilterConfig filter_config(proto_config, context_); filter_config.wasmForTest()->fail(proxy_wasm::FailState::RuntimeError, ""); auto context = filter_config.createFilter(); -#ifdef ALIMESH +#ifdef HIGRESS EXPECT_NE(context->wasm(), nullptr); #else EXPECT_EQ(context->wasm(), nullptr); @@ -217,7 +217,7 @@ TEST_P(WasmNetworkFilterConfigTest, FilterConfigFailOpen) { TestUtility::loadFromYaml(yaml, proto_config); NetworkFilters::Wasm::FilterConfig filter_config(proto_config, context_); filter_config.wasmForTest()->fail(proxy_wasm::FailState::RuntimeError, ""); -#ifdef ALIMESH +#ifdef HIGRESS EXPECT_NE(filter_config.createFilter(), nullptr); #else EXPECT_EQ(filter_config.createFilter(), nullptr); diff --git a/test/extensions/network/dns_resolver/cares/dns_impl_test.cc b/test/extensions/network/dns_resolver/cares/dns_impl_test.cc index a756af894221..313304b34d1f 100644 --- a/test/extensions/network/dns_resolver/cares/dns_impl_test.cc +++ b/test/extensions/network/dns_resolver/cares/dns_impl_test.cc @@ -1121,7 +1121,7 @@ TEST_P(DnsImplTest, DestroyChannelOnResetNetworking) { // This test will failed beacuse of c-ares libray, we can fix it in the next version merge, see // https://github.com/envoyproxy/envoy/pull/33711 -#ifndef ALIMESH +#ifndef HIGRESS // Validate that the c-ares channel is destroyed and re-initialized when c-ares returns // ARES_ECONNREFUSED as its callback status. TEST_P(DnsImplTest, DestroyChannelOnRefused) { diff --git a/test/extensions/tracers/skywalking/tracer_test.cc b/test/extensions/tracers/skywalking/tracer_test.cc index 2b96ebca67ed..e5d0fc1b2548 100644 --- a/test/extensions/tracers/skywalking/tracer_test.cc +++ b/test/extensions/tracers/skywalking/tracer_test.cc @@ -218,7 +218,7 @@ TEST_F(TracerTest, TracerTestCreateNewSpanWithNoPropagationHeaders) { EXPECT_NE(0, third_child_span->spanEntity()->endTime()); } -#if defined(ALIMESH) +#if defined(HIGRESS) { Envoy::Tracing::SpanPtr org_child_span_with_traceid_header = org_span->spawnChild(mock_tracing_config_, "TestChild", mock_time_source_.systemTime()); diff --git a/test/extensions/transport_sockets/tls/context_impl_test.cc b/test/extensions/transport_sockets/tls/context_impl_test.cc index 87245aac8079..3b6f702c9712 100644 --- a/test/extensions/transport_sockets/tls/context_impl_test.cc +++ b/test/extensions/transport_sockets/tls/context_impl_test.cc @@ -1223,7 +1223,7 @@ TEST_F(ClientContextConfigImplTest, RSA2048Cert) { auto cleanup = cleanUpHelper(context); } -#if !defined(ALIMESH) +#if !defined(HIGRESS) // Validate that 1024-bit RSA certificates are rejected. TEST_F(ClientContextConfigImplTest, RSA1024Cert) { envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context; diff --git a/test/integration/header_integration_test.cc b/test/integration/header_integration_test.cc index 0e8b4edcfeef..3c9d2bbfb1e7 100644 --- a/test/integration/header_integration_test.cc +++ b/test/integration/header_integration_test.cc @@ -443,7 +443,7 @@ class HeaderIntegrationTest void compareHeaders(Headers&& headers, const ExpectedHeaders& expected_headers) { headers.remove(Envoy::Http::LowerCaseString{"content-length"}); headers.remove(Envoy::Http::LowerCaseString{"date"}); -#if defined(ALIMESH) +#if defined(HIGRESS) headers.remove(Envoy::Http::LowerCaseString{"req-start-time"}); headers.remove(Envoy::Http::LowerCaseString{"req-cost-time"}); headers.remove(Envoy::Http::LowerCaseString{"x-envoy-original-host"}); diff --git a/test/integration/http2_flood_integration_test.cc b/test/integration/http2_flood_integration_test.cc index 8914eb02f44b..35bc505870bf 100644 --- a/test/integration/http2_flood_integration_test.cc +++ b/test/integration/http2_flood_integration_test.cc @@ -369,7 +369,7 @@ TEST_P(Http2FloodMitigationTest, Data) { // 9-byte frame header; 10 bytes per data frame, 10000 bytes total. The output buffer should also // contain response headers, which should be less than 100 bytes. EXPECT_LE(10000, buffer_factory->maxBufferSize()); -#if defined(ALIMESH) +#if defined(HIGRESS) EXPECT_GE(20000, buffer_factory->maxBufferSize()); #else EXPECT_GE(10100, buffer_factory->maxBufferSize()); diff --git a/test/integration/http_integration.cc b/test/integration/http_integration.cc index a189e1d27296..fe2640ae1b0b 100644 --- a/test/integration/http_integration.cc +++ b/test/integration/http_integration.cc @@ -674,7 +674,7 @@ void HttpIntegrationTest::testRouterUpstreamProtocolError(const std::string& exp FakeRawConnectionPtr fake_upstream_connection; ASSERT_TRUE(fake_upstreams_[0]->waitForRawConnection(fake_upstream_connection)); std::string data; -#if defined(ALIMESH) +#if defined(HIGRESS) // We added some custom TRI headers, so the request data changed. ASSERT_TRUE(fake_upstream_connection->waitForData(247, &data)); #else @@ -1419,7 +1419,7 @@ void HttpIntegrationTest::testManyRequestHeaders(std::chrono::milliseconds time) {Http::Headers::get().Path, "/test/long/url"}, {Http::Headers::get().Scheme, "http"}, {Http::Headers::get().Host, "sni.lyft.com"}}); -#if defined(ALIMESH) +#if defined(HIGRESS) for (int i = 0; i < 9000; i++) { big_headers->addCopy(Http::LowerCaseString(std::to_string(i)), std::string(0, 'a')); } diff --git a/test/integration/protocol_integration_test.cc b/test/integration/protocol_integration_test.cc index 618ce7454eae..5e2a5fb43899 100644 --- a/test/integration/protocol_integration_test.cc +++ b/test/integration/protocol_integration_test.cc @@ -907,7 +907,7 @@ TEST_P(ProtocolIntegrationTest, Retry) { const size_t http2_header_bytes_received = (GetParam().http2_implementation == Http2Impl::Oghttp2) ? 24 : 27; expectUpstreamBytesSentAndReceived( -#ifdef ALIMESH +#ifdef HIGRESS BytesCountExpectation(2686 + quic_https_extra_bytes, 635, 550 + quic_https_extra_bytes, 54), BytesCountExpectation(2262, 548, 242, http2_header_bytes_received), BytesCountExpectation(2204, 520, 202, 6)); @@ -3723,7 +3723,7 @@ TEST_P(ProtocolIntegrationTest, HeaderOnlyBytesCountUpstream) { const size_t wire_bytes_received = (GetParam().http2_implementation == Http2Impl::Oghttp2) ? 10 : 13; expectUpstreamBytesSentAndReceived( -#ifdef ALIMESH +#ifdef HIGRESS BytesCountExpectation(227, 38, 196, 18), BytesCountExpectation(164, wire_bytes_received, 164, wire_bytes_received), BytesCountExpectation(160, 5, 160, 3)); @@ -3741,7 +3741,7 @@ TEST_P(ProtocolIntegrationTest, HeaderOnlyBytesCountDownstream) { useAccessLog("%DOWNSTREAM_WIRE_BYTES_SENT% %DOWNSTREAM_WIRE_BYTES_RECEIVED% " "%DOWNSTREAM_HEADER_BYTES_SENT% %DOWNSTREAM_HEADER_BYTES_RECEIVED%"); testRouterRequestAndResponseWithBody(0, 0, false); -#ifdef ALIMESH +#ifdef HIGRESS expectDownstreamBytesSentAndReceived(BytesCountExpectation(207, 51, 188, 19), BytesCountExpectation(138, 34, 138, 34), BytesCountExpectation(11, 10, 11, 6)); @@ -3762,7 +3762,7 @@ TEST_P(ProtocolIntegrationTest, HeaderAndBodyWireBytesCountUpstream) { testRouterRequestAndResponseWithBody(100, 100, false); const size_t header_bytes_received = (GetParam().http2_implementation == Http2Impl::Oghttp2) ? 10 : 13; -#ifdef ALIMESH +#ifdef HIGRESS expectUpstreamBytesSentAndReceived(BytesCountExpectation(366, 158, 224, 27), BytesCountExpectation(274, 122, 165, header_bytes_received), BytesCountExpectation(263, 109, 160, 3)); @@ -3781,7 +3781,7 @@ TEST_P(ProtocolIntegrationTest, HeaderAndBodyWireBytesCountDownstream) { useAccessLog("%DOWNSTREAM_WIRE_BYTES_SENT% %DOWNSTREAM_WIRE_BYTES_RECEIVED% " "%DOWNSTREAM_HEADER_BYTES_SENT% %DOWNSTREAM_HEADER_BYTES_RECEIVED%"); testRouterRequestAndResponseWithBody(100, 100, false); -#ifdef ALIMESH +#ifdef HIGRESS expectDownstreamBytesSentAndReceived(BytesCountExpectation(327, 190, 197, 46), BytesCountExpectation(240, 173, 131, 34), BytesCountExpectation(111, 113, 11, 6)); @@ -3810,7 +3810,7 @@ TEST_P(ProtocolIntegrationTest, HeaderAndBodyWireBytesCountReuseDownstream) { auto response_one = sendRequestAndWaitForResponse(default_request_headers_, request_size, default_response_headers_, response_size, 0); checkSimpleRequestSuccess(request_size, response_size, response_one.get()); -#ifdef ALIMESH +#ifdef HIGRESS expectDownstreamBytesSentAndReceived(BytesCountExpectation(327, 190, 197, 46), BytesCountExpectation(236, 137, 127, 34), BytesCountExpectation(111, 137, 11, 6), 0); @@ -3824,7 +3824,7 @@ TEST_P(ProtocolIntegrationTest, HeaderAndBodyWireBytesCountReuseDownstream) { auto response_two = sendRequestAndWaitForResponse(default_request_headers_, request_size, default_response_headers_, response_size, 0); checkSimpleRequestSuccess(request_size, response_size, response_two.get()); -#ifdef ALIMESH +#ifdef HIGRESS expectDownstreamBytesSentAndReceived(BytesCountExpectation(326, 190, 196, 46), BytesCountExpectation(178, 137, 46, 27), BytesCountExpectation(111, 137, 11, 6), 1); @@ -3856,7 +3856,7 @@ TEST_P(ProtocolIntegrationTest, HeaderAndBodyWireBytesCountReuseUpstream) { const size_t http2_header_bytes_received = (GetParam().http2_implementation == Http2Impl::Oghttp2) ? 10 : 13; expectUpstreamBytesSentAndReceived( -#ifdef ALIMESH +#ifdef HIGRESS BytesCountExpectation(366, 158, 224, 27), BytesCountExpectation(273, 122, 164, http2_header_bytes_received), BytesCountExpectation(263, 108, 160, 3), 0); @@ -3871,7 +3871,7 @@ TEST_P(ProtocolIntegrationTest, HeaderAndBodyWireBytesCountReuseUpstream) { auto response_two = sendRequestAndWaitForResponse(default_request_headers_, request_size, default_response_headers_, response_size, 0); -#ifdef ALIMESH +#ifdef HIGRESS const size_t http2_header_bytes_sent = (GetParam().http2_implementation == Http2Impl::Oghttp2) ? 69 : 72; expectUpstreamBytesSentAndReceived(BytesCountExpectation(366, 158, 224, 27), @@ -3944,7 +3944,7 @@ TEST_P(ProtocolIntegrationTest, TrailersWireBytesCountUpstream) { const size_t http2_trailer_bytes_received = (GetParam().http2_implementation == Http2Impl::Oghttp2) ? 49 : 52; expectUpstreamBytesSentAndReceived( -#ifdef ALIMESH +#ifdef HIGRESS BytesCountExpectation(316, 120, 264, 67), BytesCountExpectation(221, 81, 202, http2_trailer_bytes_received), BytesCountExpectation(178, 33, 166, 7)); @@ -3966,7 +3966,7 @@ TEST_P(ProtocolIntegrationTest, TrailersWireBytesCountDownstream) { config_helper_.addConfigModifier(setEnableUpstreamTrailersHttp1()); testTrailers(10, 20, true, true); -#ifdef ALIMESH +#ifdef HIGRESS expectDownstreamBytesSentAndReceived(BytesCountExpectation(289, 140, 239, 84), BytesCountExpectation(195, 86, 166, 67), BytesCountExpectation(36, 26, 17, 10)); @@ -3987,7 +3987,7 @@ TEST_P(ProtocolIntegrationTest, DownstreamDisconnectBeforeRequestCompleteWireByt testRouterDownstreamDisconnectBeforeRequestComplete(nullptr); -#ifdef ALIMESH +#ifdef HIGRESS expectUpstreamBytesSentAndReceived(BytesCountExpectation(255, 0, 224, 0), BytesCountExpectation(164, 0, 164, 0), BytesCountExpectation(160, 0, 160, 0)); @@ -4023,7 +4023,7 @@ TEST_P(ProtocolIntegrationTest, UpstreamDisconnectBeforeRequestCompleteWireBytes testRouterUpstreamDisconnectBeforeRequestComplete(); -#ifdef ALIMESH +#ifdef HIGRESS expectUpstreamBytesSentAndReceived(BytesCountExpectation(255, 0, 224, 0), BytesCountExpectation(164, 0, 164, 0), BytesCountExpectation(160, 0, 160, 0)); @@ -4047,7 +4047,7 @@ TEST_P(ProtocolIntegrationTest, UpstreamDisconnectBeforeResponseCompleteWireByte const size_t http2_header_bytes_received = (GetParam().http2_implementation == Http2Impl::Oghttp2) ? 10 : 13; expectUpstreamBytesSentAndReceived( -#ifdef ALIMESH +#ifdef HIGRESS BytesCountExpectation(227, 47, 196, 27), BytesCountExpectation(163, http2_header_bytes_received, 163, http2_header_bytes_received), BytesCountExpectation(160, 5, 160, 3)); diff --git a/test/integration/redirect_integration_test.cc b/test/integration/redirect_integration_test.cc index a06122893a1a..81ac19c5788c 100644 --- a/test/integration/redirect_integration_test.cc +++ b/test/integration/redirect_integration_test.cc @@ -225,7 +225,7 @@ TEST_P(RedirectIntegrationTest, BasicInternalRedirectDownstreamBytesCount) { ASSERT_TRUE(response->waitForEndStream()); ASSERT_TRUE(response->complete()); -#ifdef ALIMESH +#ifdef HIGRESS expectDownstreamBytesSentAndReceived(BytesCountExpectation(223, 63, 204, 31), BytesCountExpectation(136, 42, 136, 42), #else @@ -262,7 +262,7 @@ TEST_P(RedirectIntegrationTest, BasicInternalRedirectUpstreamBytesCount) { ASSERT_TRUE(response->waitForEndStream()); ASSERT_TRUE(response->complete()); BytesCountExpectation http2_expected = (GetParam().http2_implementation == Http2Impl::Oghttp2) -#ifdef ALIMESH +#ifdef HIGRESS ? BytesCountExpectation(189, 59, 189, 59) : BytesCountExpectation(189, 64, 189, 64); #else @@ -270,7 +270,7 @@ TEST_P(RedirectIntegrationTest, BasicInternalRedirectUpstreamBytesCount) { : BytesCountExpectation(137, 64, 137, 64); #endif -#ifdef ALIMESH +#ifdef HIGRESS expectUpstreamBytesSentAndReceived(BytesCountExpectation(267, 110, 236, 85), http2_expected, BytesCountExpectation(137, 64, 137, 64), 0); expectUpstreamBytesSentAndReceived(BytesCountExpectation(302, 38, 277, 18), diff --git a/test/mocks/http/mocks.cc b/test/mocks/http/mocks.cc index f8a44e1a3070..3c4337d59037 100644 --- a/test/mocks/http/mocks.cc +++ b/test/mocks/http/mocks.cc @@ -73,7 +73,7 @@ template static void initializeMockStreamFilterCallbacks(T& callbacks) MockStreamDecoderFilterCallbacks::MockStreamDecoderFilterCallbacks() { initializeMockStreamFilterCallbacks(*this); ON_CALL(*this, decodingBuffer()).WillByDefault(Invoke(&buffer_, &Buffer::InstancePtr::get)); -#if defined(ALIMESH) +#if defined(HIGRESS) ON_CALL(*this, modifyDecodingBuffer(_, _)) .WillByDefault(Invoke( [this](std::function callback, bool backup_for_replace) -> void { diff --git a/test/mocks/http/mocks.h b/test/mocks/http/mocks.h index 8305126db55c..b52be457f564 100644 --- a/test/mocks/http/mocks.h +++ b/test/mocks/http/mocks.h @@ -260,7 +260,7 @@ class MockStreamDecoderFilterCallbacks : public StreamDecoderFilterCallbacks, MOCK_METHOD(void, setDecoderBufferLimit, (uint32_t)); MOCK_METHOD(uint32_t, decoderBufferLimit, ()); MOCK_METHOD(bool, recreateStream, (const ResponseHeaderMap* headers)); -#if defined(ALIMESH) +#if defined(HIGRESS) MOCK_METHOD(bool, recreateStream, (const ResponseHeaderMap* headers, bool use_original_request_body)); #endif @@ -307,7 +307,7 @@ class MockStreamDecoderFilterCallbacks : public StreamDecoderFilterCallbacks, MOCK_METHOD(RequestTrailerMap&, addDecodedTrailers, ()); MOCK_METHOD(MetadataMapVector&, addDecodedMetadata, ()); MOCK_METHOD(const Buffer::Instance*, decodingBuffer, ()); -#if defined(ALIMESH) +#if defined(HIGRESS) MOCK_METHOD(void, modifyDecodingBuffer, (std::function, bool)); #endif MOCK_METHOD(void, modifyDecodingBuffer, (std::function)); @@ -678,7 +678,7 @@ class MockConnectionManagerConfig : public ConnectionManagerConfig { MOCK_METHOD(ServerHeaderValidatorPtr, makeHeaderValidator, (Protocol protocol)); MOCK_METHOD(bool, appendXForwardedPort, (), (const)); MOCK_METHOD(bool, addProxyProtocolConnectionState, (), (const)); -#if defined(ALIMESH) +#if defined(HIGRESS) MOCK_METHOD(std::chrono::seconds, keepaliveHeaderTimeout, (), (const)); #endif @@ -943,7 +943,7 @@ MATCHER_P(HeaderMapEqualWithMaxSize, rhs, "") { } MATCHER_P(HeaderMapEqualRef, rhs, "") { -#if defined(ALIMESH) +#if defined(HIGRESS) bool equal = true; auto getHeaderItems = [](const Envoy::Http::HeaderMap& header, diff --git a/test/mocks/router/mocks.cc b/test/mocks/router/mocks.cc index 9f725882b592..72a6f6cb1381 100644 --- a/test/mocks/router/mocks.cc +++ b/test/mocks/router/mocks.cc @@ -28,7 +28,7 @@ MockInternalRedirectPolicy::MockInternalRedirectPolicy() { ON_CALL(*this, enabled()).WillByDefault(Return(false)); } -#if defined(ALIMESH) +#if defined(HIGRESS) MockInternalActiveRedirectPolicy::MockInternalActiveRedirectPolicy() { ON_CALL(*this, enabled()).WillByDefault(Return(false)); } @@ -120,7 +120,7 @@ MockRouteEntry::MockRouteEntry() { ON_CALL(*this, connectConfig()).WillByDefault(Invoke([this]() { return connect_config_.has_value() ? makeOptRef(connect_config_.value()) : absl::nullopt; })); -#if defined(ALIMESH) +#if defined(HIGRESS) ON_CALL(*this, internalActiveRedirectPolicy()) .WillByDefault(ReturnRef(internal_active_redirect_policy_)); #endif @@ -173,7 +173,7 @@ MockRouteConfigProviderManager::~MockRouteConfigProviderManager() = default; MockScopedConfig::MockScopedConfig() { ON_CALL(*this, getRouteConfig(_)).WillByDefault(Return(route_config_)); -#if defined(ALIMESH) +#if defined(HIGRESS) ON_CALL(*this, getRouteConfig(_, _, _)).WillByDefault(Return(route_config_)); #endif } diff --git a/test/mocks/router/mocks.h b/test/mocks/router/mocks.h index 667088315901..84807f146e45 100644 --- a/test/mocks/router/mocks.h +++ b/test/mocks/router/mocks.h @@ -162,7 +162,7 @@ class MockInternalRedirectPolicy : public InternalRedirectPolicy { MOCK_METHOD(bool, isCrossSchemeRedirectAllowed, (), (const)); }; -#if defined(ALIMESH) +#if defined(HIGRESS) class MockInternalActiveRedirectPolicy : public InternalActiveRedirectPolicy { public: MockInternalActiveRedirectPolicy(); @@ -456,7 +456,7 @@ class MockRouteEntry : public RouteEntry { MOCK_METHOD(const EarlyDataPolicy&, earlyDataPolicy, (), (const)); MOCK_METHOD(const RouteStatsContextOptRef, routeStatsContext, (), (const)); -#if defined(ALIMESH) +#if defined(HIGRESS) MOCK_METHOD(const InternalActiveRedirectPolicy&, internalActiveRedirectPolicy, (), (const)); #endif @@ -480,7 +480,7 @@ class MockRouteEntry : public RouteEntry { UpgradeMap upgrade_map_; absl::optional connect_config_; -#if defined(ALIMESH) +#if defined(HIGRESS) testing::NiceMock internal_active_redirect_policy_; #endif testing::NiceMock early_data_policy_; @@ -615,7 +615,7 @@ class MockScopedConfig : public ScopedConfig { MOCK_METHOD(ConfigConstSharedPtr, getRouteConfig, (const ScopeKeyPtr& scope_key), (const)); -#if defined(ALIMESH) +#if defined(HIGRESS) MOCK_METHOD(ConfigConstSharedPtr, getRouteConfig, (const ScopeKeyBuilder*, const Http::HeaderMap&, const StreamInfo::StreamInfo*), (const)); @@ -644,7 +644,7 @@ class MockScopeKeyBuilder : public ScopeKeyBuilder { MockScopeKeyBuilder(); ~MockScopeKeyBuilder() override; -#if defined(ALIMESH) +#if defined(HIGRESS) MOCK_METHOD(ScopeKeyPtr, computeScopeKey, (const Http::HeaderMap&, const StreamInfo::StreamInfo*, std::function& recompute), diff --git a/test/mocks/stream_info/mocks.h b/test/mocks/stream_info/mocks.h index 4b43c667376f..7332afa7b728 100644 --- a/test/mocks/stream_info/mocks.h +++ b/test/mocks/stream_info/mocks.h @@ -142,7 +142,7 @@ class MockStreamInfo : public StreamInfo { MOCK_METHOD(bool, isShadow, (), (const, override)); MOCK_METHOD(void, setDownstreamTransportFailureReason, (absl::string_view failure_reason)); MOCK_METHOD(absl::string_view, downstreamTransportFailureReason, (), (const)); -#ifdef ALIMESH +#ifdef HIGRESS MOCK_METHOD(void, setCustomSpanTag, (absl::string_view, absl::string_view)); MOCK_METHOD((const absl::flat_hash_map&), getCustomSpanTagMap, (), (const)); #endif diff --git a/test/mocks/upstream/BUILD b/test/mocks/upstream/BUILD index 97b9706f0d34..e7fd96cd4444 100644 --- a/test/mocks/upstream/BUILD +++ b/test/mocks/upstream/BUILD @@ -233,7 +233,7 @@ envoy_cc_mock( "//test/mocks/upstream:cluster_priority_set_mocks", "//test/mocks/upstream:load_balancer_mocks", ], - alimesh_deps = [ + higress_deps = [ "//test/mocks/redis:redis_mocks", ], ) diff --git a/test/mocks/upstream/host.h b/test/mocks/upstream/host.h index 76817f1ec369..25989561f6e9 100644 --- a/test/mocks/upstream/host.h +++ b/test/mocks/upstream/host.h @@ -36,7 +36,7 @@ class MockDetectorHostMonitor : public DetectorHostMonitor { MOCK_METHOD(void, successRate, (DetectorHostMonitor::SuccessRateMonitorType type, double new_success_rate)); -#if defined(ALIMESH) +#if defined(HIGRESS) MOCK_METHOD(void, forceEjectHost, ()); #endif }; diff --git a/test/mocks/upstream/thread_local_cluster.cc b/test/mocks/upstream/thread_local_cluster.cc index 40e3a60c0c36..1ac8c6695195 100644 --- a/test/mocks/upstream/thread_local_cluster.cc +++ b/test/mocks/upstream/thread_local_cluster.cc @@ -18,7 +18,7 @@ MockThreadLocalCluster::MockThreadLocalCluster() { ON_CALL(*this, tcpConnPool(_, _)) .WillByDefault(Return(Upstream::TcpPoolData([]() {}, &tcp_conn_pool_))); ON_CALL(*this, httpAsyncClient()).WillByDefault(ReturnRef(async_client_)); -#if defined(ALIMESH) +#if defined(HIGRESS) ON_CALL(*this, redisAsyncClient()).WillByDefault(ReturnRef(redis_async_client_)); #endif } diff --git a/test/mocks/upstream/thread_local_cluster.h b/test/mocks/upstream/thread_local_cluster.h index d70b125e99ff..2622f7727446 100644 --- a/test/mocks/upstream/thread_local_cluster.h +++ b/test/mocks/upstream/thread_local_cluster.h @@ -38,7 +38,7 @@ class MockThreadLocalCluster : public ThreadLocalCluster { (ResourcePriority priority, LoadBalancerContext* context)); MOCK_METHOD(MockHost::MockCreateConnectionData, tcpConn_, (LoadBalancerContext * context)); MOCK_METHOD(Http::AsyncClient&, httpAsyncClient, ()); -#if defined(ALIMESH) +#if defined(HIGRESS) MOCK_METHOD(Redis::AsyncClient&, redisAsyncClient, ()); #endif MOCK_METHOD(Tcp::AsyncTcpClientPtr, tcpAsyncClient, @@ -48,7 +48,7 @@ class MockThreadLocalCluster : public ThreadLocalCluster { NiceMock lb_; NiceMock conn_pool_; NiceMock async_client_; -#if defined(ALIMESH) +#if defined(HIGRESS) NiceMock redis_async_client_; #endif NiceMock tcp_conn_pool_; diff --git a/test/server/admin/admin_test.cc b/test/server/admin/admin_test.cc index 6d791c34c06c..81e6315f709e 100644 --- a/test/server/admin/admin_test.cc +++ b/test/server/admin/admin_test.cc @@ -130,7 +130,7 @@ TEST_P(AdminInstanceTest, Help) { Http::TestResponseHeaderMapImpl header_map; Buffer::OwnedImpl response; EXPECT_EQ(Http::Code::OK, getCallback("/help", header_map, response)); -#if defined(ALIMESH) +#if defined(HIGRESS) const std::string expected = R"EOF(admin commands are: /: Admin home page /certs: print certs on machine diff --git a/test/test_common/utility.cc b/test/test_common/utility.cc index 1d2f13419484..fc825fa455c0 100644 --- a/test/test_common/utility.cc +++ b/test/test_common/utility.cc @@ -53,7 +53,7 @@ bool TestUtility::headerMapEqualIgnoreOrder(const Http::HeaderMap& lhs, absl::flat_hash_set rhs_keys; lhs.iterate([&lhs_keys](const Http::HeaderEntry& header) -> Http::HeaderMap::Iterate { const std::string key{header.key().getStringView()}; -#if defined(ALIMESH) +#if defined(HIGRESS) if (key == Http::CustomHeaders::get().AliExtendedValues.TriStartTime.get()) { return Http::HeaderMap::Iterate::Continue; } diff --git a/test/test_common/wasm_base.h b/test/test_common/wasm_base.h index 05565c350218..1cf6d2d1b948 100644 --- a/test/test_common/wasm_base.h +++ b/test/test_common/wasm_base.h @@ -147,7 +147,7 @@ template class WasmHttpFilterTestBase : public W context_->setEncoderFilterCallbacks(encoder_callbacks_); } -#if defined(ALIMESH) +#if defined(HIGRESS) template void doRecover() { std::shared_ptr new_handle; if (WasmTestBase::plugin_handle_->doRecover(new_handle)) {