Skip to content

Commit

Permalink
fix the format for api key uid
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot-xq committed May 2, 2024
1 parent c6c1434 commit f6dce14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api_proxy/service_control/request_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ Status set_credential_id(const SupportedLabel& l, const ReportRequestInfo& info,
if (info.check_response_info.error.is_network_error) {
(*labels)[l.name] = absl::StrCat(kApiKeyPrefix, "UNKNOWN");
} else {
(*labels)[l.name] = absl::StrCat(kApiKeyPrefix, info.check_response_info.api_key_uid.empty() ? info.api_key
: info.check_response_info.api_key_uid);
(*labels)[l.name] = info.check_response_info.api_key_uid.empty() ? absl::StrCat(kApiKeyPrefix, info.api_key)
: info.check_response_info.api_key_uid;
}
} else {
(*labels)[l.name] = absl::StrCat(kApiKeyPrefix, info.api_key);
Expand Down
2 changes: 1 addition & 1 deletion src/api_proxy/service_control/request_builder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ TEST_F(RequestBuilderTest, ReportApiKeyVerifiedWithApiKeyUIDTest) {
FillOperationInfo(&info);

info.check_response_info.api_key_state = api_key::ApiKeyState::VERIFIED;
info.check_response_info.api_key_uid = "fake_api_key_uid";
info.check_response_info.api_key_uid = "apikey:fake_api_key_uid";
info.enable_api_key_uid_reporting = true;

gasv1::ReportRequest request;
Expand Down

0 comments on commit f6dce14

Please sign in to comment.