8000 Merge from master into firebase by sarvaniv · Pull Request #65 · istio/proxy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Merge from master into firebase #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 3, 2017
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
22 changes: 20 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,34 @@ googletest_repositories()
load(
"//contrib/endpoints:repositories.bzl",
"grpc_repositories",
"mixerapi_repositories",
"mixer_client_repositories",
"servicecontrol_client_repositories",
)

grpc_repositories()

mixerapi_repositories()
mixer_client_repositories()

servicecontrol_client_repositories()

# Workaround for Bazel > 0.4.0 since it needs newer protobuf.bzl from:
# https://github.com/google/protobuf/pull/2246
# Do not use this git_repository for anything else than protobuf.bzl
new_git_repository(
name = "protobuf_bzl",
# Injecting an empty BUILD file to prevent using any build target
build_file_content = "",
commit = "05090726144b6e632c50f47720ff51049bfcbef6",
remote = "https://github.com/google/protobuf.git",
)

load(
"@mixerclient_git//:repositories.bzl",
"mixerapi_repositories",
)

mixerapi_repositories(protobuf_repo="@protobuf_bzl//")

load(
"//src/envoy:repositories.bzl",
"envoy_repositories",
Expand Down
2 changes: 2 additions & 0 deletions contrib/endpoints/include/api_manager/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class Request {
// Gets Client IP
// This will be used by service control Check() call.
virtual std::string GetClientIP() = 0;
// Gets Client Host.
virtual std::string GetClientHost() { return ""; }

// Get GRPC stats.
virtual int64_t GetGrpcRequestBytes() = 0;
Expand Down
52 changes: 8 additions & 44 deletions contrib/endpoints/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -334,51 +334,15 @@ def servicecontrol_client_repositories(bind=True):
actual = "@servicecontrol_client_git//:service_control_client_lib",
)

def mixerapi_repositories(protobuf_repo="@protobuf_git//", bind=True):
BUILD = """
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
#
licenses(["notice"])

load("{}:protobuf.bzl", "cc_proto_library")

cc_proto_library(
name = "mixer_api_cc_proto",
srcs = glob(
["mixer/api/v1/*.proto"],
),
default_runtime = "//external:protobuf",
protoc = "//external:protoc",
visibility = ["//visibility:public"],
deps = [
"//external:cc_wkt_protos",
"//external:servicecontrol",
],
)
""".format(protobuf_repo)

native.new_git_repository(
name = "mixerapi_git",
commit = "fc5a396185edc72d06d1937f30a8148a37d4fc1b",
remote = "https://github.com/istio/api.git",
build_file_content = BUILD,
def mixer_client_repositories(bind=True):
native.git_repository(
name = "mixerclient_git",
commit = "80e450a5126960e8e6337c3631cf2ef984038eab",
remote = "https://github.com/istio/mixerclient.git",
)

if bind:
native.bind(
name = "mixer_api_cc_proto",
actual = "@mixerapi_git//:mixer_api_cc_proto",
name = "mixer_client_lib",
actual = "@mixerclient_git//:mixer_client_lib",
)
3 changes: 2 additions & 1 deletion contrib/endpoints/src/api_manager/context/request_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ void RequestContext::FillOperationInfo(service_control::OperationInfo *info) {
info->producer_project_id = service_context()->project_id();
info->referer = http_referer_;
info->request_start_time = start_time_;
info->client_ip = request_->GetClientIP();
info->client_host = request_->GetClientHost();
}

void RequestContext::FillLocation(service_control::ReportRequestInfo *info) {
Expand Down Expand Up @@ -221,7 +223,6 @@ void RequestContext::FillLogMessage(service_control::ReportRequestInfo *info) {
void RequestContext::FillCheckRequestInfo(
service_control::CheckRequestInfo *info) {
FillOperationInfo(info);
info->client_ip = request_->GetClientIP();
info->allow_unregistered_calls = method()->allow_unregistered_calls();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const int kIntermediateReportInterval = 10;

const char kHTTPHeadMethod[] = "HEAD";
const char kHTTPGetMethod[] = "GET";

const char kFirebaseAudience[] =
"https://staging-firebaserules.sandbox.googleapis.com/"
"google.firebase.rules.v1.FirebaseRulesService";
Expand Down
6 changes: 3 additions & 3 deletions contrib/endpoints/src/api_manager/mixer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ cc_library(
],
}),
deps = [
"//external:grpc++",
"//external:mixer_api_cc_proto",
"//external:protobuf",
"//contrib/endpoints/src/api_manager:impl_headers",
"//contrib/endpoints/src/api_manager/service_control",
"//contrib/endpoints/src/api_manager/utils",
"//external:grpc++",
"//external:mixer_client_lib",
"//external:protobuf",
],
)
Loading
0