mirror of https://github.com/grpc/grpc-ios.git
Compare commits
12 Commits
v1.73.0-pr
...
main
Author | SHA1 | Date |
---|---|---|
|
52d0c6c326 | |
|
d88573fd5f | |
|
e584a88115 | |
|
96ddc18603 | |
|
fcb8b99697 | |
|
9849f527f0 | |
|
30bd3c9d49 | |
|
78593d170e | |
|
c92e41c10b | |
|
b641ac3789 | |
|
5c9cda2cf6 | |
|
6797fe4c02 |
|
@ -23,7 +23,7 @@ env:
|
|||
|
||||
jobs:
|
||||
release-cocoapod:
|
||||
runs-on: macos-12
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- name: Repo checkout
|
||||
uses: actions/checkout@v3
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-C++'
|
||||
# TODO (mxyan): use version that match gRPC version when pod is stabilized
|
||||
version = '1.73.0-pre2'
|
||||
version = '1.73.1'
|
||||
s.version = version
|
||||
s.summary = 'gRPC C++ library'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-Core'
|
||||
version = '1.73.0-pre2'
|
||||
version = '1.73.1'
|
||||
s.version = version
|
||||
s.summary = 'Core cross-platform gRPC library, written in C'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-ProtoRPC'
|
||||
version = '1.73.0-pre2'
|
||||
version = '1.73.1'
|
||||
s.version = version
|
||||
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-RxLibrary'
|
||||
version = '1.73.0-pre2'
|
||||
version = '1.73.1'
|
||||
s.version = version
|
||||
s.summary = 'Reactive Extensions library for iOS/OSX.'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC'
|
||||
version = '1.73.0-pre2'
|
||||
version = '1.73.1'
|
||||
s.version = version
|
||||
s.summary = 'gRPC client library for iOS/OSX'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
#define GRPC_CPP_VERSION_MAJOR 1
|
||||
#define GRPC_CPP_VERSION_MINOR 73
|
||||
#define GRPC_CPP_VERSION_PATCH 0
|
||||
#define GRPC_CPP_VERSION_TAG "pre2"
|
||||
#define GRPC_CPP_VERSION_STRING "1.73.0-pre2"
|
||||
#define GRPC_CPP_VERSION_PATCH 1
|
||||
#define GRPC_CPP_VERSION_TAG ""
|
||||
#define GRPC_CPP_VERSION_STRING "1.73.1"
|
||||
|
||||
#endif // GRPCPP_VERSION_INFO_H
|
||||
#endif // GRPCPP_VERSION_INFO_H
|
||||
|
|
|
@ -62,10 +62,15 @@ static grpc_core::Duration g_poll_interval =
|
|||
static bool g_backup_polling_disabled;
|
||||
|
||||
void grpc_client_channel_global_init_backup_polling() {
|
||||
#ifndef GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER
|
||||
// Disable backup polling if EventEngine is used everywhere.
|
||||
g_backup_polling_disabled = grpc_core::IsEventEngineClientEnabled() &&
|
||||
grpc_core::IsEventEngineListenerEnabled() &&
|
||||
grpc_core::IsEventEngineDnsEnabled();
|
||||
#else
|
||||
// EventEngine polling not supported, keep using the backup poller.
|
||||
g_backup_polling_disabled = false;
|
||||
#endif
|
||||
if (g_backup_polling_disabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -155,11 +160,21 @@ static void g_poller_init_locked() {
|
|||
}
|
||||
}
|
||||
|
||||
static bool g_can_poll_in_background() {
|
||||
#ifndef GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER
|
||||
return grpc_iomgr_run_in_background();
|
||||
#else
|
||||
// No iomgr "event_engines" (not to be confused with the new EventEngine)
|
||||
// are able to run in backgroung.
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void grpc_client_channel_start_backup_polling(
|
||||
grpc_pollset_set* interested_parties) {
|
||||
if (g_backup_polling_disabled ||
|
||||
g_poll_interval == grpc_core::Duration::Zero() ||
|
||||
grpc_iomgr_run_in_background()) {
|
||||
g_can_poll_in_background()) {
|
||||
return;
|
||||
}
|
||||
gpr_mu_lock(&g_poller_mu);
|
||||
|
@ -179,7 +194,7 @@ void grpc_client_channel_stop_backup_polling(
|
|||
grpc_pollset_set* interested_parties) {
|
||||
if (g_backup_polling_disabled ||
|
||||
g_poll_interval == grpc_core::Duration::Zero() ||
|
||||
grpc_iomgr_run_in_background()) {
|
||||
g_can_poll_in_background()) {
|
||||
return;
|
||||
}
|
||||
grpc_pollset_set_del_pollset(interested_parties, g_poller->pollset);
|
||||
|
|
|
@ -39,135 +39,159 @@
|
|||
#include "upb/message/message.h"
|
||||
#include "upb/text/encode.h"
|
||||
|
||||
namespace grpc_core {
|
||||
namespace grpc_core
|
||||
{
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
|
||||
std::unique_ptr<XdsMetadataValue> ParseGcpAuthnAudience(
|
||||
const XdsResourceType::DecodeContext& context, XdsExtension extension,
|
||||
ValidationErrors* errors) {
|
||||
absl::string_view* serialized_proto =
|
||||
std::get_if<absl::string_view>(&extension.value);
|
||||
if (serialized_proto == nullptr) {
|
||||
errors->AddError("could not parse audience metadata");
|
||||
return nullptr;
|
||||
}
|
||||
auto* proto = envoy_extensions_filters_http_gcp_authn_v3_Audience_parse(
|
||||
serialized_proto->data(), serialized_proto->size(), context.arena);
|
||||
if (proto == nullptr) {
|
||||
errors->AddError("could not parse audience metadata");
|
||||
return nullptr;
|
||||
}
|
||||
if (GRPC_TRACE_FLAG_ENABLED(xds_client) && ABSL_VLOG_IS_ON(2)) {
|
||||
const upb_MessageDef* msg_type =
|
||||
envoy_extensions_filters_http_gcp_authn_v3_Audience_getmsgdef(
|
||||
context.symtab);
|
||||
char buf[10240];
|
||||
upb_TextEncode(reinterpret_cast<const upb_Message*>(proto), msg_type,
|
||||
nullptr, 0, buf, sizeof(buf));
|
||||
VLOG(2) << "[xds_client " << context.client
|
||||
<< "] cluster metadata Audience: " << buf;
|
||||
}
|
||||
absl::string_view url = UpbStringToAbsl(
|
||||
envoy_extensions_filters_http_gcp_authn_v3_Audience_url(proto));
|
||||
if (url.empty()) {
|
||||
ValidationErrors::ScopedField field(errors, ".url");
|
||||
errors->AddError("must be non-empty");
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_unique<XdsGcpAuthnAudienceMetadataValue>(url);
|
||||
}
|
||||
|
||||
std::unique_ptr<XdsMetadataValue> ParseAddress(
|
||||
const XdsResourceType::DecodeContext& context, XdsExtension extension,
|
||||
ValidationErrors* errors) {
|
||||
absl::string_view* serialized_proto =
|
||||
std::get_if<absl::string_view>(&extension.value);
|
||||
if (serialized_proto == nullptr) {
|
||||
errors->AddError("could not parse address metadata");
|
||||
return nullptr;
|
||||
}
|
||||
auto* proto = envoy_config_core_v3_Address_parse(
|
||||
serialized_proto->data(), serialized_proto->size(), context.arena);
|
||||
if (proto == nullptr) {
|
||||
errors->AddError("could not parse address metadata");
|
||||
return nullptr;
|
||||
}
|
||||
if (GRPC_TRACE_FLAG_ENABLED(xds_client) && ABSL_VLOG_IS_ON(2)) {
|
||||
const upb_MessageDef* msg_type =
|
||||
envoy_config_core_v3_Address_getmsgdef(context.symtab);
|
||||
char buf[10240];
|
||||
upb_TextEncode(reinterpret_cast<const upb_Message*>(proto), msg_type,
|
||||
nullptr, 0, buf, sizeof(buf));
|
||||
VLOG(2) << "[xds_client " << context.client
|
||||
<< "] cluster metadata Address: " << buf;
|
||||
}
|
||||
auto addr = ParseXdsAddress(proto, errors);
|
||||
if (!addr.has_value()) return nullptr;
|
||||
auto addr_uri = grpc_sockaddr_to_string(&*addr, /*normalize=*/false);
|
||||
if (!addr_uri.ok()) {
|
||||
errors->AddError(addr_uri.status().message());
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_unique<XdsAddressMetadataValue>(std::move(*addr_uri));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
XdsMetadataMap ParseXdsMetadataMap(
|
||||
const XdsResourceType::DecodeContext& context,
|
||||
const envoy_config_core_v3_Metadata* metadata, ValidationErrors* errors) {
|
||||
XdsMetadataMap metadata_map;
|
||||
if (metadata == nullptr) return metadata_map; // Not present == empty.
|
||||
// First, try typed_filter_metadata.
|
||||
envoy_config_core_v3_Metadata* metadata_upb =
|
||||
(envoy_config_core_v3_Metadata*)metadata;
|
||||
size_t iter = kUpb_Map_Begin;
|
||||
upb_StringView typed_filter_metadata_key_view;
|
||||
const google_protobuf_Any* typed_filter_metadata_val;
|
||||
while (envoy_config_core_v3_Metadata_typed_filter_metadata_next(
|
||||
metadata_upb, &typed_filter_metadata_key_view, &typed_filter_metadata_val,
|
||||
&iter)) {
|
||||
absl::string_view key = UpbStringToAbsl(typed_filter_metadata_key_view);
|
||||
ValidationErrors::ScopedField field(
|
||||
errors, absl::StrCat(".typed_filter_metadata[", key, "]"));
|
||||
auto extension =
|
||||
ExtractXdsExtension(context, typed_filter_metadata_val, errors);
|
||||
if (!extension.has_value()) continue;
|
||||
// TODO(roth): If we start to need a lot of types here, refactor
|
||||
// this into a separate registry.
|
||||
std::unique_ptr<XdsMetadataValue> metadata_value;
|
||||
if (extension->type == XdsGcpAuthnAudienceMetadataValue::Type()) {
|
||||
metadata_value =
|
||||
ParseGcpAuthnAudience(context, std::move(*extension), errors);
|
||||
} else if (XdsHttpConnectEnabled() &&
|
||||
extension->type == XdsAddressMetadataValue::Type()) {
|
||||
metadata_value = ParseAddress(context, std::move(*extension), errors);
|
||||
std::unique_ptr<XdsMetadataValue> ParseGcpAuthnAudience(
|
||||
const XdsResourceType::DecodeContext &context, XdsExtension extension,
|
||||
ValidationErrors *errors)
|
||||
{
|
||||
absl::string_view *serialized_proto =
|
||||
std::get_if<absl::string_view>(&extension.value);
|
||||
if (serialized_proto == nullptr)
|
||||
{
|
||||
errors->AddError("could not parse audience metadata");
|
||||
return nullptr;
|
||||
}
|
||||
auto *proto = envoy_extensions_filters_http_gcp_authn_v3_Audience_parse(
|
||||
serialized_proto->data(), serialized_proto->size(), context.arena);
|
||||
if (proto == nullptr)
|
||||
{
|
||||
errors->AddError("could not parse audience metadata");
|
||||
return nullptr;
|
||||
}
|
||||
if (GRPC_TRACE_FLAG_ENABLED(xds_client) && ABSL_VLOG_IS_ON(2))
|
||||
{
|
||||
const upb_MessageDef *msg_type =
|
||||
envoy_extensions_filters_http_gcp_authn_v3_Audience_getmsgdef(
|
||||
context.symtab);
|
||||
char buf[10240];
|
||||
upb_TextEncode(reinterpret_cast<const upb_Message *>(proto), msg_type,
|
||||
nullptr, 0, buf, sizeof(buf));
|
||||
VLOG(2) << "[xds_client " << context.client
|
||||
<< "] cluster metadata Audience: " << buf;
|
||||
}
|
||||
absl::string_view url = UpbStringToAbsl(
|
||||
envoy_extensions_filters_http_gcp_authn_v3_Audience_url(proto));
|
||||
if (url.empty())
|
||||
{
|
||||
ValidationErrors::ScopedField field(errors, ".url");
|
||||
errors->AddError("must be non-empty");
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_unique<XdsGcpAuthnAudienceMetadataValue>(url);
|
||||
}
|
||||
if (metadata_value != nullptr) {
|
||||
metadata_map.Insert(key, std::move(metadata_value));
|
||||
|
||||
std::unique_ptr<XdsMetadataValue> ParseAddress(
|
||||
const XdsResourceType::DecodeContext &context, XdsExtension extension,
|
||||
ValidationErrors *errors)
|
||||
{
|
||||
absl::string_view *serialized_proto =
|
||||
std::get_if<absl::string_view>(&extension.value);
|
||||
if (serialized_proto == nullptr)
|
||||
{
|
||||
errors->AddError("could not parse address metadata");
|
||||
return nullptr;
|
||||
}
|
||||
auto *proto = envoy_config_core_v3_Address_parse(
|
||||
serialized_proto->data(), serialized_proto->size(), context.arena);
|
||||
if (proto == nullptr)
|
||||
{
|
||||
errors->AddError("could not parse address metadata");
|
||||
return nullptr;
|
||||
}
|
||||
if (GRPC_TRACE_FLAG_ENABLED(xds_client) && ABSL_VLOG_IS_ON(2))
|
||||
{
|
||||
const upb_MessageDef *msg_type =
|
||||
envoy_config_core_v3_Address_getmsgdef(context.symtab);
|
||||
char buf[10240];
|
||||
upb_TextEncode(reinterpret_cast<const upb_Message *>(proto), msg_type,
|
||||
nullptr, 0, buf, sizeof(buf));
|
||||
VLOG(2) << "[xds_client " << context.client
|
||||
<< "] cluster metadata Address: " << buf;
|
||||
}
|
||||
auto addr = ParseXdsAddress(proto, errors);
|
||||
if (!addr.has_value())
|
||||
return nullptr;
|
||||
auto addr_uri = grpc_sockaddr_to_string(&*addr, /*normalize=*/false);
|
||||
if (!addr_uri.ok())
|
||||
{
|
||||
errors->AddError(addr_uri.status().message());
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_unique<XdsAddressMetadataValue>(std::move(*addr_uri));
|
||||
}
|
||||
}
|
||||
// Then, try filter_metadata.
|
||||
size_t iter2 = kUpb_Map_Begin;
|
||||
upb_StringView filter_metadata_key_view;
|
||||
const google_protobuf_Struct* filter_metadata_val;
|
||||
while (envoy_config_core_v3_Metadata_filter_metadata_next(
|
||||
metadata_upb, &filter_metadata_key_view, &filter_metadata_val, &iter2)) {
|
||||
absl::string_view key = UpbStringToAbsl(filter_metadata_key_view);
|
||||
auto json = ParseProtobufStructToJson(context, filter_metadata_val);
|
||||
if (!json.ok()) {
|
||||
|
||||
} // namespace
|
||||
|
||||
XdsMetadataMap ParseXdsMetadataMap(
|
||||
const XdsResourceType::DecodeContext &context,
|
||||
const envoy_config_core_v3_Metadata *metadata, ValidationErrors *errors)
|
||||
{
|
||||
XdsMetadataMap metadata_map;
|
||||
if (metadata == nullptr)
|
||||
return metadata_map; // Not present == empty.
|
||||
// First, try typed_filter_metadata.
|
||||
envoy_config_core_v3_Metadata *metadata_upb =
|
||||
(envoy_config_core_v3_Metadata *)metadata;
|
||||
size_t iter = kUpb_Map_Begin;
|
||||
upb_StringView typed_filter_metadata_key_view;
|
||||
const google_protobuf_Any *typed_filter_metadata_val;
|
||||
while (envoy_config_core_v3_Metadata_typed_filter_metadata_next(
|
||||
metadata_upb, &typed_filter_metadata_key_view, &typed_filter_metadata_val,
|
||||
&iter))
|
||||
{
|
||||
absl::string_view key = UpbStringToAbsl(typed_filter_metadata_key_view);
|
||||
ValidationErrors::ScopedField field(
|
||||
errors, absl::StrCat(".filter_metadata[", key, "]"));
|
||||
errors->AddError(json.status().message());
|
||||
errors, absl::StrCat(".typed_filter_metadata[", key, "]"));
|
||||
auto extension =
|
||||
ExtractXdsExtension(context, typed_filter_metadata_val, errors);
|
||||
if (!extension.has_value())
|
||||
continue;
|
||||
// TODO(roth): If we start to need a lot of types here, refactor
|
||||
// this into a separate registry.
|
||||
std::unique_ptr<XdsMetadataValue> metadata_value;
|
||||
if (extension->type == XdsGcpAuthnAudienceMetadataValue::Type())
|
||||
{
|
||||
metadata_value =
|
||||
ParseGcpAuthnAudience(context, std::move(*extension), errors);
|
||||
}
|
||||
else if (XdsHttpConnectEnabled() &&
|
||||
extension->type == XdsAddressMetadataValue::Type())
|
||||
{
|
||||
metadata_value = ParseAddress(context, std::move(*extension), errors);
|
||||
}
|
||||
if (metadata_value != nullptr)
|
||||
{
|
||||
metadata_map.Insert(key, std::move(metadata_value));
|
||||
}
|
||||
}
|
||||
// Add only if not already added from typed_filter_metadata.
|
||||
else if (metadata_map.Find(key) == nullptr) {
|
||||
metadata_map.Insert(
|
||||
key, std::make_unique<XdsStructMetadataValue>(std::move(*json)));
|
||||
// Then, try filter_metadata.
|
||||
size_t iter2 = kUpb_Map_Begin;
|
||||
upb_StringView filter_metadata_key_view;
|
||||
const google_protobuf_Struct *filter_metadata_val;
|
||||
while (envoy_config_core_v3_Metadata_filter_metadata_next(
|
||||
metadata_upb, &filter_metadata_key_view, &filter_metadata_val, &iter2))
|
||||
{
|
||||
absl::string_view key = UpbStringToAbsl(filter_metadata_key_view);
|
||||
auto json = ParseProtobufStructToJson(context, filter_metadata_val);
|
||||
if (!json.ok())
|
||||
{
|
||||
ValidationErrors::ScopedField field(
|
||||
errors, absl::StrCat(".filter_metadata[", key, "]"));
|
||||
errors->AddError(json.status().message());
|
||||
}
|
||||
// Add only if not already added from typed_filter_metadata.
|
||||
else if (metadata_map.Find(key) == nullptr)
|
||||
{
|
||||
metadata_map.Insert(
|
||||
key, std::make_unique<XdsStructMetadataValue>(std::move(*json)));
|
||||
}
|
||||
}
|
||||
return metadata_map;
|
||||
}
|
||||
return metadata_map;
|
||||
}
|
||||
|
||||
} // namespace grpc_core
|
||||
} // namespace grpc_core
|
||||
|
|
|
@ -42,7 +42,7 @@ Pod::Spec.new do |s|
|
|||
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
|
||||
# before them.
|
||||
s.name = '!ProtoCompiler-gRPCCppPlugin'
|
||||
v = '1.73.0-pre2'
|
||||
v = '1.73.1'
|
||||
s.version = v
|
||||
s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.'
|
||||
s.description = <<-DESC
|
||||
|
|
|
@ -42,7 +42,7 @@ Pod::Spec.new do |s|
|
|||
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
|
||||
# before them.
|
||||
s.name = '!ProtoCompiler-gRPCPlugin'
|
||||
v = '1.73.0-pre2'
|
||||
v = '1.73.1'
|
||||
s.version = v
|
||||
s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
|
||||
s.description = <<-DESC
|
||||
|
|
|
@ -22,4 +22,4 @@
|
|||
// instead. This file can be regenerated from the template by running
|
||||
// `tools/buildgen/generate_projects.sh`.
|
||||
|
||||
#define GRPC_OBJC_VERSION_STRING @"1.73.0-pre2"
|
||||
#define GRPC_OBJC_VERSION_STRING @"1.73.1"
|
||||
|
|
Loading…
Reference in New Issue