Skip to content
Merged
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
14 changes: 12 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bind(
actual = "//external:ssl",
)

ENVOY_SHA = "6cb0983a1ce74c55aaf0124bd2227be8f9efa2de" # Sep 26, 2017 (use github to download tclap instead of sourceforge)
ENVOY_SHA = "8ff8c57b82ee42a3534093c53f80051516cb3c03" # Oct 24, 2017

http_archive(
name = "envoy",
Expand All @@ -47,7 +47,17 @@ http_archive(

load("@envoy//bazel:repositories.bzl", "envoy_dependencies")

envoy_dependencies()
envoy_dependencies(repository="@envoy")

bind(
name = "cc_wkt_protos",
actual = "@com_google_protobuf_cc//:cc_wkt_protos",
)

bind(
name = "cc_wkt_protos_genproto",
actual = "@com_google_protobuf_cc//:cc_wkt_protos_genproto",
)

load("@envoy//bazel:cc_configure.bzl", "cc_configure")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ class JwtVerificationFilterIntegrationTest
const Http::HeaderMap& headers) {
std::map<std::string, std::string> ret;
headers.iterate(
[](const Http::HeaderEntry& entry, void* context) -> void {
[](const Http::HeaderEntry& entry,
void* context) -> Http::HeaderMap::Iterate {
auto ret = static_cast<std::map<std::string, std::string>*>(context);
Http::LowerCaseString lower_key{entry.key().c_str()};
(*ret)[std::string(lower_key.get())] =
std::string(entry.value().c_str());
return Http::HeaderMap::Iterate::Continue;
},
&ret);
return ret;
Expand Down Expand Up @@ -122,7 +124,8 @@ class JwtVerificationFilterIntegrationTest

fake_upstream_connection_issuer =
fake_upstreams_[1]->waitForHttpConnection(*dispatcher_);
request_stream_issuer = fake_upstream_connection_issuer->waitForNewStream();
request_stream_issuer =
fake_upstream_connection_issuer->waitForNewStream(*dispatcher_);
request_stream_issuer->waitForEndStream(*dispatcher_);

// Mock a response from an issuer server.
Expand All @@ -140,7 +143,7 @@ class JwtVerificationFilterIntegrationTest
fake_upstream_connection_backend =
fake_upstreams_[0]->waitForHttpConnection(*dispatcher_);
request_stream_backend =
fake_upstream_connection_backend->waitForNewStream();
fake_upstream_connection_backend->waitForNewStream(*dispatcher_);
request_stream_backend->waitForEndStream(*dispatcher_);

EXPECT_TRUE(request_stream_backend->complete());
Expand Down
8 changes: 1 addition & 7 deletions src/envoy/mixer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#

load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@protobuf_bzl//:protobuf.bzl", "cc_proto_library")
load(
"@envoy//bazel:envoy_build_system.bzl",
"envoy_proto_library",
Expand All @@ -26,13 +25,9 @@ load(
"envoy_linkopts",
)

cc_proto_library(
envoy_proto_library(
name = "string_map_proto",
srcs = ["string_map.proto"],
default_runtime = "//external:protobuf",
linkstatic = 1,
protoc = "//external:protoc",
visibility = ["//visibility:public"],
)

envoy_cc_library(
Expand Down Expand Up @@ -77,7 +72,6 @@ envoy_cc_library(
deps = [
":string_map_proto",
"//external:mixer_client_lib",
"@envoy//source/common/grpc:rpc_channel_lib",
"@envoy//source/exe:envoy_common_lib",
],
)
Expand Down
7 changes: 4 additions & 3 deletions src/envoy/mixer/grpc_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ GrpcTransport<RequestType, ResponseType>::GrpcTransport(
response_(response),
on_done_(on_done),
request_(async_client_->send(
descriptor(), request, *this,
descriptor(), request, *this, Tracing::NullSpan::instance(),
Optional<std::chrono::milliseconds>(kGrpcRequestTimeoutMs))) {
ENVOY_LOG(debug, "Sending {} request: {}", descriptor().name(),
request.DebugString());
Expand All @@ -83,7 +83,7 @@ void GrpcTransport<RequestType, ResponseType>::onCreateInitialMetadata(

template <class RequestType, class ResponseType>
void GrpcTransport<RequestType, ResponseType>::onSuccess(
std::unique_ptr<ResponseType>&& response) {
std::unique_ptr<ResponseType>&& response, Tracing::Span&) {
ENVOY_LOG(debug, "{} response: {}", descriptor().name(),
response->DebugString());
response->Swap(response_);
Expand All @@ -93,7 +93,8 @@ void GrpcTransport<RequestType, ResponseType>::onSuccess(

template <class RequestType, class ResponseType>
void GrpcTransport<RequestType, ResponseType>::onFailure(
Grpc::Status::GrpcStatus status, const std::string& message) {
Grpc::Status::GrpcStatus status, const std::string& message,
Tracing::Span&) {
ENVOY_LOG(debug, "{} failed with code: {}, {}", descriptor().name(), status,
message);
on_done_(Status(static_cast<StatusCode>(status), message));
Expand Down
8 changes: 4 additions & 4 deletions src/envoy/mixer/grpc_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "common/common/logger.h"
#include "envoy/event/dispatcher.h"
#include "envoy/grpc/async_client.h"
#include "envoy/grpc/rpc_channel.h"

#include "envoy/upstream/cluster_manager.h"
#include "include/client.h"
Expand Down Expand Up @@ -53,10 +52,11 @@ class GrpcTransport : public Grpc::AsyncRequestCallbacks<ResponseType>,
// Grpc::AsyncRequestCallbacks<ResponseType>
void onCreateInitialMetadata(Http::HeaderMap& metadata) override;

void onSuccess(std::unique_ptr<ResponseType>&& response) override;
void onSuccess(std::unique_ptr<ResponseType>&& response,
Tracing::Span& span) override;

void onFailure(Grpc::Status::GrpcStatus status,
const std::string& message) override;
void onFailure(Grpc::Status::GrpcStatus status, const std::string& message,
Tracing::Span& span) override;

private:
static const google::protobuf::MethodDescriptor& descriptor();
Expand Down
3 changes: 2 additions & 1 deletion src/envoy/mixer/mixer_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ void SetInt64Attribute(const std::string& name, uint64_t value,
std::map<std::string, std::string> ExtractHeaders(const HeaderMap& header_map) {
std::map<std::string, std::string> headers;
header_map.iterate(
[](const HeaderEntry& header, void* context) {
[](const HeaderEntry& header, void* context) -> HeaderMap::Iterate {
std::map<std::string, std::string>* header_map =
static_cast<std::map<std::string, std::string>*>(context);
(*header_map)[header.key().c_str()] = header.value().c_str();
return HeaderMap::Iterate::Continue;
},
&headers);
return headers;
Expand Down
2 changes: 1 addition & 1 deletion src/envoy/mixer/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
################################################################################
#

MIXER_CLIENT = "1291823457147c2c8f50d1770f1571f7e14f63a2"
MIXER_CLIENT = "24ceb040f516279dfd56879608b68564a9ef5422"

def mixer_client_repositories(bind=True):
native.git_repository(
Expand Down