Merge pull request #21984 from mhaidrygoog/call_credentials_debug_string

CallCredentials debug string API
pull/22173/head
Moiz Haidry 5 years ago committed by GitHub
commit 0263269e41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      BUILD
  2. 1
      BUILD.gn
  3. 18
      CMakeLists.txt
  4. 55
      Makefile
  5. 1
      build_autogenerated.yaml
  6. 2
      build_config.rb
  7. 2
      build_handwritten.yaml
  8. 17
      config.m4
  9. 19
      config.w32
  10. 1
      gRPC-C++.podspec
  11. 1
      gRPC-Core.podspec
  12. 31
      grpc.gemspec
  13. 1
      grpc.gyp
  14. 4
      include/grpc/grpc_security.h
  15. 7
      include/grpcpp/security/credentials_impl.h
  16. 31
      package.xml
  17. 12
      src/core/lib/security/credentials/composite/composite_credentials.cc
  18. 3
      src/core/lib/security/credentials/composite/composite_credentials.h
  19. 6
      src/core/lib/security/credentials/credentials.h
  20. 4
      src/core/lib/security/credentials/fake/fake_credentials.h
  21. 14
      src/core/lib/security/credentials/iam/iam_credentials.cc
  22. 4
      src/core/lib/security/credentials/iam/iam_credentials.h
  23. 12
      src/core/lib/security/credentials/jwt/jwt_credentials.h
  24. 30
      src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
  25. 7
      src/core/lib/security/credentials/oauth2/oauth2_credentials.h
  26. 13
      src/core/lib/security/credentials/plugin/plugin_credentials.cc
  27. 2
      src/core/lib/security/credentials/plugin/plugin_credentials.h
  28. 2
      src/core/lib/surface/version.cc
  29. 10
      src/cpp/client/secure_credentials.cc
  30. 6
      src/cpp/client/secure_credentials.h
  31. 2
      src/objective-c/tests/version.h
  32. 15
      src/python/grpcio/grpc_core_dependencies.py
  33. 104
      test/core/security/credentials_test.cc
  34. 121
      test/cpp/end2end/end2end_test.cc
  35. 2
      tools/doxygen/Doxyfile.core
  36. 2
      tools/doxygen/Doxyfile.core.internal

@ -77,7 +77,7 @@ python_config_settings()
# This should be updated along with build.yaml # This should be updated along with build.yaml
g_stands_for = "gringotts" g_stands_for = "gringotts"
core_version = "9.0.0" core_version = "10.0.0"
version = "1.29.0-dev" version = "1.29.0-dev"
@ -559,6 +559,7 @@ grpc_cc_library(
"absl/memory", "absl/memory",
"absl/strings", "absl/strings",
"absl/strings:str_format", "absl/strings:str_format",
"absl/time:time",
], ],
language = "c++", language = "c++",
public_hdrs = GPR_PUBLIC_HDRS, public_hdrs = GPR_PUBLIC_HDRS,

@ -170,6 +170,7 @@ config("grpc_config") {
"src/core/lib/profiling/timers.h", "src/core/lib/profiling/timers.h",
] ]
deps = [ deps = [
":absl/time:time",
":absl/strings:strings", ":absl/strings:strings",
":absl/strings:str_format", ":absl/strings:str_format",
":absl/memory:memory", ":absl/memory:memory",

@ -26,8 +26,8 @@ cmake_minimum_required(VERSION 3.5.1)
set(PACKAGE_NAME "grpc") set(PACKAGE_NAME "grpc")
set(PACKAGE_VERSION "1.29.0-dev") set(PACKAGE_VERSION "1.29.0-dev")
set(gRPC_CORE_VERSION "9.0.0") set(gRPC_CORE_VERSION "10.0.0")
set(gRPC_CORE_SOVERSION "9") set(gRPC_CORE_SOVERSION "10")
set(gRPC_CPP_VERSION "1.29.0-dev") set(gRPC_CPP_VERSION "1.29.0-dev")
set(gRPC_CPP_SOVERSION "1") set(gRPC_CPP_SOVERSION "1")
set(gRPC_CSHARP_VERSION "2.29.0-dev") set(gRPC_CSHARP_VERSION "2.29.0-dev")
@ -105,6 +105,7 @@ set(gRPC_ABSL_USED_TARGETS
absl_base absl_base
absl_base_internal absl_base_internal
absl_bits absl_bits
absl_civil_time
absl_compressed_tuple absl_compressed_tuple
absl_config absl_config
absl_core_headers absl_core_headers
@ -125,6 +126,8 @@ set(gRPC_ABSL_USED_TARGETS
absl_strings absl_strings
absl_strings_internal absl_strings_internal
absl_throw_delegate absl_throw_delegate
absl_time
absl_time_zone
absl_type_traits absl_type_traits
absl_utility absl_utility
absl_meta absl_meta
@ -1221,6 +1224,7 @@ target_include_directories(gpr
) )
target_link_libraries(gpr target_link_libraries(gpr
${_gRPC_ALLTARGETS_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES}
absl::time
absl::strings absl::strings
absl::str_format absl::str_format
absl::memory absl::memory
@ -14941,7 +14945,7 @@ generate_pkgconfig(
"gRPC platform support library" "gRPC platform support library"
"${gRPC_CORE_VERSION}" "${gRPC_CORE_VERSION}"
"" ""
"-lgpr -labsl_str_format_internal -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_throw_delegate -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations" "-lgpr -labsl_str_format_internal -labsl_time -labsl_time_zone -labsl_civil_time -labsl_strings -labsl_strings_internal -labsl_throw_delegate -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations"
"" ""
"gpr.pc") "gpr.pc")
@ -14951,7 +14955,7 @@ generate_pkgconfig(
"high performance general RPC framework" "high performance general RPC framework"
"${gRPC_CORE_VERSION}" "${gRPC_CORE_VERSION}"
"gpr openssl" "gpr openssl"
"-lgrpc -laddress_sorting -lupb -lcares -lz -labsl_bad_optional_access -labsl_str_format_internal -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_throw_delegate -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations" "-lgrpc -laddress_sorting -lupb -lcares -lz -labsl_bad_optional_access -labsl_str_format_internal -labsl_time -labsl_time_zone -labsl_civil_time -labsl_strings -labsl_strings_internal -labsl_throw_delegate -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations"
"" ""
"grpc.pc") "grpc.pc")
@ -14961,7 +14965,7 @@ generate_pkgconfig(
"high performance general RPC framework without SSL" "high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}" "${gRPC_CORE_VERSION}"
"gpr" "gpr"
"-lgrpc_unsecure -labsl_bad_optional_access -labsl_str_format_internal -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_throw_delegate -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations" "-lgrpc_unsecure -labsl_bad_optional_access -labsl_str_format_internal -labsl_time -labsl_time_zone -labsl_civil_time -labsl_strings -labsl_strings_internal -labsl_throw_delegate -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations"
"" ""
"grpc_unsecure.pc") "grpc_unsecure.pc")
@ -14971,7 +14975,7 @@ generate_pkgconfig(
"C++ wrapper for gRPC" "C++ wrapper for gRPC"
"${PACKAGE_VERSION}" "${PACKAGE_VERSION}"
"grpc" "grpc"
"-lgrpc++ -labsl_bad_optional_access -labsl_str_format_internal -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_throw_delegate -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations" "-lgrpc++ -labsl_bad_optional_access -labsl_str_format_internal -labsl_time -labsl_time_zone -labsl_civil_time -labsl_strings -labsl_strings_internal -labsl_throw_delegate -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations"
"" ""
"grpc++.pc") "grpc++.pc")
@ -14981,6 +14985,6 @@ generate_pkgconfig(
"C++ wrapper for gRPC without SSL" "C++ wrapper for gRPC without SSL"
"${PACKAGE_VERSION}" "${PACKAGE_VERSION}"
"grpc_unsecure" "grpc_unsecure"
"-lgrpc++_unsecure -labsl_bad_optional_access -labsl_str_format_internal -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_throw_delegate -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations" "-lgrpc++_unsecure -labsl_bad_optional_access -labsl_str_format_internal -labsl_time -labsl_time_zone -labsl_civil_time -labsl_strings -labsl_strings_internal -labsl_throw_delegate -labsl_int128 -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_dynamic_annotations"
"" ""
"grpc++_unsecure.pc") "grpc++_unsecure.pc")

@ -469,7 +469,7 @@ E = @echo
Q = @ Q = @
endif endif
CORE_VERSION = 9.0.0 CORE_VERSION = 10.0.0
CPP_VERSION = 1.29.0-dev CPP_VERSION = 1.29.0-dev
CSHARP_VERSION = 2.29.0-dev CSHARP_VERSION = 2.29.0-dev
@ -519,7 +519,7 @@ SHARED_EXT_CORE = dll
SHARED_EXT_CPP = dll SHARED_EXT_CPP = dll
SHARED_EXT_CSHARP = dll SHARED_EXT_CSHARP = dll
SHARED_PREFIX = SHARED_PREFIX =
SHARED_VERSION_CORE = -9 SHARED_VERSION_CORE = -10
SHARED_VERSION_CPP = -1 SHARED_VERSION_CPP = -1
SHARED_VERSION_CSHARP = -2 SHARED_VERSION_CSHARP = -2
else ifeq ($(SYSTEM),Darwin) else ifeq ($(SYSTEM),Darwin)
@ -3060,7 +3060,7 @@ install-shared_c: shared_c strip-shared_c install-pkg-config_c
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libaddress_sorting.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libaddress_sorting.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so.9 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so.10
$(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -3069,7 +3069,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.9 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.10
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -3078,7 +3078,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.9 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.10
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -3087,7 +3087,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_csharp_ext.so.9 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_csharp_ext.so.10
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_csharp_ext.so $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_csharp_ext.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -3096,7 +3096,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.9 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.10
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -3105,7 +3105,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libupb.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libupb.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libupb.so.9 $(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libupb.so.10
$(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libupb.so $(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libupb.so
endif endif
ifneq ($(SYSTEM),MINGW32) ifneq ($(SYSTEM),MINGW32)
@ -3266,8 +3266,8 @@ $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE):
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.9 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.10 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.9 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.10
$(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -3626,8 +3626,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.9 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.10 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.9 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.10
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -4074,8 +4074,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgpr -laddress_sorting -lupb $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgpr -laddress_sorting -lupb
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.9 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgpr -laddress_sorting -lupb $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.10 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgpr -laddress_sorting -lupb
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.9 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.10
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -4131,8 +4131,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE):
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CSHARP_EXT_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgrpc -lgpr -laddress_sorting -lupb $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CSHARP_EXT_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgrpc -lgpr -laddress_sorting -lupb
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.9 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CSHARP_EXT_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgrpc -lgpr -laddress_sorting -lupb $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.10 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CSHARP_EXT_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgrpc -lgpr -laddress_sorting -lupb
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).so.9 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).so.10
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -4598,8 +4598,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgpr -laddress_sorting -lupb $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgpr -laddress_sorting -lupb
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.9 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgpr -laddress_sorting -lupb $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.10 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) -lgpr -laddress_sorting -lupb
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.9 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.10
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -6161,8 +6161,8 @@ $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBUPB_OB
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libupb.so.9 -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libupb.so.10 -o $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBUPB_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so.9 $(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so.10
$(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)upb$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libupb$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -6325,6 +6325,21 @@ LIBGRPC_ABSEIL_SRC = \
third_party/abseil-cpp/absl/strings/str_split.cc \ third_party/abseil-cpp/absl/strings/str_split.cc \
third_party/abseil-cpp/absl/strings/string_view.cc \ third_party/abseil-cpp/absl/strings/string_view.cc \
third_party/abseil-cpp/absl/strings/substitute.cc \ third_party/abseil-cpp/absl/strings/substitute.cc \
third_party/abseil-cpp/absl/time/civil_time.cc \
third_party/abseil-cpp/absl/time/clock.cc \
third_party/abseil-cpp/absl/time/duration.cc \
third_party/abseil-cpp/absl/time/format.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc \
third_party/abseil-cpp/absl/time/time.cc \
third_party/abseil-cpp/absl/types/bad_optional_access.cc \ third_party/abseil-cpp/absl/types/bad_optional_access.cc \

@ -347,6 +347,7 @@ libs:
- src/core/lib/profiling/basic_timers.cc - src/core/lib/profiling/basic_timers.cc
- src/core/lib/profiling/stap_timers.cc - src/core/lib/profiling/stap_timers.cc
deps: deps:
- absl/time:time
- absl/strings:strings - absl/strings:strings
- absl/strings:str_format - absl/strings:str_format
- absl/memory:memory - absl/memory:memory

@ -13,5 +13,5 @@
# limitations under the License. # limitations under the License.
module GrpcBuildConfig module GrpcBuildConfig
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-9.dll' CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-10.dll'
end end

@ -12,7 +12,7 @@ settings:
'#08': Use "-preN" suffixes to identify pre-release versions '#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here '#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here '#10': See the expand_version.py for all the quirks here
core_version: 9.0.0 core_version: 10.0.0
csharp_major_version: 2 csharp_major_version: 2
g_stands_for: gringotts g_stands_for: gringotts
version: 1.29.0-dev version: 1.29.0-dev

@ -503,6 +503,21 @@ if test "$PHP_GRPC" != "no"; then
third_party/abseil-cpp/absl/strings/str_split.cc \ third_party/abseil-cpp/absl/strings/str_split.cc \
third_party/abseil-cpp/absl/strings/string_view.cc \ third_party/abseil-cpp/absl/strings/string_view.cc \
third_party/abseil-cpp/absl/strings/substitute.cc \ third_party/abseil-cpp/absl/strings/substitute.cc \
third_party/abseil-cpp/absl/time/civil_time.cc \
third_party/abseil-cpp/absl/time/clock.cc \
third_party/abseil-cpp/absl/time/duration.cc \
third_party/abseil-cpp/absl/time/format.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc \
third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc \
third_party/abseil-cpp/absl/time/time.cc \
third_party/abseil-cpp/absl/types/bad_optional_access.cc \ third_party/abseil-cpp/absl/types/bad_optional_access.cc \
third_party/address_sorting/address_sorting.c \ third_party/address_sorting/address_sorting.c \
third_party/address_sorting/address_sorting_posix.c \ third_party/address_sorting/address_sorting_posix.c \
@ -889,6 +904,8 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/strings) PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/strings)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/strings/internal) PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/strings/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/strings/internal/str_format) PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/strings/internal/str_format)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/time)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/time/internal/cctz/src)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/types) PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/types)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/address_sorting) PHP_ADD_BUILD_DIR($ext_builddir/third_party/address_sorting)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel)

@ -472,6 +472,21 @@ if (PHP_GRPC != "no") {
"third_party\\abseil-cpp\\absl\\strings\\str_split.cc " + "third_party\\abseil-cpp\\absl\\strings\\str_split.cc " +
"third_party\\abseil-cpp\\absl\\strings\\string_view.cc " + "third_party\\abseil-cpp\\absl\\strings\\string_view.cc " +
"third_party\\abseil-cpp\\absl\\strings\\substitute.cc " + "third_party\\abseil-cpp\\absl\\strings\\substitute.cc " +
"third_party\\abseil-cpp\\absl\\time\\civil_time.cc " +
"third_party\\abseil-cpp\\absl\\time\\clock.cc " +
"third_party\\abseil-cpp\\absl\\time\\duration.cc " +
"third_party\\abseil-cpp\\absl\\time\\format.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\civil_time_detail.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\time_zone_fixed.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\time_zone_format.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\time_zone_if.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\time_zone_impl.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\time_zone_info.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\time_zone_libc.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\time_zone_lookup.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\time_zone_posix.cc " +
"third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src\\zone_info_source.cc " +
"third_party\\abseil-cpp\\absl\\time\\time.cc " +
"third_party\\abseil-cpp\\absl\\types\\bad_optional_access.cc " + "third_party\\abseil-cpp\\absl\\types\\bad_optional_access.cc " +
"third_party\\address_sorting\\address_sorting.c " + "third_party\\address_sorting\\address_sorting.c " +
"third_party\\address_sorting\\address_sorting_posix.c " + "third_party\\address_sorting\\address_sorting_posix.c " +
@ -923,6 +938,10 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\strings"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\strings");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\strings\\internal"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\strings\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\strings\\internal\\str_format"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\strings\\internal\\str_format");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\time");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\time\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\time\\internal\\cctz");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\time\\internal\\cctz\\src");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\types"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\types");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\address_sorting"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\address_sorting");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel");

@ -219,6 +219,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/memory/memory', abseil_version ss.dependency 'abseil/memory/memory', abseil_version
ss.dependency 'abseil/strings/str_format', abseil_version ss.dependency 'abseil/strings/str_format', abseil_version
ss.dependency 'abseil/strings/strings', abseil_version ss.dependency 'abseil/strings/strings', abseil_version
ss.dependency 'abseil/time/time', abseil_version
ss.dependency 'abseil/types/optional', abseil_version ss.dependency 'abseil/types/optional', abseil_version
ss.source_files = 'src/core/ext/filters/client_channel/backend_metric.h', ss.source_files = 'src/core/ext/filters/client_channel/backend_metric.h',

@ -178,6 +178,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/memory/memory', abseil_version ss.dependency 'abseil/memory/memory', abseil_version
ss.dependency 'abseil/strings/str_format', abseil_version ss.dependency 'abseil/strings/str_format', abseil_version
ss.dependency 'abseil/strings/strings', abseil_version ss.dependency 'abseil/strings/strings', abseil_version
ss.dependency 'abseil/time/time', abseil_version
ss.dependency 'abseil/types/optional', abseil_version ss.dependency 'abseil/types/optional', abseil_version
ss.compiler_flags = '-DGRPC_SHADOW_BORINGSSL_SYMBOLS' ss.compiler_flags = '-DGRPC_SHADOW_BORINGSSL_SYMBOLS'

@ -1006,6 +1006,37 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/strings/strip.h ) s.files += %w( third_party/abseil-cpp/absl/strings/strip.h )
s.files += %w( third_party/abseil-cpp/absl/strings/substitute.cc ) s.files += %w( third_party/abseil-cpp/absl/strings/substitute.cc )
s.files += %w( third_party/abseil-cpp/absl/strings/substitute.h ) s.files += %w( third_party/abseil-cpp/absl/strings/substitute.h )
s.files += %w( third_party/abseil-cpp/absl/time/civil_time.cc )
s.files += %w( third_party/abseil-cpp/absl/time/civil_time.h )
s.files += %w( third_party/abseil-cpp/absl/time/clock.cc )
s.files += %w( third_party/abseil-cpp/absl/time/clock.h )
s.files += %w( third_party/abseil-cpp/absl/time/duration.cc )
s.files += %w( third_party/abseil-cpp/absl/time/format.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/zone_info_source.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h )
s.files += %w( third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/get_current_time_chrono.inc )
s.files += %w( third_party/abseil-cpp/absl/time/internal/get_current_time_posix.inc )
s.files += %w( third_party/abseil-cpp/absl/time/time.cc )
s.files += %w( third_party/abseil-cpp/absl/time/time.h )
s.files += %w( third_party/abseil-cpp/absl/types/bad_optional_access.cc ) s.files += %w( third_party/abseil-cpp/absl/types/bad_optional_access.cc )
s.files += %w( third_party/abseil-cpp/absl/types/bad_optional_access.h ) s.files += %w( third_party/abseil-cpp/absl/types/bad_optional_access.h )
s.files += %w( third_party/abseil-cpp/absl/types/internal/optional.h ) s.files += %w( third_party/abseil-cpp/absl/types/internal/optional.h )

@ -369,6 +369,7 @@
'target_name': 'gpr', 'target_name': 'gpr',
'type': 'static_library', 'type': 'static_library',
'dependencies': [ 'dependencies': [
'absl/time:time',
'absl/strings:strings', 'absl/strings:strings',
'absl/strings:str_format', 'absl/strings:str_format',
'absl/memory:memory', 'absl/memory:memory',

@ -425,6 +425,10 @@ typedef struct {
size_t* num_creds_md, grpc_status_code* status, size_t* num_creds_md, grpc_status_code* status,
const char** error_details); const char** error_details);
/** Implements debug string of the given plugin. This method returns an
* allocated string that the caller needs to free using gpr_free() */
char* (*debug_string)(void* state);
/** Destroys the plugin state. */ /** Destroys the plugin state. */
void (*destroy)(void* state); void (*destroy)(void* state);

@ -115,6 +115,9 @@ class CallCredentials : private grpc::GrpcLibraryCodegen {
/// Apply this instance's credentials to \a call. /// Apply this instance's credentials to \a call.
virtual bool ApplyToCall(grpc_call* call) = 0; virtual bool ApplyToCall(grpc_call* call) = 0;
virtual grpc::string DebugString() {
return "CallCredentials did not provide a debug string";
}
protected: protected:
friend std::shared_ptr<ChannelCredentials> CompositeChannelCredentials( friend std::shared_ptr<ChannelCredentials> CompositeChannelCredentials(
@ -250,6 +253,10 @@ class MetadataCredentialsPlugin {
grpc::string_ref service_url, grpc::string_ref method_name, grpc::string_ref service_url, grpc::string_ref method_name,
const grpc::AuthContext& channel_auth_context, const grpc::AuthContext& channel_auth_context,
std::multimap<grpc::string, grpc::string>* metadata) = 0; std::multimap<grpc::string, grpc::string>* metadata) = 0;
virtual grpc::string DebugString() {
return "MetadataCredentialsPlugin did not provide a debug string";
}
}; };
std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin( std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(

@ -1008,6 +1008,37 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/strip.h" role="src" /> <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/strip.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/substitute.cc" role="src" /> <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/substitute.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/substitute.h" role="src" /> <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/substitute.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/civil_time.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/civil_time.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/clock.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/clock.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/duration.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/format.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/zone_info_source.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/get_current_time_chrono.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/internal/get_current_time_posix.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/time.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/time/time.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/types/bad_optional_access.cc" role="src" /> <file baseinstalldir="/" name="third_party/abseil-cpp/absl/types/bad_optional_access.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/types/bad_optional_access.h" role="src" /> <file baseinstalldir="/" name="third_party/abseil-cpp/absl/types/bad_optional_access.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/types/internal/optional.h" role="src" /> <file baseinstalldir="/" name="third_party/abseil-cpp/absl/types/internal/optional.h" role="src" />

@ -22,7 +22,10 @@
#include <cstring> #include <cstring>
#include <new> #include <new>
#include <vector>
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/api_trace.h"
@ -116,6 +119,15 @@ void grpc_composite_call_credentials::cancel_get_request_metadata(
GRPC_ERROR_UNREF(error); GRPC_ERROR_UNREF(error);
} }
std::string grpc_composite_call_credentials::debug_string() {
std::vector<std::string> outputs;
for (auto& inner_cred : inner_) {
outputs.emplace_back(inner_cred->debug_string());
}
return absl::StrCat("CompositeCallCredentials{", absl::StrJoin(outputs, ","),
"}");
}
static size_t get_creds_array_size(const grpc_call_credentials* creds, static size_t get_creds_array_size(const grpc_call_credentials* creds,
bool is_composite) { bool is_composite) {
return is_composite return is_composite

@ -21,6 +21,8 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <string>
#include "src/core/lib/gprpp/inlined_vector.h" #include "src/core/lib/gprpp/inlined_vector.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/credentials.h"
@ -91,6 +93,7 @@ class grpc_composite_call_credentials : public grpc_call_credentials {
} }
const CallCredentialsList& inner() const { return inner_; } const CallCredentialsList& inner() const { return inner_; }
std::string debug_string() override;
private: private:
void push_to_inner(grpc_core::RefCountedPtr<grpc_call_credentials> creds, void push_to_inner(grpc_core::RefCountedPtr<grpc_call_credentials> creds,

@ -21,6 +21,8 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <string.h>
#include <grpc/grpc.h> #include <grpc/grpc.h>
#include <grpc/grpc_security.h> #include <grpc/grpc_security.h>
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
@ -252,6 +254,10 @@ struct grpc_call_credentials
return min_security_level_; return min_security_level_;
} }
virtual std::string debug_string() {
return "grpc_call_credentials did not provide debug string";
}
const char* type() const { return type_; } const char* type() const { return type_; }
private: private:

@ -21,6 +21,8 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <string.h>
#include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/credentials.h"
#define GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS \ #define GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS \
@ -75,6 +77,8 @@ class grpc_md_only_test_credentials : public grpc_call_credentials {
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array, void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
grpc_error* error) override; grpc_error* error) override;
std::string debug_string() override { return "MD only Test Credentials"; };
private: private:
grpc_mdelem md_; grpc_mdelem md_;
bool is_async_; bool is_async_;

@ -20,16 +20,15 @@
#include "src/core/lib/security/credentials/iam/iam_credentials.h" #include "src/core/lib/security/credentials/iam/iam_credentials.h"
#include <string.h>
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/surface/api_trace.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include "absl/strings/str_format.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/surface/api_trace.h"
grpc_google_iam_credentials::~grpc_google_iam_credentials() { grpc_google_iam_credentials::~grpc_google_iam_credentials() {
grpc_credentials_mdelem_array_destroy(&md_array_); grpc_credentials_mdelem_array_destroy(&md_array_);
} }
@ -49,7 +48,10 @@ void grpc_google_iam_credentials::cancel_get_request_metadata(
grpc_google_iam_credentials::grpc_google_iam_credentials( grpc_google_iam_credentials::grpc_google_iam_credentials(
const char* token, const char* authority_selector) const char* token, const char* authority_selector)
: grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_IAM) { : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_IAM),
debug_string_(absl::StrFormat(
"GoogleIAMCredentials{Token:%s,AuthoritySelector:%s}",
token != nullptr ? "present" : "absent", authority_selector)) {
grpc_mdelem md = grpc_mdelem_from_slices( grpc_mdelem md = grpc_mdelem_from_slices(
grpc_slice_from_static_string(GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY), grpc_slice_from_static_string(GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY),
grpc_slice_from_copied_string(token)); grpc_slice_from_copied_string(token));

@ -21,6 +21,8 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <string>
#include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/credentials.h"
class grpc_google_iam_credentials : public grpc_call_credentials { class grpc_google_iam_credentials : public grpc_call_credentials {
@ -37,9 +39,11 @@ class grpc_google_iam_credentials : public grpc_call_credentials {
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array, void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
grpc_error* error) override; grpc_error* error) override;
std::string debug_string() override { return debug_string_; }
private: private:
grpc_credentials_mdelem_array md_array_; grpc_credentials_mdelem_array md_array_;
const std::string debug_string_;
}; };
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_IAM_IAM_CREDENTIALS_H */ #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_IAM_IAM_CREDENTIALS_H */

@ -21,6 +21,12 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <string>
#include <grpc/support/time.h>
#include "absl/strings/str_format.h"
#include "absl/time/time.h"
#include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/jwt/json_token.h" #include "src/core/lib/security/credentials/jwt/json_token.h"
@ -43,6 +49,12 @@ class grpc_service_account_jwt_access_credentials
const gpr_timespec& jwt_lifetime() const { return jwt_lifetime_; } const gpr_timespec& jwt_lifetime() const { return jwt_lifetime_; }
const grpc_auth_json_key& key() const { return key_; } const grpc_auth_json_key& key() const { return key_; }
std::string debug_string() override {
return absl::StrFormat("JWTAccessCredentials{ExpirationTime:%s}",
absl::FormatTime(absl::FromUnixMicros(
gpr_timespec_to_micros(jwt_lifetime_))));
};
private: private:
void reset_cache(); void reset_cache();

@ -30,6 +30,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "absl/strings/str_format.h"
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/inlined_vector.h" #include "src/core/lib/gprpp/inlined_vector.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -358,6 +359,10 @@ grpc_oauth2_token_fetcher_credentials::grpc_oauth2_token_fetcher_credentials()
grpc_httpcli_context_init(&httpcli_context_); grpc_httpcli_context_init(&httpcli_context_);
} }
std::string grpc_oauth2_token_fetcher_credentials::debug_string() {
return "OAuth2TokenFetcherCredentials";
}
// //
// Google Compute Engine credentials. // Google Compute Engine credentials.
// //
@ -396,6 +401,12 @@ class grpc_compute_engine_token_fetcher_credentials
grpc_resource_quota_unref_internal(resource_quota); grpc_resource_quota_unref_internal(resource_quota);
} }
std::string debug_string() override {
return absl::StrFormat(
"GoogleComputeEngineTokenFetcherCredentials{%s}",
grpc_oauth2_token_fetcher_credentials::debug_string());
}
private: private:
grpc_closure http_get_cb_closure_; grpc_closure http_get_cb_closure_;
}; };
@ -468,6 +479,12 @@ grpc_refresh_token_credentials_create_from_auth_refresh_token(
refresh_token); refresh_token);
} }
std::string grpc_google_refresh_token_credentials::debug_string() {
return absl::StrFormat("GoogleRefreshToken{ClientID:%s,%s}",
refresh_token_.client_id,
grpc_oauth2_token_fetcher_credentials::debug_string());
}
static char* create_loggable_refresh_token(grpc_auth_refresh_token* token) { static char* create_loggable_refresh_token(grpc_auth_refresh_token* token) {
if (strcmp(token->type, GRPC_AUTH_JSON_TYPE_INVALID) == 0) { if (strcmp(token->type, GRPC_AUTH_JSON_TYPE_INVALID) == 0) {
return gpr_strdup("<Invalid json token>"); return gpr_strdup("<Invalid json token>");
@ -540,6 +557,13 @@ class StsTokenFetcherCredentials
~StsTokenFetcherCredentials() override { grpc_uri_destroy(sts_url_); } ~StsTokenFetcherCredentials() override { grpc_uri_destroy(sts_url_); }
std::string debug_string() override {
return absl::StrFormat(
"StsTokenFetcherCredentials{Path:%s,Authority:%s,%s}", sts_url_->path,
sts_url_->authority,
grpc_oauth2_token_fetcher_credentials::debug_string());
}
private: private:
void fetch_oauth2(grpc_credentials_metadata_request* metadata_req, void fetch_oauth2(grpc_credentials_metadata_request* metadata_req,
grpc_httpcli_context* http_context, grpc_httpcli_context* http_context,
@ -731,6 +755,12 @@ grpc_access_token_credentials::grpc_access_token_credentials(
gpr_free(token_md_value); gpr_free(token_md_value);
} }
std::string grpc_access_token_credentials::debug_string() {
bool access_token_present = !GRPC_MDISNULL(access_token_md_);
return absl::StrFormat("AccessTokenCredentials{Token:%s}",
access_token_present ? "present" : "absent");
}
grpc_call_credentials* grpc_access_token_credentials_create( grpc_call_credentials* grpc_access_token_credentials_create(
const char* access_token, void* reserved) { const char* access_token, void* reserved) {
GRPC_API_TRACE( GRPC_API_TRACE(

@ -21,6 +21,8 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <string>
#include <grpc/grpc_security.h> #include <grpc/grpc_security.h>
#include "src/core/lib/json/json.h" #include "src/core/lib/json/json.h"
#include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/credentials.h"
@ -84,6 +86,7 @@ class grpc_oauth2_token_fetcher_credentials : public grpc_call_credentials {
void on_http_response(grpc_credentials_metadata_request* r, void on_http_response(grpc_credentials_metadata_request* r,
grpc_error* error); grpc_error* error);
std::string debug_string() override;
protected: protected:
virtual void fetch_oauth2(grpc_credentials_metadata_request* req, virtual void fetch_oauth2(grpc_credentials_metadata_request* req,
@ -112,6 +115,8 @@ class grpc_google_refresh_token_credentials final
return refresh_token_; return refresh_token_;
} }
std::string debug_string() override;
protected: protected:
void fetch_oauth2(grpc_credentials_metadata_request* req, void fetch_oauth2(grpc_credentials_metadata_request* req,
grpc_httpcli_context* httpcli_context, grpc_httpcli_context* httpcli_context,
@ -138,6 +143,8 @@ class grpc_access_token_credentials final : public grpc_call_credentials {
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array, void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
grpc_error* error) override; grpc_error* error) override;
std::string debug_string() override;
private: private:
grpc_mdelem access_token_md_; grpc_mdelem access_token_md_;
}; };

@ -42,6 +42,19 @@ grpc_plugin_credentials::~grpc_plugin_credentials() {
} }
} }
std::string grpc_plugin_credentials::debug_string() {
char* debug_c_str = nullptr;
if (plugin_.debug_string != nullptr) {
debug_c_str = plugin_.debug_string(plugin_.state);
}
std::string debug_str(
debug_c_str != nullptr
? debug_c_str
: "grpc_plugin_credentials did not provide a debug string");
gpr_free(debug_c_str);
return debug_str;
}
void grpc_plugin_credentials::pending_request_remove_locked( void grpc_plugin_credentials::pending_request_remove_locked(
pending_request* pending_request) { pending_request* pending_request) {
if (pending_request->prev == nullptr) { if (pending_request->prev == nullptr) {

@ -59,6 +59,8 @@ struct grpc_plugin_credentials final : public grpc_call_credentials {
// cancelled before completion. // cancelled before completion.
void pending_request_complete(pending_request* r); void pending_request_complete(pending_request* r);
std::string debug_string() override;
private: private:
void pending_request_remove_locked(pending_request* pending_request); void pending_request_remove_locked(pending_request* pending_request);

@ -23,6 +23,6 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
const char* grpc_version_string(void) { return "9.0.0"; } const char* grpc_version_string(void) { return "10.0.0"; }
const char* grpc_g_stands_for(void) { return "gringotts"; } const char* grpc_g_stands_for(void) { return "gringotts"; }

@ -20,6 +20,7 @@
#include <grpc/impl/codegen/slice.h> #include <grpc/impl/codegen/slice.h>
#include <grpc/slice.h> #include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include <grpcpp/channel.h> #include <grpcpp/channel.h>
@ -257,6 +258,7 @@ std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
new grpc::MetadataCredentialsPluginWrapper(std::move(plugin)); new grpc::MetadataCredentialsPluginWrapper(std::move(plugin));
grpc_metadata_credentials_plugin c_plugin = { grpc_metadata_credentials_plugin c_plugin = {
grpc::MetadataCredentialsPluginWrapper::GetMetadata, grpc::MetadataCredentialsPluginWrapper::GetMetadata,
grpc::MetadataCredentialsPluginWrapper::DebugString,
grpc::MetadataCredentialsPluginWrapper::Destroy, wrapper, type}; grpc::MetadataCredentialsPluginWrapper::Destroy, wrapper, type};
return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin( return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin(
c_plugin, min_security_level, nullptr)); c_plugin, min_security_level, nullptr));
@ -379,6 +381,7 @@ std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
new grpc::MetadataCredentialsPluginWrapper(std::move(plugin)); new grpc::MetadataCredentialsPluginWrapper(std::move(plugin));
grpc_metadata_credentials_plugin c_plugin = { grpc_metadata_credentials_plugin c_plugin = {
grpc::MetadataCredentialsPluginWrapper::GetMetadata, grpc::MetadataCredentialsPluginWrapper::GetMetadata,
grpc::MetadataCredentialsPluginWrapper::DebugString,
grpc::MetadataCredentialsPluginWrapper::Destroy, wrapper, type}; grpc::MetadataCredentialsPluginWrapper::Destroy, wrapper, type};
return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin( return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin(
c_plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr)); c_plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr));
@ -395,6 +398,13 @@ void DeleteWrapper(void* wrapper, grpc_error* /*ignored*/) {
} }
} // namespace } // namespace
char* MetadataCredentialsPluginWrapper::DebugString(void* wrapper) {
GPR_ASSERT(wrapper);
MetadataCredentialsPluginWrapper* w =
static_cast<MetadataCredentialsPluginWrapper*>(wrapper);
return gpr_strdup(w->plugin_->DebugString().c_str());
}
void MetadataCredentialsPluginWrapper::Destroy(void* wrapper) { void MetadataCredentialsPluginWrapper::Destroy(void* wrapper) {
if (wrapper == nullptr) return; if (wrapper == nullptr) return;
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;

@ -26,6 +26,7 @@
#include <grpcpp/security/tls_credentials_options.h> #include <grpcpp/security/tls_credentials_options.h>
#include <grpcpp/support/config.h> #include <grpcpp/support/config.h>
#include "absl/strings/str_cat.h"
#include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/credentials.h"
#include "src/cpp/server/thread_pool_interface.h" #include "src/cpp/server/thread_pool_interface.h"
@ -65,6 +66,10 @@ class SecureCallCredentials final : public CallCredentials {
bool ApplyToCall(grpc_call* call) override; bool ApplyToCall(grpc_call* call) override;
SecureCallCredentials* AsSecureCredentials() override { return this; } SecureCallCredentials* AsSecureCredentials() override { return this; }
grpc::string DebugString() override {
return absl::StrCat("SecureCallCredentials{",
grpc::string(c_creds_->debug_string()), "}");
}
private: private:
grpc_call_credentials* const c_creds_; grpc_call_credentials* const c_creds_;
@ -93,6 +98,7 @@ class MetadataCredentialsPluginWrapper final : private GrpcLibraryCodegen {
grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX], grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
size_t* num_creds_md, grpc_status_code* status, size_t* num_creds_md, grpc_status_code* status,
const char** error_details); const char** error_details);
static char* DebugString(void* wrapper);
explicit MetadataCredentialsPluginWrapper( explicit MetadataCredentialsPluginWrapper(
std::unique_ptr<MetadataCredentialsPlugin> plugin); std::unique_ptr<MetadataCredentialsPlugin> plugin);

@ -23,4 +23,4 @@
// `tools/buildgen/generate_projects.sh`. // `tools/buildgen/generate_projects.sh`.
#define GRPC_OBJC_VERSION_STRING @"1.29.0-dev" #define GRPC_OBJC_VERSION_STRING @"1.29.0-dev"
#define GRPC_C_VERSION_STRING @"9.0.0" #define GRPC_C_VERSION_STRING @"10.0.0"

@ -471,6 +471,21 @@ CORE_SOURCE_FILES = [
'third_party/abseil-cpp/absl/strings/str_split.cc', 'third_party/abseil-cpp/absl/strings/str_split.cc',
'third_party/abseil-cpp/absl/strings/string_view.cc', 'third_party/abseil-cpp/absl/strings/string_view.cc',
'third_party/abseil-cpp/absl/strings/substitute.cc', 'third_party/abseil-cpp/absl/strings/substitute.cc',
'third_party/abseil-cpp/absl/time/civil_time.cc',
'third_party/abseil-cpp/absl/time/clock.cc',
'third_party/abseil-cpp/absl/time/duration.cc',
'third_party/abseil-cpp/absl/time/format.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_detail.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.cc',
'third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc',
'third_party/abseil-cpp/absl/time/time.cc',
'third_party/abseil-cpp/absl/types/bad_optional_access.cc', 'third_party/abseil-cpp/absl/types/bad_optional_access.cc',
'third_party/address_sorting/address_sorting.c', 'third_party/address_sorting/address_sorting.c',
'third_party/address_sorting/address_sorting_posix.c', 'third_party/address_sorting/address_sorting_posix.c',

@ -613,6 +613,9 @@ static void test_compute_engine_creds_success() {
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
expected_md emd[] = { expected_md emd[] = {
{"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}}; {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
const char expected_creds_debug_string[] =
"GoogleComputeEngineTokenFetcherCredentials{"
"OAuth2TokenFetcherCredentials}";
grpc_call_credentials* creds = grpc_call_credentials* creds =
grpc_google_compute_engine_credentials_create(nullptr); grpc_google_compute_engine_credentials_create(nullptr);
grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
@ -636,12 +639,17 @@ static void test_compute_engine_creds_success() {
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
grpc_core::ExecCtx::Get()->Flush(); grpc_core::ExecCtx::Get()->Flush();
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
grpc_httpcli_set_override(nullptr, nullptr); grpc_httpcli_set_override(nullptr, nullptr);
} }
static void test_compute_engine_creds_failure(void) { static void test_compute_engine_creds_failure(void) {
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
const char expected_creds_debug_string[] =
"GoogleComputeEngineTokenFetcherCredentials{"
"OAuth2TokenFetcherCredentials}";
request_metadata_state* state = make_request_metadata_state( request_metadata_state* state = make_request_metadata_state(
GRPC_ERROR_CREATE_FROM_STATIC_STRING( GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token."), "Error occurred when fetching oauth2 token."),
@ -653,6 +661,8 @@ static void test_compute_engine_creds_failure(void) {
grpc_httpcli_set_override(compute_engine_httpcli_get_failure_override, grpc_httpcli_set_override(compute_engine_httpcli_get_failure_override,
httpcli_post_should_not_be_called); httpcli_post_should_not_be_called);
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
grpc_httpcli_set_override(nullptr, nullptr); grpc_httpcli_set_override(nullptr, nullptr);
} }
@ -705,6 +715,9 @@ static void test_refresh_token_creds_success(void) {
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
expected_md emd[] = { expected_md emd[] = {
{"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}}; {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
const char expected_creds_debug_string[] =
"GoogleRefreshToken{ClientID:32555999999.apps.googleusercontent.com,"
"OAuth2TokenFetcherCredentials}";
grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
nullptr, nullptr}; nullptr, nullptr};
grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create( grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create(
@ -728,6 +741,8 @@ static void test_refresh_token_creds_success(void) {
httpcli_post_should_not_be_called); httpcli_post_should_not_be_called);
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
grpc_core::ExecCtx::Get()->Flush(); grpc_core::ExecCtx::Get()->Flush();
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
grpc_httpcli_set_override(nullptr, nullptr); grpc_httpcli_set_override(nullptr, nullptr);
@ -735,6 +750,9 @@ static void test_refresh_token_creds_success(void) {
static void test_refresh_token_creds_failure(void) { static void test_refresh_token_creds_failure(void) {
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
const char expected_creds_debug_string[] =
"GoogleRefreshToken{ClientID:32555999999.apps.googleusercontent.com,"
"OAuth2TokenFetcherCredentials}";
request_metadata_state* state = make_request_metadata_state( request_metadata_state* state = make_request_metadata_state(
GRPC_ERROR_CREATE_FROM_STATIC_STRING( GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token."), "Error occurred when fetching oauth2 token."),
@ -746,6 +764,9 @@ static void test_refresh_token_creds_failure(void) {
grpc_httpcli_set_override(httpcli_get_should_not_be_called, grpc_httpcli_set_override(httpcli_get_should_not_be_called,
token_httpcli_post_failure); token_httpcli_post_failure);
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
grpc_httpcli_set_override(nullptr, nullptr); grpc_httpcli_set_override(nullptr, nullptr);
} }
@ -939,6 +960,9 @@ static void test_sts_creds_success(void) {
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
expected_md emd[] = { expected_md emd[] = {
{"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}}; {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
const char expected_creds_debug_string[] =
"StsTokenFetcherCredentials{Path:/v1/"
"token-exchange,Authority:foo.com:5555,OAuth2TokenFetcherCredentials}";
grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
nullptr, nullptr}; nullptr, nullptr};
char* subject_token_path = write_tmp_jwt_file(test_signed_jwt); char* subject_token_path = write_tmp_jwt_file(test_signed_jwt);
@ -975,6 +999,8 @@ static void test_sts_creds_success(void) {
httpcli_post_should_not_be_called); httpcli_post_should_not_be_called);
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
grpc_core::ExecCtx::Get()->Flush(); grpc_core::ExecCtx::Get()->Flush();
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
grpc_httpcli_set_override(nullptr, nullptr); grpc_httpcli_set_override(nullptr, nullptr);
@ -1021,6 +1047,9 @@ static void test_sts_creds_no_actor_token_success(void) {
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
expected_md emd[] = { expected_md emd[] = {
{"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}}; {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
const char expected_creds_debug_string[] =
"StsTokenFetcherCredentials{Path:/v1/"
"token-exchange,Authority:foo.com:5555,OAuth2TokenFetcherCredentials}";
grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
nullptr, nullptr}; nullptr, nullptr};
char* subject_token_path = write_tmp_jwt_file(test_signed_jwt); char* subject_token_path = write_tmp_jwt_file(test_signed_jwt);
@ -1056,6 +1085,8 @@ static void test_sts_creds_no_actor_token_success(void) {
httpcli_post_should_not_be_called); httpcli_post_should_not_be_called);
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
grpc_core::ExecCtx::Get()->Flush(); grpc_core::ExecCtx::Get()->Flush();
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
grpc_httpcli_set_override(nullptr, nullptr); grpc_httpcli_set_override(nullptr, nullptr);
@ -1063,6 +1094,9 @@ static void test_sts_creds_no_actor_token_success(void) {
} }
static void test_sts_creds_load_token_failure(void) { static void test_sts_creds_load_token_failure(void) {
const char expected_creds_debug_string[] =
"StsTokenFetcherCredentials{Path:/v1/"
"token-exchange,Authority:foo.com:5555,OAuth2TokenFetcherCredentials}";
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
request_metadata_state* state = make_request_metadata_state( request_metadata_state* state = make_request_metadata_state(
GRPC_ERROR_CREATE_FROM_STATIC_STRING( GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@ -1086,12 +1120,18 @@ static void test_sts_creds_load_token_failure(void) {
grpc_httpcli_set_override(httpcli_get_should_not_be_called, grpc_httpcli_set_override(httpcli_get_should_not_be_called,
httpcli_post_should_not_be_called); httpcli_post_should_not_be_called);
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
grpc_httpcli_set_override(nullptr, nullptr); grpc_httpcli_set_override(nullptr, nullptr);
gpr_free(test_signed_jwt_path); gpr_free(test_signed_jwt_path);
} }
static void test_sts_creds_http_failure(void) { static void test_sts_creds_http_failure(void) {
const char expected_creds_debug_string[] =
"StsTokenFetcherCredentials{Path:/v1/"
"token-exchange,Authority:foo.com:5555,OAuth2TokenFetcherCredentials}";
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
request_metadata_state* state = make_request_metadata_state( request_metadata_state* state = make_request_metadata_state(
GRPC_ERROR_CREATE_FROM_STATIC_STRING( GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@ -1116,6 +1156,8 @@ static void test_sts_creds_http_failure(void) {
grpc_httpcli_set_override(httpcli_get_should_not_be_called, grpc_httpcli_set_override(httpcli_get_should_not_be_called,
token_httpcli_post_failure); token_httpcli_post_failure);
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
grpc_httpcli_set_override(nullptr, nullptr); grpc_httpcli_set_override(nullptr, nullptr);
gpr_free(test_signed_jwt_path); gpr_free(test_signed_jwt_path);
@ -1141,7 +1183,7 @@ static void validate_jwt_encode_and_sign_params(
"777-abaslkan11hlb6nmim3bpspl31ud@developer." "777-abaslkan11hlb6nmim3bpspl31ud@developer."
"gserviceaccount.com") == 0); "gserviceaccount.com") == 0);
if (scope != nullptr) GPR_ASSERT(strcmp(scope, test_scope) == 0); if (scope != nullptr) GPR_ASSERT(strcmp(scope, test_scope) == 0);
GPR_ASSERT(!gpr_time_cmp(token_lifetime, grpc_max_auth_token_lifetime())); GPR_ASSERT(gpr_time_cmp(token_lifetime, grpc_max_auth_token_lifetime()) == 0);
} }
static char* encode_and_sign_jwt_success(const grpc_auth_json_key* json_key, static char* encode_and_sign_jwt_success(const grpc_auth_json_key* json_key,
@ -1176,7 +1218,8 @@ static grpc_service_account_jwt_access_credentials* creds_as_jwt(
static void test_jwt_creds_lifetime(void) { static void test_jwt_creds_lifetime(void) {
char* json_key_string = test_json_key_str(); char* json_key_string = test_json_key_str();
const char expected_creds_debug_string_prefix[] =
"JWTAccessCredentials{ExpirationTime:";
// Max lifetime. // Max lifetime.
grpc_call_credentials* jwt_creds = grpc_call_credentials* jwt_creds =
grpc_service_account_jwt_access_credentials_create( grpc_service_account_jwt_access_credentials_create(
@ -1185,6 +1228,9 @@ static void test_jwt_creds_lifetime(void) {
grpc_max_auth_token_lifetime()) == 0); grpc_max_auth_token_lifetime()) == 0);
/* Check security level. */ /* Check security level. */
GPR_ASSERT(jwt_creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); GPR_ASSERT(jwt_creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
GPR_ASSERT(strncmp(expected_creds_debug_string_prefix,
jwt_creds->debug_string().c_str(),
strlen(expected_creds_debug_string_prefix)) == 0);
grpc_call_credentials_release(jwt_creds); grpc_call_credentials_release(jwt_creds);
// Shorter lifetime. // Shorter lifetime.
@ -1194,6 +1240,9 @@ static void test_jwt_creds_lifetime(void) {
json_key_string, token_lifetime, nullptr); json_key_string, token_lifetime, nullptr);
GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime(), GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime(),
token_lifetime) == 0); token_lifetime) == 0);
GPR_ASSERT(strncmp(expected_creds_debug_string_prefix,
jwt_creds->debug_string().c_str(),
strlen(expected_creds_debug_string_prefix)) == 0);
grpc_call_credentials_release(jwt_creds); grpc_call_credentials_release(jwt_creds);
// Cropped lifetime. // Cropped lifetime.
@ -1203,12 +1252,18 @@ static void test_jwt_creds_lifetime(void) {
json_key_string, token_lifetime, nullptr); json_key_string, token_lifetime, nullptr);
GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime(), GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime(),
grpc_max_auth_token_lifetime()) == 0); grpc_max_auth_token_lifetime()) == 0);
GPR_ASSERT(strncmp(expected_creds_debug_string_prefix,
jwt_creds->debug_string().c_str(),
strlen(expected_creds_debug_string_prefix)) == 0);
grpc_call_credentials_release(jwt_creds); grpc_call_credentials_release(jwt_creds);
gpr_free(json_key_string); gpr_free(json_key_string);
} }
static void test_jwt_creds_success(void) { static void test_jwt_creds_success(void) {
const char expected_creds_debug_string_prefix[] =
"JWTAccessCredentials{ExpirationTime:";
char* json_key_string = test_json_key_str(); char* json_key_string = test_json_key_str();
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
@ -1243,6 +1298,9 @@ static void test_jwt_creds_success(void) {
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success); grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
grpc_core::ExecCtx::Get()->Flush(); grpc_core::ExecCtx::Get()->Flush();
GPR_ASSERT(strncmp(expected_creds_debug_string_prefix,
creds->debug_string().c_str(),
strlen(expected_creds_debug_string_prefix)) == 0);
creds->Unref(); creds->Unref();
gpr_free(json_key_string); gpr_free(json_key_string);
@ -1251,6 +1309,8 @@ static void test_jwt_creds_success(void) {
} }
static void test_jwt_creds_signing_failure(void) { static void test_jwt_creds_signing_failure(void) {
const char expected_creds_debug_string_prefix[] =
"JWTAccessCredentials{ExpirationTime:";
char* json_key_string = test_json_key_str(); char* json_key_string = test_json_key_str();
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
@ -1266,6 +1326,10 @@ static void test_jwt_creds_signing_failure(void) {
run_request_metadata_test(creds, auth_md_ctx, state); run_request_metadata_test(creds, auth_md_ctx, state);
gpr_free(json_key_string); gpr_free(json_key_string);
GPR_ASSERT(strncmp(expected_creds_debug_string_prefix,
creds->debug_string().c_str(),
strlen(expected_creds_debug_string_prefix)) == 0);
creds->Unref(); creds->Unref();
grpc_jwt_encode_and_sign_set_override(nullptr); grpc_jwt_encode_and_sign_set_override(nullptr);
} }
@ -1513,7 +1577,29 @@ static void plugin_destroy(void* state) {
*s = PLUGIN_DESTROY_CALLED_STATE; *s = PLUGIN_DESTROY_CALLED_STATE;
} }
static char* plugin_debug_string(void* state) {
plugin_state* s = static_cast<plugin_state*>(state);
char* ret = nullptr;
switch (*s) {
case PLUGIN_INITIAL_STATE:
gpr_asprintf(&ret, "TestPluginCredentials{state:INITIAL}");
break;
case PLUGIN_GET_METADATA_CALLED_STATE:
gpr_asprintf(&ret, "TestPluginCredentials{state:GET_METADATA_CALLED}");
break;
case PLUGIN_DESTROY_CALLED_STATE:
gpr_asprintf(&ret, "TestPluginCredentials{state:DESTROY}");
break;
default:
gpr_asprintf(&ret, "TestPluginCredentials{state:UNKNOWN}");
break;
}
return ret;
}
static void test_metadata_plugin_success(void) { static void test_metadata_plugin_success(void) {
const char expected_creds_debug_string[] =
"TestPluginCredentials{state:GET_METADATA_CALLED}";
plugin_state state = PLUGIN_INITIAL_STATE; plugin_state state = PLUGIN_INITIAL_STATE;
grpc_metadata_credentials_plugin plugin; grpc_metadata_credentials_plugin plugin;
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
@ -1525,6 +1611,7 @@ static void test_metadata_plugin_success(void) {
plugin.state = &state; plugin.state = &state;
plugin.get_metadata = plugin_get_metadata_success; plugin.get_metadata = plugin_get_metadata_success;
plugin.destroy = plugin_destroy; plugin.destroy = plugin_destroy;
plugin.debug_string = plugin_debug_string;
grpc_call_credentials* creds = grpc_metadata_credentials_create_from_plugin( grpc_call_credentials* creds = grpc_metadata_credentials_create_from_plugin(
plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr); plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr);
@ -1533,12 +1620,17 @@ static void test_metadata_plugin_success(void) {
GPR_ASSERT(state == PLUGIN_INITIAL_STATE); GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
run_request_metadata_test(creds, auth_md_ctx, md_state); run_request_metadata_test(creds, auth_md_ctx, md_state);
GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE); GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE); GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
} }
static void test_metadata_plugin_failure(void) { static void test_metadata_plugin_failure(void) {
const char expected_creds_debug_string[] =
"TestPluginCredentials{state:GET_METADATA_CALLED}";
plugin_state state = PLUGIN_INITIAL_STATE; plugin_state state = PLUGIN_INITIAL_STATE;
grpc_metadata_credentials_plugin plugin; grpc_metadata_credentials_plugin plugin;
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
@ -1555,12 +1647,15 @@ static void test_metadata_plugin_failure(void) {
plugin.state = &state; plugin.state = &state;
plugin.get_metadata = plugin_get_metadata_failure; plugin.get_metadata = plugin_get_metadata_failure;
plugin.destroy = plugin_destroy; plugin.destroy = plugin_destroy;
plugin.debug_string = plugin_debug_string;
grpc_call_credentials* creds = grpc_metadata_credentials_create_from_plugin( grpc_call_credentials* creds = grpc_metadata_credentials_create_from_plugin(
plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr); plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr);
GPR_ASSERT(state == PLUGIN_INITIAL_STATE); GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
run_request_metadata_test(creds, auth_md_ctx, md_state); run_request_metadata_test(creds, auth_md_ctx, md_state);
GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE); GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref(); creds->Unref();
GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE); GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
@ -1599,6 +1694,8 @@ static void test_get_well_known_google_credentials_file_path(void) {
} }
static void test_channel_creds_duplicate_without_call_creds(void) { static void test_channel_creds_duplicate_without_call_creds(void) {
const char expected_creds_debug_string[] =
"AccessTokenCredentials{Token:present}";
grpc_core::ExecCtx exec_ctx; grpc_core::ExecCtx exec_ctx;
grpc_channel_credentials* channel_creds = grpc_channel_credentials* channel_creds =
@ -1614,6 +1711,9 @@ static void test_channel_creds_duplicate_without_call_creds(void) {
grpc_channel_credentials* composite_creds = grpc_channel_credentials* composite_creds =
grpc_composite_channel_credentials_create(channel_creds, call_creds, grpc_composite_channel_credentials_create(channel_creds, call_creds,
nullptr); nullptr);
GPR_ASSERT(strcmp(call_creds->debug_string().c_str(),
expected_creds_debug_string) == 0);
call_creds->Unref(); call_creds->Unref();
dup = composite_creds->duplicate_without_call_credentials(); dup = composite_creds->duplicate_without_call_credentials();
GPR_ASSERT(dup == channel_creds); GPR_ASSERT(dup == channel_creds);

@ -31,11 +31,13 @@
#include <grpcpp/server.h> #include <grpcpp/server.h>
#include <grpcpp/server_builder.h> #include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h> #include <grpcpp/server_context.h>
#include <grpcpp/support/string_ref.h>
#include <grpcpp/test/channel_test_peer.h> #include <grpcpp/test/channel_test_peer.h>
#include <mutex> #include <mutex>
#include <thread> #include <thread>
#include "absl/strings/str_format.h"
#include "src/core/ext/filters/client_channel/backup_poller.h" #include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/gpr/env.h" #include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/iomgr.h"
@ -86,6 +88,58 @@ bool CheckIsLocalhost(const grpc::string& addr) {
const char kTestCredsPluginErrorMsg[] = "Could not find plugin metadata."; const char kTestCredsPluginErrorMsg[] = "Could not find plugin metadata.";
const char kFakeToken[] = "fake_token";
const char kFakeSelector[] = "fake_selector";
const char kExpectedFakeCredsDebugString[] =
"SecureCallCredentials{GoogleIAMCredentials{Token:present,"
"AuthoritySelector:fake_selector}}";
const char kWrongToken[] = "wrong_token";
const char kWrongSelector[] = "wrong_selector";
const char kExpectedWrongCredsDebugString[] =
"SecureCallCredentials{GoogleIAMCredentials{Token:present,"
"AuthoritySelector:wrong_selector}}";
const char kFakeToken1[] = "fake_token1";
const char kFakeSelector1[] = "fake_selector1";
const char kExpectedFakeCreds1DebugString[] =
"SecureCallCredentials{GoogleIAMCredentials{Token:present,"
"AuthoritySelector:fake_selector1}}";
const char kFakeToken2[] = "fake_token2";
const char kFakeSelector2[] = "fake_selector2";
const char kExpectedFakeCreds2DebugString[] =
"SecureCallCredentials{GoogleIAMCredentials{Token:present,"
"AuthoritySelector:fake_selector2}}";
const char kExpectedAuthMetadataPluginKeyFailureCredsDebugString[] =
"SecureCallCredentials{TestMetadataCredentials{key:TestPluginMetadata,"
"value:Does not matter, will fail the key is invalid.}}";
const char kExpectedAuthMetadataPluginValueFailureCredsDebugString[] =
"SecureCallCredentials{TestMetadataCredentials{key:test-plugin-metadata,"
"value:With illegal \n value.}}";
const char kExpectedAuthMetadataPluginWithDeadlineCredsDebugString[] =
"SecureCallCredentials{TestMetadataCredentials{key:meta_key,value:Does not "
"matter}}";
const char kExpectedNonBlockingAuthMetadataPluginFailureCredsDebugString[] =
"SecureCallCredentials{TestMetadataCredentials{key:test-plugin-metadata,"
"value:Does not matter, will fail anyway (see 3rd param)}}";
const char
kExpectedNonBlockingAuthMetadataPluginAndProcessorSuccessCredsDebugString
[] = "SecureCallCredentials{TestMetadataCredentials{key:test-plugin-"
"metadata,value:Dr Jekyll}}";
const char
kExpectedNonBlockingAuthMetadataPluginAndProcessorFailureCredsDebugString
[] = "SecureCallCredentials{TestMetadataCredentials{key:test-plugin-"
"metadata,value:Mr Hyde}}";
const char kExpectedBlockingAuthMetadataPluginFailureCredsDebugString[] =
"SecureCallCredentials{TestMetadataCredentials{key:test-plugin-metadata,"
"value:Does not matter, will fail anyway (see 3rd param)}}";
const char kExpectedCompositeCallCredsDebugString[] =
"SecureCallCredentials{CompositeCallCredentials{TestMetadataCredentials{"
"key:call-creds-key1,value:call-creds-val1},TestMetadataCredentials{key:"
"call-creds-key2,value:call-creds-val2}}}";
class TestMetadataCredentialsPlugin : public MetadataCredentialsPlugin { class TestMetadataCredentialsPlugin : public MetadataCredentialsPlugin {
public: public:
static const char kGoodMetadataKey[]; static const char kGoodMetadataKey[];
@ -124,6 +178,11 @@ class TestMetadataCredentialsPlugin : public MetadataCredentialsPlugin {
} }
} }
grpc::string DebugString() override {
return absl::StrFormat("TestMetadataCredentials{key:%s,value:%s}",
metadata_key_.c_str(), metadata_value_.c_str());
}
private: private:
grpc::string metadata_key_; grpc::string metadata_key_;
grpc::string metadata_value_; grpc::string metadata_value_;
@ -1774,7 +1833,7 @@ TEST_P(SecureEnd2endTest, SetPerCallCredentials) {
EchoResponse response; EchoResponse response;
ClientContext context; ClientContext context;
std::shared_ptr<CallCredentials> creds = std::shared_ptr<CallCredentials> creds =
GoogleIAMCredentials("fake_token", "fake_selector"); GoogleIAMCredentials(kFakeToken, kFakeSelector);
context.set_credentials(creds); context.set_credentials(creds);
request.set_message("Hello"); request.set_message("Hello");
request.mutable_param()->set_echo_metadata(true); request.mutable_param()->set_echo_metadata(true);
@ -1784,10 +1843,12 @@ TEST_P(SecureEnd2endTest, SetPerCallCredentials) {
EXPECT_TRUE(s.ok()); EXPECT_TRUE(s.ok());
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY, GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
"fake_token")); kFakeToken));
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY, GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
"fake_selector")); kFakeSelector));
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedFakeCredsDebugString);
} }
class CredentialsInterceptor : public experimental::Interceptor { class CredentialsInterceptor : public experimental::Interceptor {
@ -1798,7 +1859,7 @@ class CredentialsInterceptor : public experimental::Interceptor {
if (methods->QueryInterceptionHookPoint( if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
std::shared_ptr<CallCredentials> creds = std::shared_ptr<CallCredentials> creds =
GoogleIAMCredentials("fake_token", "fake_selector"); GoogleIAMCredentials(kFakeToken, kFakeSelector);
info_->client_context()->set_credentials(creds); info_->client_context()->set_credentials(creds);
} }
methods->Proceed(); methods->Proceed();
@ -1838,10 +1899,12 @@ TEST_P(SecureEnd2endTest, CallCredentialsInterception) {
EXPECT_TRUE(s.ok()); EXPECT_TRUE(s.ok());
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY, GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
"fake_token")); kFakeToken));
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY, GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
"fake_selector")); kFakeSelector));
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedFakeCredsDebugString);
} }
TEST_P(SecureEnd2endTest, CallCredentialsInterceptionWithSetCredentials) { TEST_P(SecureEnd2endTest, CallCredentialsInterceptionWithSetCredentials) {
@ -1858,9 +1921,11 @@ TEST_P(SecureEnd2endTest, CallCredentialsInterceptionWithSetCredentials) {
EchoResponse response; EchoResponse response;
ClientContext context; ClientContext context;
std::shared_ptr<CallCredentials> creds1 = std::shared_ptr<CallCredentials> creds1 =
GoogleIAMCredentials("wrong_token", "wrong_selector"); GoogleIAMCredentials(kWrongToken, kWrongSelector);
context.set_credentials(creds1); context.set_credentials(creds1);
EXPECT_EQ(context.credentials(), creds1); EXPECT_EQ(context.credentials(), creds1);
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedWrongCredsDebugString);
request.set_message("Hello"); request.set_message("Hello");
request.mutable_param()->set_echo_metadata(true); request.mutable_param()->set_echo_metadata(true);
@ -1869,10 +1934,12 @@ TEST_P(SecureEnd2endTest, CallCredentialsInterceptionWithSetCredentials) {
EXPECT_TRUE(s.ok()); EXPECT_TRUE(s.ok());
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY, GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
"fake_token")); kFakeToken));
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY, GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
"fake_selector")); kFakeSelector));
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedFakeCredsDebugString);
} }
TEST_P(SecureEnd2endTest, OverridePerCallCredentials) { TEST_P(SecureEnd2endTest, OverridePerCallCredentials) {
@ -1882,11 +1949,13 @@ TEST_P(SecureEnd2endTest, OverridePerCallCredentials) {
EchoResponse response; EchoResponse response;
ClientContext context; ClientContext context;
std::shared_ptr<CallCredentials> creds1 = std::shared_ptr<CallCredentials> creds1 =
GoogleIAMCredentials("fake_token1", "fake_selector1"); GoogleIAMCredentials(kFakeToken1, kFakeSelector1);
context.set_credentials(creds1); context.set_credentials(creds1);
EXPECT_EQ(context.credentials(), creds1); EXPECT_EQ(context.credentials(), creds1);
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedFakeCreds1DebugString);
std::shared_ptr<CallCredentials> creds2 = std::shared_ptr<CallCredentials> creds2 =
GoogleIAMCredentials("fake_token2", "fake_selector2"); GoogleIAMCredentials(kFakeToken2, kFakeSelector2);
context.set_credentials(creds2); context.set_credentials(creds2);
EXPECT_EQ(context.credentials(), creds2); EXPECT_EQ(context.credentials(), creds2);
request.set_message("Hello"); request.set_message("Hello");
@ -1895,16 +1964,18 @@ TEST_P(SecureEnd2endTest, OverridePerCallCredentials) {
Status s = stub_->Echo(&context, request, &response); Status s = stub_->Echo(&context, request, &response);
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY, GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
"fake_token2")); kFakeToken2));
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY, GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
"fake_selector2")); kFakeSelector2));
EXPECT_FALSE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_FALSE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY, GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
"fake_token1")); kFakeToken1));
EXPECT_FALSE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_FALSE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY, GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
"fake_selector1")); kFakeSelector1));
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedFakeCreds2DebugString);
EXPECT_EQ(request.message(), response.message()); EXPECT_EQ(request.message(), response.message());
EXPECT_TRUE(s.ok()); EXPECT_TRUE(s.ok());
} }
@ -1926,6 +1997,8 @@ TEST_P(SecureEnd2endTest, AuthMetadataPluginKeyFailure) {
Status s = stub_->Echo(&context, request, &response); Status s = stub_->Echo(&context, request, &response);
EXPECT_FALSE(s.ok()); EXPECT_FALSE(s.ok());
EXPECT_EQ(s.error_code(), StatusCode::UNAVAILABLE); EXPECT_EQ(s.error_code(), StatusCode::UNAVAILABLE);
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedAuthMetadataPluginKeyFailureCredsDebugString);
} }
TEST_P(SecureEnd2endTest, AuthMetadataPluginValueFailure) { TEST_P(SecureEnd2endTest, AuthMetadataPluginValueFailure) {
@ -1944,6 +2017,8 @@ TEST_P(SecureEnd2endTest, AuthMetadataPluginValueFailure) {
Status s = stub_->Echo(&context, request, &response); Status s = stub_->Echo(&context, request, &response);
EXPECT_FALSE(s.ok()); EXPECT_FALSE(s.ok());
EXPECT_EQ(s.error_code(), StatusCode::UNAVAILABLE); EXPECT_EQ(s.error_code(), StatusCode::UNAVAILABLE);
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedAuthMetadataPluginValueFailureCredsDebugString);
} }
TEST_P(SecureEnd2endTest, AuthMetadataPluginWithDeadline) { TEST_P(SecureEnd2endTest, AuthMetadataPluginWithDeadline) {
@ -1968,6 +2043,8 @@ TEST_P(SecureEnd2endTest, AuthMetadataPluginWithDeadline) {
EXPECT_TRUE(s.error_code() == StatusCode::DEADLINE_EXCEEDED || EXPECT_TRUE(s.error_code() == StatusCode::DEADLINE_EXCEEDED ||
s.error_code() == StatusCode::UNAVAILABLE); s.error_code() == StatusCode::UNAVAILABLE);
} }
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedAuthMetadataPluginWithDeadlineCredsDebugString);
} }
TEST_P(SecureEnd2endTest, AuthMetadataPluginWithCancel) { TEST_P(SecureEnd2endTest, AuthMetadataPluginWithCancel) {
@ -1995,6 +2072,8 @@ TEST_P(SecureEnd2endTest, AuthMetadataPluginWithCancel) {
s.error_code() == StatusCode::UNAVAILABLE); s.error_code() == StatusCode::UNAVAILABLE);
} }
cancel_thread.join(); cancel_thread.join();
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedAuthMetadataPluginWithDeadlineCredsDebugString);
} }
TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginFailure) { TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginFailure) {
@ -2017,6 +2096,8 @@ TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginFailure) {
EXPECT_EQ(s.error_message(), EXPECT_EQ(s.error_message(),
grpc::string("Getting metadata from plugin failed with error: ") + grpc::string("Getting metadata from plugin failed with error: ") +
kTestCredsPluginErrorMsg); kTestCredsPluginErrorMsg);
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedNonBlockingAuthMetadataPluginFailureCredsDebugString);
} }
TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginAndProcessorSuccess) { TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginAndProcessorSuccess) {
@ -2043,6 +2124,9 @@ TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginAndProcessorSuccess) {
EXPECT_FALSE(MetadataContains( EXPECT_FALSE(MetadataContains(
context.GetServerTrailingMetadata(), GRPC_AUTHORIZATION_METADATA_KEY, context.GetServerTrailingMetadata(), GRPC_AUTHORIZATION_METADATA_KEY,
grpc::string("Bearer ") + TestAuthMetadataProcessor::kGoodGuy)); grpc::string("Bearer ") + TestAuthMetadataProcessor::kGoodGuy));
EXPECT_EQ(
context.credentials()->DebugString(),
kExpectedNonBlockingAuthMetadataPluginAndProcessorSuccessCredsDebugString);
} }
TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginAndProcessorFailure) { TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginAndProcessorFailure) {
@ -2059,6 +2143,9 @@ TEST_P(SecureEnd2endTest, NonBlockingAuthMetadataPluginAndProcessorFailure) {
Status s = stub_->Echo(&context, request, &response); Status s = stub_->Echo(&context, request, &response);
EXPECT_FALSE(s.ok()); EXPECT_FALSE(s.ok());
EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED); EXPECT_EQ(s.error_code(), StatusCode::UNAUTHENTICATED);
EXPECT_EQ(
context.credentials()->DebugString(),
kExpectedNonBlockingAuthMetadataPluginAndProcessorFailureCredsDebugString);
} }
TEST_P(SecureEnd2endTest, BlockingAuthMetadataPluginFailure) { TEST_P(SecureEnd2endTest, BlockingAuthMetadataPluginFailure) {
@ -2081,6 +2168,8 @@ TEST_P(SecureEnd2endTest, BlockingAuthMetadataPluginFailure) {
EXPECT_EQ(s.error_message(), EXPECT_EQ(s.error_message(),
grpc::string("Getting metadata from plugin failed with error: ") + grpc::string("Getting metadata from plugin failed with error: ") +
kTestCredsPluginErrorMsg); kTestCredsPluginErrorMsg);
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedBlockingAuthMetadataPluginFailureCredsDebugString);
} }
TEST_P(SecureEnd2endTest, CompositeCallCreds) { TEST_P(SecureEnd2endTest, CompositeCallCreds) {
@ -2112,6 +2201,8 @@ TEST_P(SecureEnd2endTest, CompositeCallCreds) {
kMetadataKey1, kMetadataVal1)); kMetadataKey1, kMetadataVal1));
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(), EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
kMetadataKey2, kMetadataVal2)); kMetadataKey2, kMetadataVal2));
EXPECT_EQ(context.credentials()->DebugString(),
kExpectedCompositeCallCredsDebugString);
} }
TEST_P(SecureEnd2endTest, ClientAuthContext) { TEST_P(SecureEnd2endTest, ClientAuthContext) {

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # control system is used.
PROJECT_NUMBER = 9.0.0 PROJECT_NUMBER = 10.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # control system is used.
PROJECT_NUMBER = 9.0.0 PROJECT_NUMBER = 10.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a

Loading…
Cancel
Save