Skip to content

Commit 5ba39b3

Browse files
committed
Remove whitespace only formatting done by wrong indendation settings in Intellij.
1 parent c19a24f commit 5ba39b3

File tree

11 files changed

+63
-162
lines changed

11 files changed

+63
-162
lines changed

examples/example-xds/xds-client.Dockerfile

Lines changed: 0 additions & 47 deletions
This file was deleted.

examples/example-xds/xds-server.Dockerfile

Lines changed: 0 additions & 47 deletions
This file was deleted.

interop-testing/src/main/java/io/grpc/testing/integration/XdsTestClient.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,12 @@ public void onNext(SimpleResponse response) {
452452

453453
private void handleRpcCompleted(long requestId, RpcType rpcType, String hostname,
454454
Set<XdsStatsWatcher> watchers) {
455-
logger.info("RPC completed");
456455
statsAccumulator.recordRpcFinished(rpcType, Status.OK);
457456
notifyWatchers(watchers, rpcType, requestId, hostname);
458457
}
459458

460459
private void handleRpcError(long requestId, RpcType rpcType, Status status,
461460
Set<XdsStatsWatcher> watchers) {
462-
logger.info("RPC error with status " + status);
463461
statsAccumulator.recordRpcFinished(rpcType, status);
464462
notifyWatchers(watchers, rpcType, requestId, null);
465463
}

netty/src/main/java/io/grpc/netty/InternalProtocolNegotiators.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import io.netty.channel.ChannelHandler;
2626
import io.netty.handler.ssl.SslContext;
2727
import io.netty.util.AsciiString;
28-
2928
import javax.net.ssl.TrustManager;
3029
import javax.net.ssl.X509TrustManager;
3130
import java.util.concurrent.Executor;
@@ -45,10 +44,11 @@ private InternalProtocolNegotiators() {}
4544
* @param executorPool a dedicated {@link Executor} pool for time-consuming TLS tasks
4645
*/
4746
public static InternalProtocolNegotiator.ProtocolNegotiator tls(SslContext sslContext,
48-
ObjectPool<? extends Executor> executorPool,
49-
Optional<Runnable> handshakeCompleteRunnable,
50-
TrustManager extendedX509TrustManager,
51-
String sni, boolean isXdsTarget) {
47+
ObjectPool<? extends Executor> executorPool,
48+
Optional<Runnable> handshakeCompleteRunnable,
49+
TrustManager extendedX509TrustManager,
50+
String sni,
51+
boolean isXdsTarget) {
5252
final io.grpc.netty.ProtocolNegotiator negotiator = ProtocolNegotiators.tls(sslContext,
5353
executorPool, handshakeCompleteRunnable, (X509TrustManager) extendedX509TrustManager, sni,
5454
isXdsTarget);
@@ -163,7 +163,7 @@ public void close() {
163163
* Internal version of {@link WaitUntilActiveHandler}.
164164
*/
165165
public static ChannelHandler waitUntilActiveHandler(ChannelHandler next,
166-
ChannelLogger negotiationLogger) {
166+
ChannelLogger negotiationLogger) {
167167
return new WaitUntilActiveHandler(next, negotiationLogger);
168168
}
169169

@@ -185,12 +185,12 @@ public static class ProtocolNegotiationHandler
185185
extends ProtocolNegotiators.ProtocolNegotiationHandler {
186186

187187
protected ProtocolNegotiationHandler(ChannelHandler next, String negotiatorName,
188-
ChannelLogger negotiationLogger) {
188+
ChannelLogger negotiationLogger) {
189189
super(next, negotiatorName, negotiationLogger);
190190
}
191191

192192
protected ProtocolNegotiationHandler(ChannelHandler next, ChannelLogger negotiationLogger) {
193193
super(next, negotiationLogger);
194194
}
195195
}
196-
}
196+
}

netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static FromChannelCredentialsResult from(ChannelCredentials creds) {
132132
trustManagers = tlsCreds.getTrustManagers();
133133
} else if (tlsCreds.getRootCertificates() != null) {
134134
trustManagers = Arrays.asList(CertificateUtils.createTrustManager(
135-
new ByteArrayInputStream(tlsCreds.getRootCertificates())));
135+
new ByteArrayInputStream(tlsCreds.getRootCertificates())));
136136
} else { // else use system default
137137
TrustManagerFactory tmf = TrustManagerFactory.getInstance(
138138
TrustManagerFactory.getDefaultAlgorithm());
@@ -265,7 +265,7 @@ public static final class FromChannelCredentialsResult {
265265
public final String error;
266266

267267
private FromChannelCredentialsResult(ProtocolNegotiator.ClientFactory negotiator,
268-
CallCredentials creds, String error) {
268+
CallCredentials creds, String error) {
269269
this.negotiator = negotiator;
270270
this.callCredentials = creds;
271271
this.error = error;
@@ -379,7 +379,7 @@ public ProtocolNegotiator newNegotiator(ObjectPool<? extends Executor> offloadEx
379379
* @param executorPool a dedicated {@link Executor} pool for time-consuming TLS tasks
380380
*/
381381
public static ProtocolNegotiator serverTls(final SslContext sslContext,
382-
final ObjectPool<? extends Executor> executorPool) {
382+
final ObjectPool<? extends Executor> executorPool) {
383383
Preconditions.checkNotNull(sslContext, "sslContext");
384384
final Executor executor;
385385
if (executorPool != null) {
@@ -428,8 +428,8 @@ static final class ServerTlsHandler extends ChannelInboundHandlerAdapter {
428428
private ProtocolNegotiationEvent pne = ProtocolNegotiationEvent.DEFAULT;
429429

430430
ServerTlsHandler(ChannelHandler next,
431-
SslContext sslContext,
432-
final ObjectPool<? extends Executor> executorPool) {
431+
SslContext sslContext,
432+
final ObjectPool<? extends Executor> executorPool) {
433433
this.sslContext = Preconditions.checkNotNull(sslContext, "sslContext");
434434
this.next = Preconditions.checkNotNull(next, "next");
435435
if (executorPool != null) {
@@ -486,9 +486,8 @@ private void fireProtocolNegotiationEvent(ChannelHandlerContext ctx, SSLSession
486486
* Returns a {@link ProtocolNegotiator} that does HTTP CONNECT proxy negotiation.
487487
*/
488488
public static ProtocolNegotiator httpProxy(final SocketAddress proxyAddress,
489-
final @Nullable String proxyUsername,
490-
final @Nullable String proxyPassword,
491-
final ProtocolNegotiator negotiator) {
489+
final @Nullable String proxyUsername, final @Nullable String proxyPassword,
490+
final ProtocolNegotiator negotiator) {
492491
Preconditions.checkNotNull(negotiator, "negotiator");
493492
Preconditions.checkNotNull(proxyAddress, "proxyAddress");
494493
final AsciiString scheme = negotiator.scheme();
@@ -565,10 +564,8 @@ protected void userEventTriggered0(ChannelHandlerContext ctx, Object evt) throws
565564
static final class ClientTlsProtocolNegotiator implements ProtocolNegotiator {
566565

567566
public ClientTlsProtocolNegotiator(SslContext sslContext,
568-
ObjectPool<? extends Executor> executorPool,
569-
Optional<Runnable> handshakeCompleteRunnable,
570-
X509TrustManager x509ExtendedTrustManager,
571-
String sni, boolean isXdsTarget) {
567+
ObjectPool<? extends Executor> executorPool, Optional<Runnable> handshakeCompleteRunnable,
568+
X509TrustManager x509ExtendedTrustManager, String sni, boolean isXdsTarget) {
572569
this.sslContext = Preconditions.checkNotNull(sslContext, "sslContext");
573570
this.executorPool = executorPool;
574571
if (this.executorPool != null) {
@@ -628,10 +625,10 @@ static final class ClientTlsHandler extends ProtocolNegotiationHandler {
628625
private SSLEngine sslEngine;
629626

630627
ClientTlsHandler(ChannelHandler next, SslContext sslContext, String sniHostPort,
631-
Executor executor, ChannelLogger negotiationLogger,
632-
Optional<Runnable> handshakeCompleteRunnable,
633-
ClientTlsProtocolNegotiator clientTlsProtocolNegotiator,
634-
X509TrustManager x509ExtendedTrustManager) {
628+
Executor executor, ChannelLogger negotiationLogger,
629+
Optional<Runnable> handshakeCompleteRunnable,
630+
ClientTlsProtocolNegotiator clientTlsProtocolNegotiator,
631+
X509TrustManager x509ExtendedTrustManager) {
635632
super(next, negotiationLogger);
636633
this.sslContext = Preconditions.checkNotNull(sslContext, "sslContext");
637634
if (!Strings.isNullOrEmpty(sniHostPort)) {
@@ -753,8 +750,8 @@ static HostPort parseAuthority(String authority) {
753750
* @param executorPool a dedicated {@link Executor} pool for time-consuming TLS tasks
754751
*/
755752
public static ProtocolNegotiator tls(SslContext sslContext,
756-
ObjectPool<? extends Executor> executorPool, Optional<Runnable> handshakeCompleteRunnable,
757-
X509TrustManager x509ExtendedTrustManager, String sni, boolean isXdsTarget) {
753+
ObjectPool<? extends Executor> executorPool, Optional<Runnable> handshakeCompleteRunnable,
754+
X509TrustManager x509ExtendedTrustManager, String sni, boolean isXdsTarget) {
758755
return new ClientTlsProtocolNegotiator(sslContext, executorPool, handshakeCompleteRunnable,
759756
x509ExtendedTrustManager, sni, isXdsTarget);
760757
}
@@ -938,7 +935,7 @@ private static RuntimeException unavailableException(String msg) {
938935

939936
@VisibleForTesting
940937
static void logSslEngineDetails(Level level, ChannelHandlerContext ctx, String msg,
941-
@Nullable Throwable t) {
938+
@Nullable Throwable t) {
942939
if (!log.isLoggable(level)) {
943940
return;
944941
}
@@ -1064,8 +1061,8 @@ static final class PlaintextHandler extends ProtocolNegotiationHandler {
10641061
protected void protocolNegotiationEventTriggered(ChannelHandlerContext ctx) {
10651062
ProtocolNegotiationEvent existingPne = getProtocolNegotiationEvent();
10661063
Attributes attrs = existingPne.getAttributes().toBuilder()
1067-
.set(GrpcAttributes.ATTR_AUTHORITY_VERIFIER, (authority) -> Status.OK)
1068-
.build();
1064+
.set(GrpcAttributes.ATTR_AUTHORITY_VERIFIER, (authority) -> Status.OK)
1065+
.build();
10691066
replaceProtocolNegotiationEvent(existingPne.withAttributes(attrs));
10701067
fireProtocolNegotiationEvent(ctx);
10711068
}
@@ -1127,7 +1124,7 @@ static class ProtocolNegotiationHandler extends ChannelDuplexHandler {
11271124
private final ChannelLogger negotiationLogger;
11281125

11291126
protected ProtocolNegotiationHandler(ChannelHandler next, String negotiatorName,
1130-
ChannelLogger negotiationLogger) {
1127+
ChannelLogger negotiationLogger) {
11311128
this.next = Preconditions.checkNotNull(next, "next");
11321129
this.negotiatorName = negotiatorName;
11331130
this.negotiationLogger = Preconditions.checkNotNull(negotiationLogger, "negotiationLogger");

xds/src/main/java/io/grpc/xds/EnvoyServerProtoData.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static DownstreamTlsContext fromEnvoyProtoDownstreamTlsContext(
138138
io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
139139
downstreamTlsContext) {
140140
return new DownstreamTlsContext(downstreamTlsContext.getCommonTlsContext(),
141-
downstreamTlsContext.hasRequireClientCertificate());
141+
downstreamTlsContext.hasRequireClientCertificate());
142142
}
143143

144144
public boolean isRequireClientCertificate() {
@@ -224,10 +224,10 @@ abstract static class FilterChainMatch {
224224
abstract String transportProtocol();
225225

226226
public static FilterChainMatch create(int destinationPort,
227-
ImmutableList<CidrRange> prefixRanges,
228-
ImmutableList<String> applicationProtocols, ImmutableList<CidrRange> sourcePrefixRanges,
229-
ConnectionSourceType connectionSourceType, ImmutableList<Integer> sourcePorts,
230-
ImmutableList<String> serverNames, String transportProtocol) {
227+
ImmutableList<CidrRange> prefixRanges,
228+
ImmutableList<String> applicationProtocols, ImmutableList<CidrRange> sourcePrefixRanges,
229+
ConnectionSourceType connectionSourceType, ImmutableList<Integer> sourcePorts,
230+
ImmutableList<String> serverNames, String transportProtocol) {
231231
return new AutoValue_EnvoyServerProtoData_FilterChainMatch(
232232
destinationPort, prefixRanges, applicationProtocols, sourcePrefixRanges,
233233
connectionSourceType, sourcePorts, serverNames, transportProtocol);
@@ -439,4 +439,4 @@ static FailurePercentageEjection create(
439439
enforcementPercentage, minimumHosts, requestVolume);
440440
}
441441
}
442-
}
442+
}

xds/src/main/java/io/grpc/xds/internal/security/SecurityProtocolNegotiators.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
196196
@VisibleForTesting
197197
static final class ClientSecurityHandler
198198
extends InternalProtocolNegotiators.ProtocolNegotiationHandler {
199-
200199
private final GrpcHttp2ConnectionHandler grpcHandler;
201200
private final SslContextProviderSupplier sslContextProviderSupplier;
202201
private final String sni;
@@ -321,10 +320,10 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exc
321320
if (evt instanceof ProtocolNegotiationEvent) {
322321
ProtocolNegotiationEvent pne = (ProtocolNegotiationEvent)evt;
323322
SslContextProviderSupplier sslContextProviderSupplier = InternalProtocolNegotiationEvent
324-
.getAttributes(pne).get(ATTR_SERVER_SSL_CONTEXT_PROVIDER_SUPPLIER);
323+
.getAttributes(pne).get(ATTR_SERVER_SSL_CONTEXT_PROVIDER_SUPPLIER);
325324
if (sslContextProviderSupplier == null) {
326325
logger.log(Level.FINE, "No sslContextProviderSupplier found in filterChainMatch "
327-
+ "for connection from {0} to {1}",
326+
+ "for connection from {0} to {1}",
328327
new Object[]{ctx.channel().remoteAddress(), ctx.channel().localAddress()});
329328
if (fallbackProtocolNegotiator == null) {
330329
ctx.fireExceptionCaught(new CertStoreException("No certificate source found!"));
@@ -406,7 +405,7 @@ public void onException(Throwable throwable) {
406405
ctx.fireExceptionCaught(throwable);
407406
}
408407
},
409-
null);
408+
null);
410409
}
411410
}
412411
}

xds/src/main/java/io/grpc/xds/internal/security/certprovider/CertProviderClientSslContextProvider.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ final class CertProviderClientSslContextProvider extends CertProviderSslContextP
4949
private final String sniForSanMatching;
5050

5151
CertProviderClientSslContextProvider(
52-
Node node,
53-
@Nullable Map<String, CertificateProviderInfo> certProviders,
54-
CommonTlsContext.CertificateProviderInstance certInstance,
55-
CommonTlsContext.CertificateProviderInstance rootCertInstance,
56-
CertificateValidationContext staticCertValidationContext,
57-
UpstreamTlsContext upstreamTlsContext,
58-
String sniForSanMatching, CertificateProviderStore certificateProviderStore) {
52+
Node node,
53+
@Nullable Map<String, CertificateProviderInfo> certProviders,
54+
CommonTlsContext.CertificateProviderInstance certInstance,
55+
CommonTlsContext.CertificateProviderInstance rootCertInstance,
56+
CertificateValidationContext staticCertValidationContext,
57+
UpstreamTlsContext upstreamTlsContext,
58+
String sniForSanMatching,
59+
CertificateProviderStore certificateProviderStore) {
5960
super(
6061
node,
6162
certProviders,

xds/src/main/java/io/grpc/xds/internal/security/trust/XdsTrustManagerFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public XdsTrustManagerFactory(
6969
}
7070

7171
public XdsTrustManagerFactory(Map<String, List<X509Certificate>> spiffeTrustMap,
72-
CertificateValidationContext staticCertificateValidationContext, String sniForSanMatching) throws CertStoreException {
72+
CertificateValidationContext staticCertificateValidationContext, String sniForSanMatching) throws CertStoreException {
7373
this(spiffeTrustMap, staticCertificateValidationContext, true, sniForSanMatching);
7474
}
7575

@@ -125,14 +125,14 @@ private static X509Certificate[] getTrustedCaFromCertContext(
125125

126126
@VisibleForTesting
127127
static XdsX509TrustManager createX509TrustManager(
128-
X509Certificate[] certs, CertificateValidationContext certContext, String sniForSanMatching) throws CertStoreException {
128+
X509Certificate[] certs, CertificateValidationContext certContext, String sniForSanMatching) throws CertStoreException {
129129
return new XdsX509TrustManager(certContext, createTrustManager(certs), sniForSanMatching);
130130
}
131131

132132
@VisibleForTesting
133133
static XdsX509TrustManager createX509TrustManager(
134-
Map<String, List<X509Certificate>> spiffeTrustMapFile,
135-
CertificateValidationContext certContext, String sniForSanMatching) throws CertStoreException {
134+
Map<String, List<X509Certificate>> spiffeTrustMapFile,
135+
CertificateValidationContext certContext, String sniForSanMatching) throws CertStoreException {
136136
checkNotNull(spiffeTrustMapFile, "spiffeTrustMapFile");
137137
Map<String, X509ExtendedTrustManager> delegates = new HashMap<>();
138138
for (Map.Entry<String, List<X509Certificate>> entry:spiffeTrustMapFile.entrySet()) {

xds/src/main/java/io/grpc/xds/internal/security/trust/XdsX509TrustManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ final class XdsX509TrustManager extends X509ExtendedTrustManager implements X509
7979
}
8080

8181
XdsX509TrustManager(@Nullable CertificateValidationContext certContext,
82-
Map<String, X509ExtendedTrustManager> spiffeTrustMapDelegates, @Nullable String sniForSanMatching) {
82+
Map<String, X509ExtendedTrustManager> spiffeTrustMapDelegates, @Nullable String sniForSanMatching) {
8383
checkNotNull(spiffeTrustMapDelegates, "spiffeTrustMapDelegates");
8484
this.spiffeTrustMapDelegates = ImmutableMap.copyOf(spiffeTrustMapDelegates);
8585
this.certContext = certContext;

0 commit comments

Comments
 (0)