Commit 5d2065b3 by Dave Syer

Add some javadocs to ZuulProperties

parent c57a758e
......@@ -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<String> 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<String, ZuulRoute> 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<String> ignoredServices = new LinkedHashSet<>();
private Set<String> 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<String> 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<String> 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<String> 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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment