Skip to content

Commit e4bcb2c

Browse files
authored
Merge branch 'grpc:master' into master
2 parents 6c131f2 + 1528f80 commit e4bcb2c

39 files changed

+3474
-124
lines changed

MODULE.bazel

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
2323
"com.google.truth:truth:1.4.5",
2424
"com.squareup.okhttp:okhttp:2.7.5",
2525
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
26-
"io.netty:netty-buffer:4.1.130.Final",
27-
"io.netty:netty-codec-http2:4.1.130.Final",
28-
"io.netty:netty-codec-http:4.1.130.Final",
29-
"io.netty:netty-codec-socks:4.1.130.Final",
30-
"io.netty:netty-codec:4.1.130.Final",
31-
"io.netty:netty-common:4.1.130.Final",
32-
"io.netty:netty-handler-proxy:4.1.130.Final",
33-
"io.netty:netty-handler:4.1.130.Final",
34-
"io.netty:netty-resolver:4.1.130.Final",
35-
"io.netty:netty-tcnative-boringssl-static:2.0.74.Final",
36-
"io.netty:netty-tcnative-classes:2.0.74.Final",
37-
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.130.Final",
38-
"io.netty:netty-transport-native-unix-common:4.1.130.Final",
39-
"io.netty:netty-transport:4.1.130.Final",
26+
"io.netty:netty-buffer:4.1.132.Final",
27+
"io.netty:netty-codec-http2:4.1.132.Final",
28+
"io.netty:netty-codec-http:4.1.132.Final",
29+
"io.netty:netty-codec-socks:4.1.132.Final",
30+
"io.netty:netty-codec:4.1.132.Final",
31+
"io.netty:netty-common:4.1.132.Final",
32+
"io.netty:netty-handler-proxy:4.1.132.Final",
33+
"io.netty:netty-handler:4.1.132.Final",
34+
"io.netty:netty-resolver:4.1.132.Final",
35+
"io.netty:netty-tcnative-boringssl-static:2.0.75.Final",
36+
"io.netty:netty-tcnative-classes:2.0.75.Final",
37+
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.132.Final",
38+
"io.netty:netty-transport-native-unix-common:4.1.132.Final",
39+
"io.netty:netty-transport:4.1.132.Final",
4040
"io.opencensus:opencensus-api:0.31.0",
4141
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
4242
"io.perfmark:perfmark-api:0.27.0",

SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ grpc-netty version | netty-handler version | netty-tcnative-boringssl-static ver
399399
1.71.x-1.74.x | 4.1.110.Final | 2.0.70.Final
400400
1.75.x-1.76.x | 4.1.124.Final | 2.0.72.Final
401401
1.77.x-1.78.x | 4.1.127.Final | 2.0.74.Final
402-
1.79.x- | 4.1.130.Final | 2.0.74.Final
402+
1.79.x-1.80.x | 4.1.130.Final | 2.0.74.Final
403+
1.81.x- | 4.1.132.Final | 2.0.75.Final
403404

404405
_(grpc-netty-shaded avoids issues with keeping these versions in sync.)_
405406

alts/src/test/java/io/grpc/alts/internal/AltsProtocolNegotiatorTest.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,11 @@ public void operationComplete(ChannelFuture future) throws Exception {
202202
channel.flush();
203203

204204
// Capture the protected data written to the wire.
205-
assertEquals(1, channel.outboundMessages().size());
206-
ByteBuf protectedData = channel.readOutbound();
205+
assertThat(channel.outboundMessages()).isNotEmpty();
206+
ByteBuf protectedData = channel.alloc().buffer();
207+
while (!channel.outboundMessages().isEmpty()) {
208+
protectedData.writeBytes((ByteBuf) channel.readOutbound());
209+
}
207210
assertEquals(message.length(), writeCount.get());
208211

209212
// Read the protected message at the server and verify it matches the original message.
@@ -327,16 +330,18 @@ public void doNotFlushEmptyBuffer() throws Exception {
327330
String message = "hello";
328331
ByteBuf in = Unpooled.copiedBuffer(message, UTF_8);
329332

330-
assertEquals(0, protector.flushes.get());
333+
int flushes = protector.flushes.get();
331334
Future<?> done = channel.write(in);
332335
channel.flush();
336+
flushes++;
333337
done.get(5, TimeUnit.SECONDS);
334-
assertEquals(1, protector.flushes.get());
338+
assertEquals(flushes, protector.flushes.get());
335339

340+
// Flush does not propagate
336341
done = channel.write(Unpooled.EMPTY_BUFFER);
337342
channel.flush();
338343
done.get(5, TimeUnit.SECONDS);
339-
assertEquals(1, protector.flushes.get());
344+
assertEquals(flushes, protector.flushes.get());
340345
}
341346

342347
@Test

gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ mockito-android = "org.mockito:mockito-android:4.4.0"
101101
mockito-core = "org.mockito:mockito-core:4.4.0"
102102
# Need to decide when we require users to absorb the breaking changes in 4.2
103103
# checkForUpdates: netty-codec-http2:4.1.+
104-
netty-codec-http2 = "io.netty:netty-codec-http2:4.1.130.Final"
104+
netty-codec-http2 = "io.netty:netty-codec-http2:4.1.132.Final"
105105
# checkForUpdates: netty-handler-proxy:4.1.+
106-
netty-handler-proxy = "io.netty:netty-handler-proxy:4.1.130.Final"
106+
netty-handler-proxy = "io.netty:netty-handler-proxy:4.1.132.Final"
107107
# Keep the following references of tcnative version in sync whenever it's updated:
108108
# SECURITY.md
109-
netty-tcnative = "io.netty:netty-tcnative-boringssl-static:2.0.74.Final"
110-
netty-tcnative-classes = "io.netty:netty-tcnative-classes:2.0.74.Final"
109+
netty-tcnative = "io.netty:netty-tcnative-boringssl-static:2.0.75.Final"
110+
netty-tcnative-classes = "io.netty:netty-tcnative-classes:2.0.75.Final"
111111
# checkForUpdates: netty-transport-epoll:4.1.+
112-
netty-transport-epoll = "io.netty:netty-transport-native-epoll:4.1.130.Final"
112+
netty-transport-epoll = "io.netty:netty-transport-native-epoll:4.1.132.Final"
113113
# checkForUpdates: netty-unix-common:4.1.+
114-
netty-unix-common = "io.netty:netty-transport-native-unix-common:4.1.130.Final"
114+
netty-unix-common = "io.netty:netty-transport-native-unix-common:4.1.132.Final"
115115
okhttp = "com.squareup.okhttp:okhttp:2.7.5"
116116
# okio 3.5+ uses Kotlin 1.9+ which requires Android Gradle Plugin 9+
117117
# checkForUpdates: okio:3.4.+

repositories.bzl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
2727
"com.google.truth:truth:1.4.5",
2828
"com.squareup.okhttp:okhttp:2.7.5",
2929
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
30-
"io.netty:netty-buffer:4.1.130.Final",
31-
"io.netty:netty-codec-http2:4.1.130.Final",
32-
"io.netty:netty-codec-http:4.1.130.Final",
33-
"io.netty:netty-codec-socks:4.1.130.Final",
34-
"io.netty:netty-codec:4.1.130.Final",
35-
"io.netty:netty-common:4.1.130.Final",
36-
"io.netty:netty-handler-proxy:4.1.130.Final",
37-
"io.netty:netty-handler:4.1.130.Final",
38-
"io.netty:netty-resolver:4.1.130.Final",
39-
"io.netty:netty-tcnative-boringssl-static:2.0.74.Final",
40-
"io.netty:netty-tcnative-classes:2.0.74.Final",
41-
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.130.Final",
42-
"io.netty:netty-transport-native-unix-common:4.1.130.Final",
43-
"io.netty:netty-transport:4.1.130.Final",
30+
"io.netty:netty-buffer:4.1.132.Final",
31+
"io.netty:netty-codec-http2:4.1.132.Final",
32+
"io.netty:netty-codec-http:4.1.132.Final",
33+
"io.netty:netty-codec-socks:4.1.132.Final",
34+
"io.netty:netty-codec:4.1.132.Final",
35+
"io.netty:netty-common:4.1.132.Final",
36+
"io.netty:netty-handler-proxy:4.1.132.Final",
37+
"io.netty:netty-handler:4.1.132.Final",
38+
"io.netty:netty-resolver:4.1.132.Final",
39+
"io.netty:netty-tcnative-boringssl-static:2.0.75.Final",
40+
"io.netty:netty-tcnative-classes:2.0.75.Final",
41+
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.132.Final",
42+
"io.netty:netty-transport-native-unix-common:4.1.132.Final",
43+
"io.netty:netty-transport:4.1.132.Final",
4444
"io.opencensus:opencensus-api:0.31.0",
4545
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
4646
"io.perfmark:perfmark-api:0.27.0",
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright 2025 The gRPC Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.grpc.xds;
18+
19+
import com.google.common.collect.ImmutableList;
20+
import io.envoyproxy.envoy.extensions.filters.http.ext_authz.v3.ExtAuthz;
21+
import io.grpc.internal.GrpcUtil;
22+
import io.grpc.xds.client.Bootstrapper.BootstrapInfo;
23+
import io.grpc.xds.client.Bootstrapper.ServerInfo;
24+
import io.grpc.xds.internal.MatcherParser;
25+
import io.grpc.xds.internal.extauthz.ExtAuthzConfig;
26+
import io.grpc.xds.internal.extauthz.ExtAuthzParseException;
27+
import io.grpc.xds.internal.grpcservice.GrpcServiceConfig;
28+
import io.grpc.xds.internal.grpcservice.GrpcServiceParseException;
29+
import io.grpc.xds.internal.headermutations.HeaderMutationRulesParseException;
30+
import io.grpc.xds.internal.headermutations.HeaderMutationRulesParser;
31+
32+
33+
/**
34+
* Parser for {@link io.envoyproxy.envoy.extensions.filters.http.ext_authz.v3.ExtAuthz}.
35+
*/
36+
final class ExtAuthzConfigParser {
37+
38+
private ExtAuthzConfigParser() {}
39+
40+
/**
41+
* Parses the {@link io.envoyproxy.envoy.extensions.filters.http.ext_authz.v3.ExtAuthz} proto to
42+
* create an {@link ExtAuthzConfig} instance.
43+
*
44+
* @param extAuthzProto The ext_authz proto to parse.
45+
* @return An {@link ExtAuthzConfig} instance.
46+
* @throws ExtAuthzParseException if the proto is invalid or contains unsupported features.
47+
*/
48+
public static ExtAuthzConfig parse(
49+
ExtAuthz extAuthzProto, BootstrapInfo bootstrapInfo, ServerInfo serverInfo)
50+
throws ExtAuthzParseException {
51+
if (!extAuthzProto.hasGrpcService()) {
52+
throw new ExtAuthzParseException(
53+
"unsupported ExtAuthz service type: only grpc_service is supported");
54+
}
55+
GrpcServiceConfig grpcServiceConfig;
56+
try {
57+
grpcServiceConfig =
58+
GrpcServiceConfigParser.parse(extAuthzProto.getGrpcService(), bootstrapInfo, serverInfo);
59+
} catch (GrpcServiceParseException e) {
60+
throw new ExtAuthzParseException("Failed to parse GrpcService config: " + e.getMessage(), e);
61+
}
62+
ExtAuthzConfig.Builder builder = ExtAuthzConfig.builder().grpcService(grpcServiceConfig)
63+
.failureModeAllow(extAuthzProto.getFailureModeAllow())
64+
.failureModeAllowHeaderAdd(extAuthzProto.getFailureModeAllowHeaderAdd())
65+
.includePeerCertificate(extAuthzProto.getIncludePeerCertificate())
66+
.denyAtDisable(extAuthzProto.getDenyAtDisable().getDefaultValue().getValue());
67+
68+
if (extAuthzProto.hasFilterEnabled()) {
69+
try {
70+
builder.filterEnabled(
71+
MatcherParser.parseFractionMatcher(extAuthzProto.getFilterEnabled().getDefaultValue()));
72+
} catch (IllegalArgumentException e) {
73+
throw new ExtAuthzParseException(e.getMessage());
74+
}
75+
}
76+
77+
if (extAuthzProto.hasStatusOnError()) {
78+
builder.statusOnError(
79+
GrpcUtil.httpStatusToGrpcStatus(extAuthzProto.getStatusOnError().getCodeValue()));
80+
}
81+
82+
if (extAuthzProto.hasAllowedHeaders()) {
83+
builder.allowedHeaders(extAuthzProto.getAllowedHeaders().getPatternsList().stream()
84+
.map(MatcherParser::parseStringMatcher).collect(ImmutableList.toImmutableList()));
85+
}
86+
87+
if (extAuthzProto.hasDisallowedHeaders()) {
88+
builder.disallowedHeaders(extAuthzProto.getDisallowedHeaders().getPatternsList().stream()
89+
.map(MatcherParser::parseStringMatcher).collect(ImmutableList.toImmutableList()));
90+
}
91+
92+
if (extAuthzProto.hasDecoderHeaderMutationRules()) {
93+
try {
94+
builder.decoderHeaderMutationRules(
95+
HeaderMutationRulesParser.parse(extAuthzProto.getDecoderHeaderMutationRules()));
96+
} catch (HeaderMutationRulesParseException e) {
97+
throw new ExtAuthzParseException(e.getMessage(), e);
98+
}
99+
}
100+
101+
return builder.build();
102+
}
103+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright 2025 The gRPC Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.grpc.xds;
18+
19+
import com.google.auto.value.AutoValue;
20+
import io.grpc.Internal;
21+
import io.grpc.xds.client.AllowedGrpcServices;
22+
23+
/**
24+
* Custom configuration for gRPC xDS bootstrap implementation.
25+
*/
26+
@Internal
27+
@AutoValue
28+
public abstract class GrpcBootstrapImplConfig {
29+
public abstract AllowedGrpcServices allowedGrpcServices();
30+
31+
public static GrpcBootstrapImplConfig create(AllowedGrpcServices services) {
32+
return new AutoValue_GrpcBootstrapImplConfig(services);
33+
}
34+
}

0 commit comments

Comments
 (0)