Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove deprecated SecurityConfigurator and Builder.secure() A…
…PIs (#1438)" (#1463) Motivation: Folks need more time to digest the deprecation and migrate to the new APIs. Modifications: - This reverts commit d032436.
- Loading branch information
1 parent
12ddffe
commit da4be45
Showing
32 changed files
with
2,466 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...cetalk-grpc-api/src/main/java/io/servicetalk/grpc/api/GrpcClientSecurityConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* Copyright © 2019 Apple Inc. and the ServiceTalk project authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.servicetalk.grpc.api; | ||
|
||
import io.servicetalk.transport.api.ClientSecurityConfigurator; | ||
import io.servicetalk.transport.api.ClientSslConfig; | ||
|
||
import java.io.InputStream; | ||
import java.util.function.Supplier; | ||
import javax.net.ssl.KeyManagerFactory; | ||
import javax.net.ssl.TrustManagerFactory; | ||
|
||
/** | ||
* A {@link ClientSecurityConfigurator} for {@link SingleAddressGrpcClientBuilder}. | ||
* @deprecated Use {@link GrpcClientBuilder#sslConfig(ClientSslConfig)}. | ||
* @param <U> the type of address before resolution (unresolved address) | ||
* @param <R> the type of address after resolution (resolved address) | ||
*/ | ||
@Deprecated | ||
public interface GrpcClientSecurityConfigurator<U, R> extends ClientSecurityConfigurator { | ||
/** | ||
* Commit configuring client security. | ||
* | ||
* @return Original {@link GrpcClientBuilder} that initiated the security configuration process. | ||
*/ | ||
GrpcClientBuilder<U, R> commit(); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> trustManager(Supplier<InputStream> trustCertChainSupplier); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> trustManager(TrustManagerFactory trustManagerFactory); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> protocols(String... protocols); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> ciphers(Iterable<String> ciphers); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> sessionCacheSize(long sessionCacheSize); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> sessionTimeout(long sessionTimeout); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> provider(SslProvider provider); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> hostnameVerificationAlgorithm( | ||
String hostNameVerificationAlgorithm); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> hostnameVerification(String hostNameVerificationAlgorithm, | ||
String hostNameVerificationHost); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> hostnameVerification(String hostNameVerificationAlgorithm, | ||
String hostNameVerificationHost, | ||
int hostNameVerificationPort); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> hostnameVerification(String hostNameVerificationHost); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> hostnameVerification(String hostNameVerificationHost, | ||
int hostNameVerificationPort); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> sniHostname(String sniHostname); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> disableHostnameVerification(); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> keyManager(KeyManagerFactory keyManagerFactory); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> keyManager(Supplier<InputStream> keyCertChainSupplier, | ||
Supplier<InputStream> keySupplier); | ||
|
||
@Override | ||
GrpcClientSecurityConfigurator<U, R> keyManager(Supplier<InputStream> keyCertChainSupplier, | ||
Supplier<InputStream> keySupplier, String keyPassword); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
...cetalk-grpc-api/src/main/java/io/servicetalk/grpc/api/GrpcServerSecurityConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
* Copyright © 2019 Apple Inc. and the ServiceTalk project authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.servicetalk.grpc.api; | ||
|
||
import io.servicetalk.transport.api.ServerSecurityConfigurator; | ||
import io.servicetalk.transport.api.ServerSslConfig; | ||
|
||
import java.io.InputStream; | ||
import java.util.function.Supplier; | ||
import javax.net.ssl.KeyManagerFactory; | ||
import javax.net.ssl.TrustManagerFactory; | ||
|
||
/** | ||
* A {@link ServerSecurityConfigurator} for {@link GrpcServerBuilder}. | ||
* @deprecated Use {@link GrpcServerBuilder#sslConfig(ServerSslConfig)}. | ||
*/ | ||
@Deprecated | ||
public interface GrpcServerSecurityConfigurator extends ServerSecurityConfigurator { | ||
@Override | ||
GrpcServerSecurityConfigurator trustManager(Supplier<InputStream> trustCertChainSupplier); | ||
|
||
@Override | ||
GrpcServerSecurityConfigurator trustManager(TrustManagerFactory trustManagerFactory); | ||
|
||
@Override | ||
GrpcServerSecurityConfigurator protocols(String... protocols); | ||
|
||
@Override | ||
GrpcServerSecurityConfigurator ciphers(Iterable<String> ciphers); | ||
|
||
@Override | ||
GrpcServerSecurityConfigurator sessionCacheSize(long sessionCacheSize); | ||
|
||
@Override | ||
GrpcServerSecurityConfigurator sessionTimeout(long sessionTimeout); | ||
|
||
@Override | ||
GrpcServerSecurityConfigurator provider(SslProvider provider); | ||
|
||
@Override | ||
GrpcServerSecurityConfigurator clientAuth(ClientAuth clientAuth); | ||
|
||
/** | ||
* Commit configuring server security. | ||
* | ||
* @param keyManagerFactory an {@link KeyManagerFactory}. | ||
* @return Original {@link GrpcServerBuilder} that initiated the security configuration process. | ||
*/ | ||
GrpcServerBuilder commit(KeyManagerFactory keyManagerFactory); | ||
|
||
/** | ||
* Commit configuring server security. | ||
* | ||
* @param keyCertChainSupplier an {@link Supplier} that will provide an input stream for a {@code X.509} certificate | ||
* chain in {@code PEM} format. | ||
* <p> | ||
* The responsibility to call {@link InputStream#close()} is transferred to callers of the {@link Supplier}. | ||
* If this is not the desired behavior then wrap the {@link InputStream} and override {@link InputStream#close()}. | ||
* @param keySupplier an {@link Supplier} that will provide an input stream for a {@code KCS#8} private key in | ||
* {@code PEM} format. | ||
* <p> | ||
* The responsibility to call {@link InputStream#close()} is transferred to callers of the {@link Supplier}. | ||
* If this is not the desired behavior then wrap the {@link InputStream} and override {@link InputStream#close()}. | ||
* @return Original {@link GrpcServerBuilder} that initiated the security configuration process. | ||
*/ | ||
GrpcServerBuilder commit(Supplier<InputStream> keyCertChainSupplier, Supplier<InputStream> keySupplier); | ||
|
||
/** | ||
* Commit configuring server security. | ||
* | ||
* @param keyCertChainSupplier an {@link Supplier} that will provide an input stream for a {@code X.509} certificate | ||
* chain in {@code PEM} format. | ||
* <p> | ||
* The responsibility to call {@link InputStream#close()} is transferred to callers of the {@link Supplier}. | ||
* If this is not the desired behavior then wrap the {@link InputStream} and override {@link InputStream#close()}. | ||
* @param keySupplier an {@link Supplier} that will provide an input stream for a {@code KCS#8} private key in | ||
* {@code PEM} format. | ||
* <p> | ||
* The responsibility to call {@link InputStream#close()} is transferred to callers of the {@link Supplier}. | ||
* If this is not the desired behavior then wrap the {@link InputStream} and override {@link InputStream#close()}. | ||
* @param keyPassword the password of the {@code keyFile}. | ||
* @return Original {@link GrpcServerBuilder} that initiated the security configuration process. | ||
*/ | ||
GrpcServerBuilder commit(Supplier<InputStream> keyCertChainSupplier, Supplier<InputStream> keySupplier, | ||
String keyPassword); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.