From 5d2065b3e764fcbbbba1d19994b983ea1c8de263 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 24 Mar 2016 12:31:51 +0000 Subject: [PATCH] Add some javadocs to ZuulProperties --- .../netflix/zuul/filters/ZuulProperties.java | 77 ++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/ZuulProperties.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/ZuulProperties.java index d3f1737f..03862c91 100644 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/ZuulProperties.java +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/ZuulProperties.java @@ -44,36 +44,75 @@ import lombok.NoArgsConstructor; public class ZuulProperties { /** - * + * Headers that are generally expected to be added by Spring Security, and hence often + * duplicated if the proxy and the backend are secured with Spring. By default they + * are added to the ignored headers if Spring Security is present. */ private static final List SECURITY_HEADERS = Arrays.asList("Pragma", "Cache-Control", "X-Frame-Options", "X-Content-Type-Options", "X-XSS-Protection", "Expires"); + /** + * A common prefix for all routes. + */ private String prefix = ""; + /** + * Flag saying whether to strip the prefix from the path before forwarding. + */ private boolean stripPrefix = true; + /** + * Flag for whether retry is supported by default (assuming the routes themselves + * support it). + */ private Boolean retryable; + /** + * Map of route names to properties. + */ private Map routes = new LinkedHashMap<>(); + /** + * Flag to determine whether the proxy adds X-Forwarded-* headers. + */ private boolean addProxyHeaders = true; + /** + * Set of service names not to consider for proxying automatically. By default all + * services in the discovery client will be proxied. + */ private Set ignoredServices = new LinkedHashSet<>(); private Set ignoredPatterns = new LinkedHashSet<>(); + /** + * Names of HTTP headers to ignore completely (i.e. leave them out of downstream + * requests and drop them from downstream responses). + */ private Set ignoredHeaders = new LinkedHashSet<>(); + /** + * Path to install Zuul as a servlet (not part of Spring MVC). The servlet is more + * memory efficient for requests with large bodies, e.g. file uploads. + */ private String servletPath = "/zuul"; private boolean ignoreLocalService = true; + /** + * Host properties controlling default connection pool properties. + */ private Host host = new Host(); + /** + * Flag to say that request bodies can be traced. + */ private boolean traceRequestBody = true; + /** + * Flag to say that path elelents past the first semicolon can be dropped. + */ private boolean removeSemicolonContent = true; public Set getIgnoredHeaders() { @@ -112,18 +151,48 @@ public class ZuulProperties { @NoArgsConstructor public static class ZuulRoute { + /** + * The ID of the route (the same as its map key by default). + */ private String id; + /** + * The path (pattern) for the route, e.g. /foo/**. + */ private String path; + /** + * The service ID (if any) to map to this route. You can specify a physical URL or + * a service, but not both. + */ private String serviceId; + /** + * A full physical URL to map to the route. An alternative is to use a service ID + * and service discovery to find the physical address. + */ private String url; + /** + * Flag to determine whether the prefix for this route (the path, minus pattern + * patcher) should be stripped before forwarding. + */ private boolean stripPrefix = true; + /** + * Flag to indicate that this route should be retryable (if supported). Generally + * retry requires a service ID and ribbon. + */ private Boolean retryable; + /** + * List of sensitive headers that are not passed to downstream requests. Defaults + * to a "safe" set of headers that commonly contain user credentials. It's OK to + * remove those from the list if the downstream service is part of the same system + * as the proxy, so they are sharing authentication data. If using a physical URL + * outside your own domain, then generally it would be a bad idea to leak user + * credentials. + */ private Set sensitiveHeaders = new LinkedHashSet<>( Arrays.asList("Cookie", "Set-Cookie", "Authorization")); @@ -184,7 +253,13 @@ public class ZuulProperties { @AllArgsConstructor @NoArgsConstructor public static class Host { + /** + * The maximum number of total connections the proxy can hold open to backends. + */ private int maxTotalConnections = 200; + /** + * The maximum number of connections that can be used by a single route. + */ private int maxPerRouteConnections = 20; }