Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Istio Proxy
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frshriram%2Fproxy.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Frshriram%2Fproxy?ref=badge_shield)


The Istio Proxy is a microservice proxy that can be used on the client and server side, and forms a microservice mesh. The Proxy supports a large number of features.

Expand Down Expand Up @@ -26,3 +28,7 @@ Please see [istio.io](https://istio.io)
to learn about the overall Istio project and how to get in touch with us. To learn how you can
contribute to any of the Istio components, including the proxy, please
see the Istio [contribution guidelines](https://github.com/istio/istio/blob/master/CONTRIBUTING.md).


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This extra blank line is unnecessary. A single blank line is sufficient to separate sections in Markdown.

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frshriram%2Fproxy.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frshriram%2Fproxy?ref=badge_large)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The file is missing a final newline character. It's a common convention and good practice to end files with a newline. Some tools and systems might not process the last line correctly if it's missing.

4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ bind(

git_repository(
name = "envoy",
remote = "https://github.com/lyft/envoy.git",
commit = "060cb67f0772a425a8ceaf30d28421967d69c0c6",
remote = "https://github.com/amalgam8/envoy.git",
commit = "c89a99e893b633e97419d306e0072f07bd2200fa",
Comment on lines +67 to +68

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This change switches the envoy dependency from the official lyft/envoy repository to the amalgam8/envoy fork. This is a major change that should be clearly explained in the pull request description. Using a fork can introduce risks related to maintenance, security, and falling behind the upstream project. Please add a comment to the git_repository rule or update the PR description to justify why this fork is necessary.

)

load("@envoy//bazel:repositories.bzl", "envoy_dependencies")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b2540808efaaa9e2c45c21be882b19b95003b41c8af8c9a740e67ee3d82fcfec envoy-alpha-ac4ef3f77692453dad2d04a6417bc6a1f3457e07.tar.gz
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21ddf0e73e14059836f597577ff6f0baa45204eceea65790f3958ac98a211801 envoy-debug-ac4ef3f77692453dad2d04a6417bc6a1f3457e07.tar.gz
Binary file not shown.
17 changes: 17 additions & 0 deletions src/envoy/mixer/http_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
#include "common/common/logger.h"
#include "common/http/headers.h"
#include "common/http/utility.h"
#include "common/tracing/zipkin_tracer_impl.h"
#include "envoy/server/instance.h"
#include "envoy/ssl/connection.h"
#include "envoy/tracing/http_tracer.h"
#include "server/config/network/http_connection_manager.h"
#include "src/envoy/mixer/config.h"
#include "src/envoy/mixer/http_control.h"
#include "src/envoy/mixer/utils.h"


using ::google::protobuf::util::Status;
using StatusCode = ::google::protobuf::util::error::Code;
using ::istio::mixer_client::DoneFunc;
Expand Down Expand Up @@ -223,6 +226,7 @@ class Instance : public Http::StreamDecoderFilter,
initiating_call_ = false;

if (state_ == Complete) {
updateSpan();
return FilterHeadersStatus::Continue;
}
Log().debug("Called Mixer::Instance : {} Stop", __func__);
Expand Down Expand Up @@ -280,10 +284,23 @@ class Instance : public Http::StreamDecoderFilter,

state_ = Complete;
if (!initiating_call_) {
updateSpan();
decoder_callbacks_->continueDecoding();
}
}

// After the check call, obtain the service name from the Mixer's
// response and update all the Zipkin annotations with the service
// name corresponding to the source ip.
void updateSpan() const {
Tracing::Span& activeSpan = decoder_callbacks_->activeSpan();
if (Tracing::ZipkinSpan *zipkinSpan = dynamic_cast<Tracing::ZipkinSpan*>(&activeSpan)) {
Zipkin::Span& span = zipkinSpan->span();
span.setSourceService(); //need source service name.
span.setDestinationService(); //need destination service name.
}
}
Comment on lines +295 to +302

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The implementation of updateSpan appears to be a placeholder and is incorrect.

  1. Incorrect calls: The calls to span.setSourceService() and span.setDestinationService() are made without arguments, while the inline comments (//need source service name.) indicate they are required. This will likely cause a build failure or a runtime bug, breaking tracing functionality. The function's purpose is to use data from Mixer's response, but the implementation does not extract or use any such data.
  2. Tight Coupling: The use of dynamic_cast to Tracing::ZipkinSpan tightly couples this code to a specific tracing implementation. Consider extending the Tracing::Span interface to make this more generic and maintainable.

This is a critical issue that needs to be addressed before merging.


virtual void log(const HeaderMap* request_headers,
const HeaderMap* response_headers,
const AccessLog::RequestInfo& request_info) override {
Expand Down