[alts] Log host and target name on CheckCallHost failure. (#33028)

Having this logging will help debug a current failure.
pull/32015/head^2
Matthew Stevenson 2 years ago committed by GitHub
parent 7f7a524a9a
commit 56938bcc6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      BUILD
  2. 7
      src/core/lib/security/security_connector/alts/alts_security_connector.cc

@ -3156,6 +3156,7 @@ grpc_cc_library(
external_deps = [
"absl/status",
"absl/strings",
"absl/strings:str_format",
"absl/types:optional",
],
language = "c++",

@ -23,9 +23,11 @@
#include <string.h>
#include <algorithm>
#include <initializer_list>
#include <utility>
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
@ -132,8 +134,9 @@ class grpc_alts_channel_security_connector final
grpc_core::ArenaPromise<absl::Status> CheckCallHost(
absl::string_view host, grpc_auth_context*) override {
if (host.empty() || host != target_name_) {
return grpc_core::Immediate(absl::UnauthenticatedError(
"ALTS call host does not match target name"));
return grpc_core::Immediate(absl::UnauthenticatedError(absl::StrFormat(
"ALTS call host [%s] does not match target name [%s].", host,
target_name_)));
}
return grpc_core::ImmediateOkStatus();
}

Loading…
Cancel
Save