feat(common-es): ensure that keystore files are non-zero size
MODIFY
common/config/src/main/java/io/apiman/common/config/options/Predicates.java
common/config/src/main/java/io/apiman/common/config/options/Predicates.java
@@ -78,6 +78,10 @@ public class Predicates {
return Files::exists;
}
+ public static String fileEmptyMsg() {
+ return "file must not be empty";
+ }
+
public static Predicate<Path> fileSizeGreaterThanZero() {
return f -> {
try {

MODIFY
common/es/src/main/java/io/apiman/common/es/util/DefaultEsClientFactory.java
common/es/src/main/java/io/apiman/common/es/util/DefaultEsClientFactory.java
@@ -161,7 +161,7 @@ public class DefaultEsClientFactory extends AbstractClientFactory implements IEs
Path clientKeystorePath = config.getRequiredPath(
keys("client.keystore.path", "client.keystore"),
- Predicates.fileExists(),
+ Predicates.fileExists().and(Predicates.fileSizeGreaterThanZero()),
Predicates.fileExistsMsg("key store")
);
@@ -180,7 +180,7 @@ public class DefaultEsClientFactory extends AbstractClientFactory implements IEs
Path trustStorePath = config.getRequiredPath(
keys("client.truststore.path", "client.truststore"),
- Predicates.fileExists(),
+ Predicates.fileExists().and(Predicates.fileSizeGreaterThanZero()),
Predicates.fileExistsMsg("trust store")
);

MODIFY
gateway/platforms/vertx3/vertx3/src/main/generated/io/apiman/gateway/platforms/vertx3/common/config/InheritingHttpServerOptionsConverter.java
gateway/platforms/vertx3/vertx3/src/main/generated/io/apiman/gateway/platforms/vertx3/common/config/InheritingHttpServerOptionsConverter.java
@@ -148,6 +148,11 @@ public class InheritingHttpServerOptionsConverter {
obj.setMaxChunkSize(((Number)member.getValue()).intValue());
}
break;
+ case "maxFormAttributeSize":
+ if (member.getValue() instanceof Number) {
+ obj.setMaxFormAttributeSize(((Number)member.getValue()).intValue());
+ }
+ break;
case "maxHeaderSize":
if (member.getValue() instanceof Number) {
obj.setMaxHeaderSize(((Number)member.getValue()).intValue());
@@ -323,6 +328,11 @@ public class InheritingHttpServerOptionsConverter {
obj.setWebSocketAllowServerNoContext((Boolean)member.getValue());
}
break;
+ case "webSocketClosingTimeout":
+ if (member.getValue() instanceof Number) {
+ obj.setWebSocketClosingTimeout(((Number)member.getValue()).intValue());
+ }
+ break;
case "webSocketCompressionLevel":
if (member.getValue() instanceof Number) {
obj.setWebSocketCompressionLevel(((Number)member.getValue()).intValue());
@@ -427,6 +437,7 @@ public class InheritingHttpServerOptionsConverter {
}
json.put("logActivity", obj.getLogActivity());
json.put("maxChunkSize", obj.getMaxChunkSize());
+ json.put("maxFormAttributeSize", obj.getMaxFormAttributeSize());
json.put("maxHeaderSize", obj.getMaxHeaderSize());
json.put("maxInitialLineLength", obj.getMaxInitialLineLength());
json.put("maxWebSocketFrameSize", obj.getMaxWebSocketFrameSize());
@@ -476,6 +487,7 @@ public class InheritingHttpServerOptionsConverter {
json.put("useAlpn", obj.isUseAlpn());
json.put("usePooledBuffers", obj.isUsePooledBuffers());
json.put("webSocketAllowServerNoContext", obj.getWebSocketAllowServerNoContext());
+ json.put("webSocketClosingTimeout", obj.getWebSocketClosingTimeout());
json.put("webSocketCompressionLevel", obj.getWebSocketCompressionLevel());
json.put("webSocketPreferredClientNoContext", obj.getWebSocketPreferredClientNoContext());
if (obj.getWebSocketSubProtocols() != null) {

feat(common-es): ensure that keystore files are non-zero size