Skip to content

Commit 19f250b

Browse files
authored
Merge pull request #49661 from jmartisk/main-issue-45407
Remove GraphQL client's legacy keystore/truststore configuration
2 parents f9d0cfc + 2d4c56f commit 19f250b

File tree

3 files changed

+9
-105
lines changed

3 files changed

+9
-105
lines changed

extensions/smallrye-graphql-client/deployment/src/test/java/io/quarkus/smallrye/graphql/client/deployment/GraphQLClientConfigurationTest.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ public class GraphQLClientConfigurationTest {
2323
.addAsResource(
2424
new StringAsset(
2525
"quarkus.smallrye-graphql-client.client1.url=https://localhost:8080\n" +
26-
"quarkus.smallrye-graphql-client.client1.key-store=classpath:my.keystore\n" +
27-
"quarkus.smallrye-graphql-client.client1.key-store-password=secret\n" +
28-
"quarkus.smallrye-graphql-client.client1.key-store-type=PKCS12\n" +
29-
"quarkus.smallrye-graphql-client.client1.trust-store=classpath:my.truststore\n" +
30-
"quarkus.smallrye-graphql-client.client1.trust-store-password=secret2\n" +
31-
"quarkus.smallrye-graphql-client.client1.trust-store-type=JKS\n" +
3226
"quarkus.smallrye-graphql-client.client1.proxy-host=myproxy\n" +
3327
"quarkus.smallrye-graphql-client.client1.proxy-port=1234\n" +
3428
"quarkus.smallrye-graphql-client.client1.proxy-username=dave\n" +
@@ -37,17 +31,6 @@ public class GraphQLClientConfigurationTest {
3731
"application.properties")
3832
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"));
3933

40-
@Test
41-
public void checkSslConfiguration() {
42-
GraphQLClientConfiguration config = GraphQLClientsConfiguration.getInstance().getClient("client1");
43-
assertEquals("classpath:my.keystore", config.getKeyStore());
44-
assertEquals("secret", config.getKeyStorePassword());
45-
assertEquals("PKCS12", config.getKeyStoreType());
46-
assertEquals("classpath:my.truststore", config.getTrustStore());
47-
assertEquals("secret2", config.getTrustStorePassword());
48-
assertEquals("JKS", config.getTrustStoreType());
49-
}
50-
5134
@Test
5235
public void checkProxyConfiguration() {
5336
GraphQLClientConfiguration config = GraphQLClientsConfiguration.getInstance().getClient("client1");

extensions/smallrye-graphql-client/runtime/src/main/java/io/quarkus/smallrye/graphql/client/runtime/GraphQLClientConfig.java

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -48,67 +48,6 @@ public interface GraphQLClientConfig {
4848
*/
4949
OptionalInt websocketInitializationTimeout();
5050

51-
/**
52-
* The trust store location. Can point to either a classpath resource or a file.
53-
*
54-
* @deprecated This configuration property is deprecated. Consider using the Quarkus TLS registry.
55-
* Set the desired TLS bucket name using the following configuration property:
56-
* {@code quarkus.smallrye-graphql-client."config-key".tls-bucket-name}.
57-
*/
58-
@Deprecated(forRemoval = true, since = "3.16.0")
59-
Optional<String> trustStore();
60-
61-
/**
62-
* The trust store password.
63-
*
64-
* @deprecated This configuration property is deprecated. Consider using the Quarkus TLS registry.
65-
* Set the desired TLS bucket name using the following configuration property:
66-
* {@code quarkus.smallrye-graphql-client."config-key".tls-bucket-name}.
67-
*/
68-
@Deprecated(forRemoval = true, since = "3.16.0")
69-
Optional<String> trustStorePassword();
70-
71-
/**
72-
* The type of the trust store. Defaults to "JKS".
73-
*
74-
* @deprecated This configuration property is deprecated. Consider using the Quarkus TLS registry.
75-
* Set the desired TLS bucket name using the following configuration property:
76-
* {@code quarkus.smallrye-graphql-client."config-key".tls-bucket-name}.
77-
*/
78-
@Deprecated(forRemoval = true, since = "3.16.0")
79-
Optional<String> trustStoreType();
80-
81-
/**
82-
* The key store location. Can point to either a classpath resource or a file.
83-
*
84-
* @deprecated This configuration property is deprecated. Consider using the Quarkus TLS registry.
85-
* Set the desired TLS bucket name using the following configuration property:
86-
* {@code quarkus.smallrye-graphql-client."config-key".tls-bucket-name}.
87-
*/
88-
@Deprecated(forRemoval = true, since = "3.16.0")
89-
Optional<String> keyStore();
90-
91-
/**
92-
* The key store password.
93-
*
94-
* @deprecated This configuration property is deprecated. Consider using the Quarkus TLS registry.
95-
* Set the desired TLS bucket name using the following configuration property:
96-
* {@code quarkus.smallrye-graphql-client."config-key".tls-bucket-name}.
97-
*/
98-
@Deprecated(forRemoval = true, since = "3.16.0")
99-
Optional<String> keyStorePassword();
100-
101-
/**
102-
* The type of the key store. Defaults to "JKS".
103-
*
104-
* @deprecated This configuration property is deprecated. Consider using the Quarkus TLS registry.
105-
* Set the desired TLS bucket name using the following configuration property:
106-
* {@code quarkus.smallrye-graphql-client."config-key".tls-bucket-name}.
107-
*
108-
*/
109-
@Deprecated(forRemoval = true, since = "3.16.0")
110-
Optional<String> keyStoreType();
111-
11251
/**
11352
* Hostname of the proxy to use.
11453
*/

extensions/smallrye-graphql-client/runtime/src/main/java/io/quarkus/smallrye/graphql/client/runtime/SmallRyeGraphQLClientRecorder.java

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -129,33 +129,15 @@ private GraphQLClientConfiguration toSmallRyeNativeConfiguration(GraphQLClientCo
129129
quarkusConfig.url().ifPresent(transformed::setUrl);
130130
transformed.setWebsocketSubprotocols(quarkusConfig.subprotocols().orElse(new ArrayList<>()));
131131

132-
// these properties are deprecated, but if they're present, they should override the TLS registry config
133-
// (smallrye-graphql gives them precedence)
134-
quarkusConfig.keyStore().ifPresent(transformed::setKeyStore);
135-
quarkusConfig.keyStoreType().ifPresent(transformed::setKeyStoreType);
136-
quarkusConfig.keyStorePassword().ifPresent(transformed::setKeyStorePassword);
137-
quarkusConfig.trustStore().ifPresent(transformed::setTrustStore);
138-
quarkusConfig.trustStoreType().ifPresent(transformed::setTrustStoreType);
139-
quarkusConfig.trustStorePassword().ifPresent(transformed::setTrustStorePassword);
140-
141-
// only apply TLS registry settings if quarkus.smallrye-graphql-client.CLIENT.key-store|trust-store were not specified
142-
if (quarkusConfig.keyStore().isEmpty() && quarkusConfig.trustStore().isEmpty()) {
143-
resolveTlsConfigurationForRegistry(quarkusConfig)
144-
.ifPresent(tlsConfiguration -> {
145-
transformed.setTlsKeyStoreOptions(tlsConfiguration.getKeyStoreOptions());
146-
transformed.setTlsTrustStoreOptions(tlsConfiguration.getTrustStoreOptions());
147-
transformed.setSslOptions(tlsConfiguration.getSSLOptions());
148-
tlsConfiguration.getHostnameVerificationAlgorithm()
149-
.ifPresent(transformed::setHostnameVerificationAlgorithm);
150-
transformed.setUsesSni(Boolean.valueOf(tlsConfiguration.usesSni()));
151-
});
152-
} else {
153-
quarkusConfig.tlsConfigurationName().ifPresent(name -> {
154-
logger.warn("TLS configuration " + name
155-
+ " was requested but specific keystore/truststore settings were applied too, " +
156-
" ignoring the TLS configuration");
157-
});
158-
}
132+
resolveTlsConfigurationForRegistry(quarkusConfig)
133+
.ifPresent(tlsConfiguration -> {
134+
transformed.setTlsKeyStoreOptions(tlsConfiguration.getKeyStoreOptions());
135+
transformed.setTlsTrustStoreOptions(tlsConfiguration.getTrustStoreOptions());
136+
transformed.setSslOptions(tlsConfiguration.getSSLOptions());
137+
tlsConfiguration.getHostnameVerificationAlgorithm()
138+
.ifPresent(transformed::setHostnameVerificationAlgorithm);
139+
transformed.setUsesSni(Boolean.valueOf(tlsConfiguration.usesSni()));
140+
});
159141

160142
quarkusConfig.proxyHost().ifPresent(transformed::setProxyHost);
161143
quarkusConfig.proxyPort().ifPresent(transformed::setProxyPort);

0 commit comments

Comments
 (0)