diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 5bb03420e..7ec3776e8 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -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.68.0' + version = '1.68.1' s.version = version s.summary = 'gRPC C++ library' s.homepage = 'https://grpc.io' diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index b929c89e9..dc3527377 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.68.0' + version = '1.68.1' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'https://grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 754a608e8..e43fe8128 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.68.0' + version = '1.68.1' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'https://grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 90ca27cf8..220c67bc1 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.68.0' + version = '1.68.1' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'https://grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 4d9b89997..1b408b6f1 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.68.0' + version = '1.68.1' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'https://grpc.io' diff --git a/include/grpcpp/version_info.h b/include/grpcpp/version_info.h index eef7c3326..346444e34 100644 --- a/include/grpcpp/version_info.h +++ b/include/grpcpp/version_info.h @@ -20,8 +20,8 @@ #define GRPC_CPP_VERSION_MAJOR 1 #define GRPC_CPP_VERSION_MINOR 68 -#define GRPC_CPP_VERSION_PATCH 0 +#define GRPC_CPP_VERSION_PATCH 1 #define GRPC_CPP_VERSION_TAG "" -#define GRPC_CPP_VERSION_STRING "1.68.0" +#define GRPC_CPP_VERSION_STRING "1.68.1" #endif // GRPCPP_VERSION_INFO_H diff --git a/src/core/ext/filters/rbac/rbac_service_config_parser.cc b/src/core/ext/filters/rbac/rbac_service_config_parser.cc index 5c1fce974..c802d8d79 100644 --- a/src/core/ext/filters/rbac/rbac_service_config_parser.cc +++ b/src/core/ext/filters/rbac/rbac_service_config_parser.cc @@ -353,6 +353,13 @@ void RbacConfig::RbacPolicy::Rules::Policy::HeaderMatch::JsonPostLoad( range_match->end, invert_match)); return; } + auto string_match = LoadJsonObjectField( + json.object(), args, "stringMatch", errors, /*required=*/false); + if (string_match.has_value()) { + matcher = HeaderMatcher::CreateFromStringMatcher( + name, std::move(string_match->matcher), invert_match); + return; + } if (errors->size() == original_error_size) { errors->AddError("no valid matcher found"); } @@ -390,7 +397,8 @@ void RbacConfig::RbacPolicy::Rules::Policy::StringMatch::JsonPostLoad( field_name, errors, /*required=*/false); if (match.has_value()) { - set_string_matcher(StringMatcher::Create(type, *match, ignore_case)); + set_string_matcher( + StringMatcher::Create(type, *match, /*case_sensitive=*/!ignore_case)); return true; } return false; @@ -406,7 +414,7 @@ void RbacConfig::RbacPolicy::Rules::Policy::StringMatch::JsonPostLoad( /*required=*/false); if (regex_match.has_value()) { set_string_matcher(StringMatcher::Create(StringMatcher::Type::kSafeRegex, - regex_match->regex, ignore_case)); + regex_match->regex)); return; } if (errors->size() == original_error_size) { diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index 1363f967a..9dd14bf12 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -22,6 +22,6 @@ #include #include -const char* grpc_version_string(void) { return "44.1.0"; } +const char* grpc_version_string(void) { return "44.1.1"; } const char* grpc_g_stands_for(void) { return "groovy"; } diff --git a/src/core/util/matchers.cc b/src/core/util/matchers.cc index d4f6c3bd7..82c56855c 100644 --- a/src/core/util/matchers.cc +++ b/src/core/util/matchers.cc @@ -180,6 +180,13 @@ absl::StatusOr HeaderMatcher::Create( } } +HeaderMatcher HeaderMatcher::CreateFromStringMatcher(absl::string_view name, + StringMatcher matcher, + bool invert_match) { + HeaderMatcher::Type type = static_cast(matcher.type()); + return HeaderMatcher(name, type, std::move(matcher), invert_match); +} + HeaderMatcher::HeaderMatcher(absl::string_view name, Type type, StringMatcher string_matcher, bool invert_match) : name_(name), diff --git a/src/core/util/matchers.h b/src/core/util/matchers.h index 922e0632b..ca3e55972 100644 --- a/src/core/util/matchers.h +++ b/src/core/util/matchers.h @@ -115,6 +115,11 @@ class HeaderMatcher { bool invert_match = false, bool case_sensitive = true); + // Creates a HeaderMatcher from an existing StringMatcher instance. + static HeaderMatcher CreateFromStringMatcher(absl::string_view name, + StringMatcher matcher, + bool invert_match); + HeaderMatcher() = default; HeaderMatcher(const HeaderMatcher& other); HeaderMatcher& operator=(const HeaderMatcher& other); diff --git a/src/core/xds/grpc/xds_http_rbac_filter.cc b/src/core/xds/grpc/xds_http_rbac_filter.cc index af819a711..d63040053 100644 --- a/src/core/xds/grpc/xds_http_rbac_filter.cc +++ b/src/core/xds/grpc/xds_http_rbac_filter.cc @@ -81,6 +81,39 @@ Json ParseInt64RangeToJson(const envoy_type_v3_Int64Range* range) { {"end", Json::FromNumber(envoy_type_v3_Int64Range_end(range))}}); } +Json ParseStringMatcherToJson( + const envoy_type_matcher_v3_StringMatcher* matcher, + ValidationErrors* errors) { + Json::Object json; + if (envoy_type_matcher_v3_StringMatcher_has_exact(matcher)) { + json.emplace("exact", + Json::FromString(UpbStringToStdString( + envoy_type_matcher_v3_StringMatcher_exact(matcher)))); + } else if (envoy_type_matcher_v3_StringMatcher_has_prefix(matcher)) { + json.emplace("prefix", + Json::FromString(UpbStringToStdString( + envoy_type_matcher_v3_StringMatcher_prefix(matcher)))); + } else if (envoy_type_matcher_v3_StringMatcher_has_suffix(matcher)) { + json.emplace("suffix", + Json::FromString(UpbStringToStdString( + envoy_type_matcher_v3_StringMatcher_suffix(matcher)))); + } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(matcher)) { + json.emplace("safeRegex", + ParseRegexMatcherToJson( + envoy_type_matcher_v3_StringMatcher_safe_regex(matcher))); + } else if (envoy_type_matcher_v3_StringMatcher_has_contains(matcher)) { + json.emplace("contains", + Json::FromString(UpbStringToStdString( + envoy_type_matcher_v3_StringMatcher_contains(matcher)))); + } else { + errors->AddError("invalid match pattern"); + } + json.emplace( + "ignoreCase", + Json::FromBool(envoy_type_matcher_v3_StringMatcher_ignore_case(matcher))); + return Json::FromObject(std::move(json)); +} + Json ParseHeaderMatcherToJson(const envoy_config_route_v3_HeaderMatcher* header, ValidationErrors* errors) { Json::Object header_json; @@ -130,6 +163,11 @@ Json ParseHeaderMatcherToJson(const envoy_config_route_v3_HeaderMatcher* header, "containsMatch", Json::FromString(UpbStringToStdString( envoy_config_route_v3_HeaderMatcher_contains_match(header)))); + } else if (envoy_config_route_v3_HeaderMatcher_has_string_match(header)) { + header_json.emplace( + "stringMatch", + ParseStringMatcherToJson( + envoy_config_route_v3_HeaderMatcher_string_match(header), errors)); } else { errors->AddError("invalid route header matcher specified"); } @@ -139,39 +177,6 @@ Json ParseHeaderMatcherToJson(const envoy_config_route_v3_HeaderMatcher* header, return Json::FromObject(std::move(header_json)); } -Json ParseStringMatcherToJson( - const envoy_type_matcher_v3_StringMatcher* matcher, - ValidationErrors* errors) { - Json::Object json; - if (envoy_type_matcher_v3_StringMatcher_has_exact(matcher)) { - json.emplace("exact", - Json::FromString(UpbStringToStdString( - envoy_type_matcher_v3_StringMatcher_exact(matcher)))); - } else if (envoy_type_matcher_v3_StringMatcher_has_prefix(matcher)) { - json.emplace("prefix", - Json::FromString(UpbStringToStdString( - envoy_type_matcher_v3_StringMatcher_prefix(matcher)))); - } else if (envoy_type_matcher_v3_StringMatcher_has_suffix(matcher)) { - json.emplace("suffix", - Json::FromString(UpbStringToStdString( - envoy_type_matcher_v3_StringMatcher_suffix(matcher)))); - } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(matcher)) { - json.emplace("safeRegex", - ParseRegexMatcherToJson( - envoy_type_matcher_v3_StringMatcher_safe_regex(matcher))); - } else if (envoy_type_matcher_v3_StringMatcher_has_contains(matcher)) { - json.emplace("contains", - Json::FromString(UpbStringToStdString( - envoy_type_matcher_v3_StringMatcher_contains(matcher)))); - } else { - errors->AddError("invalid match pattern"); - } - json.emplace( - "ignoreCase", - Json::FromBool(envoy_type_matcher_v3_StringMatcher_ignore_case(matcher))); - return Json::FromObject(std::move(json)); -} - Json ParsePathMatcherToJson(const envoy_type_matcher_v3_PathMatcher* matcher, ValidationErrors* errors) { ValidationErrors::ScopedField field(errors, ".path"); diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec index c81f6a5e8..ea6059af8 100644 --- a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec @@ -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.68.0' + v = '1.68.1' s.version = v s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index be86760be..4b4cb364f 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -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.68.0' + v = '1.68.1' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/version.h b/src/objective-c/GRPCClient/version.h index 134839a13..7fdf1569c 100644 --- a/src/objective-c/GRPCClient/version.h +++ b/src/objective-c/GRPCClient/version.h @@ -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.68.0" +#define GRPC_OBJC_VERSION_STRING @"1.68.1"