Fix build issues - Spring Boot plugin, imports, and ENV default #116

Merged
hitanshu merged 18 commits from Dave/CFTunnels:ISSUE-114 into test 2026-04-18 16:16:05 +00:00
Showing only changes of commit 4197e645cd - Show all commits

View File

@ -8,19 +8,88 @@ import lombok.Setter;
import java.util.List;
import java.util.Map;
/**
* Model representing an ingress rule for a Cloudflare Tunnel.
*
* <p>Ingress rules define how incoming requests should be routed through
* the tunnel to your internal services. Each rule specifies:</p>
* <ul>
* <li>{@link #hostname} - The domain/subdomain to match</li>
* <li>{@link #service} - The internal service URL</li>
* <li>{@link #originRequest} - Optional settings for origin requests</li>
* <li>{@link #path} - Optional path prefix to match</li>
* </ul>
*
* <p><b>Example JSON:</b></p>
* <pre>
* {
* "hostname": "api.example.com",
* "service": "http://localhost:8080",
* "originRequest": {
* "noTLSVerify": true
* },
* "path": "/api"
* }
* </pre>
*
* @see <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/routing/ingress/">Cloudflare Ingress Docs</a>
*/
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class Ingress {
/**
* The target service URL.
*
* <p>Format: {@code protocol://host:port}</p>
* <p>Example: {@code http://localhost:8080}</p>
*/
private String service;
/**
* Hostname pattern to match for this ingress rule.
*
* <p>Can be a full domain (api.example.com) or use wildcards
* (*.example.com) to match subdomains.</p>
* <p>If null, this rule acts as a catch-all.</p>
*/
private String hostname;
/**
* Optional settings for requests to the origin server.
*
* <p>Supported options:</p>
* <ul>
* <li>noTLSVerify - Skip TLS verification</li>
* <li>connectTimeout - Connection timeout in seconds</li>
* <li>tlsTimeout - TLS handshake timeout</li>
* <li>httpHostHeader - Host header to send</li>
* </ul>
*/
private Map<String, Object> originRequest;
/**
* Optional path to match before routing.
*
* <p>Example: "/api" would only route requests with
* paths starting with /api to this service.</p>
*/
private String path;
/**
* Removes an ingress rule by hostname from a list.
*
* <p>This utility method finds and removes the first ingress
* matching the given hostname.</p>
*
* @param ingressList List of ingress rules to modify
* @param toBeDeleted Hostname of the rule to remove
* @return true if an ingress was removed, false otherwise
*/
public static boolean deleteByHostName(List<Ingress> ingressList, String toBeDeleted){
return ingressList.removeIf(ingress -> ingress.getHostname() != null && ingress.getHostname().equals(toBeDeleted));
}
}
}