mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(elbv2): validate listener port ranges (#6459)
This commit is contained in:
1 parent
2c0f48e203
commit
f6126964aa
4 files changed
+68
-1
No files matched your search
@@ -468,6 +468,7 @@ public class ElbV2QueryHandler {
|
||||
String listenerArn = p.getFirst("ListenerArn");
|
||||
String protocol = p.getFirst("Protocol");
|
||||
Integer port = parseIntOrNull(p.getFirst("Port"));
|
||||
ElbV2Service.validatePort(port, "port");
|
||||
String sslPolicy = p.getFirst("SslPolicy");
|
||||
List<String> certs = parseCertificateList(p, "Certificates");
|
||||
List<Action> defaultActions = parseActions(p, "DefaultActions", false);
|
||||
|
||||
@@ -603,6 +603,7 @@ public class ElbV2Service implements ResourceProvider, ServerCertificateReferenc
|
||||
String sslPolicy, List<String> certificates,
|
||||
List<Action> defaultActions, List<String> alpnPolicy,
|
||||
Map<String, String> initialTags) {
|
||||
validatePort(port, "port");
|
||||
requireLoadBalancer(region, lbArn);
|
||||
|
||||
Map<String, Listener> regionListeners = listeners.computeIfAbsent(region, k -> new ConcurrentHashMap<>());
|
||||
@@ -742,6 +743,7 @@ public class ElbV2Service implements ResourceProvider, ServerCertificateReferenc
|
||||
public Listener modifyListener(String region, String listenerArn, String protocol, Integer port,
|
||||
String sslPolicy, List<String> certificates,
|
||||
List<Action> defaultActions, List<String> alpnPolicy) {
|
||||
validatePort(port, "port");
|
||||
while (true) {
|
||||
Listener initial = requireListener(region, listenerArn);
|
||||
LoadBalancer initialLb = requireLoadBalancer(region, initial.getLoadBalancerArn());
|
||||
@@ -1585,7 +1587,7 @@ public class ElbV2Service implements ResourceProvider, ServerCertificateReferenc
|
||||
}
|
||||
}
|
||||
|
||||
private static void validatePort(Integer port, String member) {
|
||||
static void validatePort(Integer port, String member) {
|
||||
List<String> violations = new ArrayList<>();
|
||||
addPortViolation(violations, port, member);
|
||||
if (!violations.isEmpty()) {
|
||||
|
||||
Reference in new issue
Block a user