Skip to content

Commit

Permalink
Merge latest changes from master branch (#112)
Browse files Browse the repository at this point in the history
* Get attributes from envoy config. (#87)

* Send all attributes.

* Remove unused const strings.

* Address comment.

* updated SHA to point to newer envoy with RDS API feature (#94)

* Disable travis on stable branches (#96)

* Publish debug binaries (no release yet) (#98)

* Copies the binary instead of linking for release (#102)

* Not to use api_key if its service is not actived. (#109)
  • Loading branch information
mangchiandjjoe authored Feb 22, 2017
1 parent 6c3014d commit a27749c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
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 @@ -165,7 +165,8 @@ void RequestContext::FillOperationInfo(service_control::OperationInfo *info) {
info->operation_name = kUnrecognizedOperation;
}
info->operation_id = operation_id_;
if (check_response_info_.is_api_key_valid) {
if (check_response_info_.is_api_key_valid &&
check_response_info_.service_is_activated) {
info->api_key = api_key_;
}
info->producer_project_id = service_context()->project_id();
Expand Down
15 changes: 7 additions & 8 deletions contrib/endpoints/src/api_manager/service_control/proto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1019,14 +1019,13 @@ Status Proto::FillReportRequest(const ReportRequestInfo& info,
}
}

// Not to send consumer metrics for following cases:
// 1) api_key is not provided, or
// 2) the service is not activated for the consumer project,
bool send_consumer_metric = true;
if (info.api_key.empty() ||
!info.check_response_info.service_is_activated) {
send_consumer_metric = false;
}
// Not to send consumer metrics if api_key is empty.
// api_key is empty in one of following cases:
// 1) api_key is not provided,
// 2) api_key is invalid determined by the server from the Check call.
// 3) the service is not activated for the consumer project.
bool send_consumer_metric = !info.api_key.empty();

// Populate all metrics.
for (auto it = metrics_.begin(), end = metrics_.end(); it != end; it++) {
const SupportedMetric* m = *it;
Expand Down

0 comments on commit a27749c

Please sign in to comment.