Skip to content

Commit 5d0e812

Browse files
committed
Merge branch '2.0.x'
2 parents d445ed7 + 1b10d3f commit 5d0e812

File tree

8 files changed

+391
-139
lines changed

8 files changed

+391
-139
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,68 @@
297297
"level": "error"
298298
}
299299
},
300+
{
301+
"name": "management.server.ssl.ciphers",
302+
"description": "Supported SSL ciphers."
303+
},
304+
{
305+
"name": "management.server.ssl.client-auth",
306+
"description": "Whether client authentication is wanted (\"want\") or needed (\"need\"). Requires a trust store."
307+
},
308+
{
309+
"name": "management.server.ssl.enabled",
310+
"description": "Whether to enable SSL support.",
311+
"defaultValue": true
312+
},
313+
{
314+
"name": "management.server.ssl.enabled-protocols",
315+
"description": "Enabled SSL protocols."
316+
},
317+
{
318+
"name": "management.server.ssl.key-alias",
319+
"description": "Alias that identifies the key in the key store."
320+
},
321+
{
322+
"name": "management.server.ssl.key-password",
323+
"description": "Password used to access the key in the key store."
324+
},
325+
{
326+
"name": "management.server.ssl.key-store",
327+
"description": "Path to the key store that holds the SSL certificate (typically a jks file)."
328+
},
329+
{
330+
"name": "management.server.ssl.key-store-password",
331+
"description": "Password used to access the key store."
332+
},
333+
{
334+
"name": "management.server.ssl.key-store-provider",
335+
"description": "Provider for the key store."
336+
},
337+
{
338+
"name": "management.server.ssl.key-store-type",
339+
"description": "Type of the key store."
340+
},
341+
{
342+
"name": "management.server.ssl.protocol",
343+
"description": "SSL protocol to use.",
344+
"defaultValue": "TLS"
345+
},
346+
{
347+
"name": "management.server.ssl.trust-store",
348+
"description": "Trust store that holds SSL certificates."
349+
},
350+
{
351+
"name": "management.server.ssl.trust-store-password",
352+
"description": "Password used to access the trust store."
353+
},
354+
{
355+
"name": "management.server.ssl.trust-store-provider",
356+
"description": "Provider for the trust store."
357+
},
358+
{
359+
"name": "management.server.ssl.trust-store-type",
360+
"description": "Type of the trust store."
361+
},
300362
{
301363
"name": "management.trace.http.enabled",
302364
"type": "java.lang.Boolean",

spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 150 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,169 @@
2929
"level": "error"
3030
}
3131
},
32+
{
33+
"name": "server.compression.enabled",
34+
"description": "Whether response compression is enabled.",
35+
"defaultValue": false
36+
},
37+
{
38+
"name": "server.compression.excluded-user-agents",
39+
"description": "Comma-separated list of user agents for which responses should not be compressed."
40+
},
41+
{
42+
"name": "server.compression.mime-types",
43+
"description": "Comma-separated list of MIME types that should be compressed.",
44+
"defaultValue": [
45+
"text/html",
46+
"text/xml",
47+
"text/plain",
48+
"text/css",
49+
"text/javascript",
50+
"application/javascript",
51+
"application/json",
52+
"application/xml"
53+
]
54+
},
3255
{
3356
"name": "server.compression.min-response-size",
3457
"description": "Minimum \"Content-Length\" value that is required for compression to be performed.",
35-
"type": "org.springframework.util.unit.DataSize",
3658
"defaultValue": "2KB"
3759
},
3860
{
3961
"name": "server.error.include-stacktrace",
4062
"defaultValue": "never"
4163
},
64+
{
65+
"name": "server.http2.enabled",
66+
"description": "Whether to enable HTTP/2 support, if the current environment supports it.",
67+
"defaultValue": false
68+
},
4269
{
4370
"name": "server.port",
4471
"defaultValue": 8080
4572
},
73+
{
74+
"name": "server.servlet.jsp.class-name",
75+
"description": "Class name of the servlet to use for JSPs. If registered is true and this class\n\t * is on the classpath then it will be registered.",
76+
"defaultValue": "org.apache.jasper.servlet.JspServlet"
77+
},
78+
{
79+
"name": "server.servlet.jsp.init-parameters",
80+
"description": "Init parameters used to configure the JSP servlet."
81+
},
82+
{
83+
"name": "server.servlet.jsp.registered",
84+
"description": "Whether the JSP servlet is registered.",
85+
"defaultValue": true
86+
},
87+
{
88+
"name": "server.servlet.session.cookie.comment",
89+
"description": "Comment for the session cookie."
90+
},
91+
{
92+
"name": "server.servlet.session.cookie.domain",
93+
"description": " Domain for the session cookie."
94+
},
95+
{
96+
"name": "server.servlet.session.cookie.http-only",
97+
"description": "Whether to use \"HttpOnly\" cookies for session cookies."
98+
},
99+
{
100+
"name": "server.servlet.session.cookie.max-age",
101+
"description": "Maximum age of the session cookie. If a duration suffix is not specified, seconds will be used."
102+
},
103+
{
104+
"name": "server.servlet.session.cookie.name",
105+
"description": "Session cookie name."
106+
},
107+
{
108+
"name": "server.servlet.session.cookie.path",
109+
"description": "Path of the session cookie."
110+
},
111+
{
112+
"name": "server.servlet.session.cookie.secure",
113+
"description": "Whether to always mark the session cookie as secure."
114+
},
115+
{
116+
"name": "server.servlet.session.persistent",
117+
"description": "Whether to persist session data between restarts.",
118+
"defaultValue": false
119+
},
120+
{
121+
"name": "server.servlet.session.store-dir",
122+
"description": "Directory used to store session data."
123+
},
124+
{
125+
"name": "server.servlet.session.timeout",
126+
"description": "Session timeout. If a duration suffix is not specified, seconds will be used.",
127+
"defaultValue": "30m"
128+
},
129+
{
130+
"name": "server.servlet.session.tracking-modes",
131+
"description": "Session tracking modes."
132+
},
133+
{
134+
"name": "server.ssl.ciphers",
135+
"description": "Supported SSL ciphers."
136+
},
137+
{
138+
"name": "server.ssl.client-auth",
139+
"description": "Whether client authentication is wanted (\"want\") or needed (\"need\"). Requires a trust store."
140+
},
141+
{
142+
"name": "server.ssl.enabled",
143+
"description": "Whether to enable SSL support.",
144+
"defaultValue": true
145+
},
146+
{
147+
"name": "server.ssl.enabled-protocols",
148+
"description": "Enabled SSL protocols."
149+
},
150+
{
151+
"name": "server.ssl.key-alias",
152+
"description": "Alias that identifies the key in the key store."
153+
},
154+
{
155+
"name": "server.ssl.key-password",
156+
"description": "Password used to access the key in the key store."
157+
},
158+
{
159+
"name": "server.ssl.key-store",
160+
"description": "Path to the key store that holds the SSL certificate (typically a jks file)."
161+
},
162+
{
163+
"name": "server.ssl.key-store-password",
164+
"description": "Password used to access the key store."
165+
},
166+
{
167+
"name": "server.ssl.key-store-provider",
168+
"description": "Provider for the key store."
169+
},
170+
{
171+
"name": "server.ssl.key-store-type",
172+
"description": "Type of the key store."
173+
},
174+
{
175+
"name": "server.ssl.protocol",
176+
"description": "SSL protocol to use.",
177+
"defaultValue": "TLS"
178+
},
179+
{
180+
"name": "server.ssl.trust-store",
181+
"description": "Trust store that holds SSL certificates."
182+
},
183+
{
184+
"name": "server.ssl.trust-store-password",
185+
"description": "Password used to access the trust store."
186+
},
187+
{
188+
"name": "server.ssl.trust-store-provider",
189+
"description": "Provider for the trust store."
190+
},
191+
{
192+
"name": "server.ssl.trust-store-type",
193+
"description": "Type of the trust store."
194+
},
46195
{
47196
"name": "spring.aop.auto",
48197
"type": "java.lang.Boolean",

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ content into your application. Rather, pick only the properties that you need.
185185
# EMBEDDED SERVER CONFIGURATION ({sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[ServerProperties])
186186
server.address= # Network address to which the server should bind.
187187
server.compression.enabled=false # Whether response compression is enabled.
188-
server.compression.excluded-user-agents= # List of user-agents to exclude from compression.
188+
server.compression.excluded-user-agents= # Comma-separated list of user agents for which responses should not be compressed.
189189
server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/xml # Comma-separated list of MIME types that should be compressed.
190190
server.compression.min-response-size=2KB # Minimum "Content-Length" value that is required for compression to be performed.
191191
server.connection-timeout= # Time that connectors wait for another HTTP request before closing the connection. When not set, the connector's container-specific default is used. Use a value of -1 to indicate no (that is, an infinite) timeout.
@@ -216,23 +216,23 @@ content into your application. Rather, pick only the properties that you need.
216216
server.servlet.context-parameters.*= # Servlet context init parameters.
217217
server.servlet.context-path= # Context path of the application.
218218
server.servlet.application-display-name=application # Display name of the application.
219-
server.servlet.jsp.class-name=org.apache.jasper.servlet.JspServlet # The class name of the JSP servlet.
219+
server.servlet.jsp.class-name=org.apache.jasper.servlet.JspServlet # Class name of the servlet to use for JSPs.
220220
server.servlet.jsp.init-parameters.*= # Init parameters used to configure the JSP servlet.
221221
server.servlet.jsp.registered=true # Whether the JSP servlet is registered.
222222
server.servlet.session.cookie.comment= # Comment for the session cookie.
223223
server.servlet.session.cookie.domain= # Domain for the session cookie.
224-
server.servlet.session.cookie.http-only= # "HttpOnly" flag for the session cookie.
224+
server.servlet.session.cookie.http-only= # Whether to use "HttpOnly" cookies for session cookies.
225225
server.servlet.session.cookie.max-age= # Maximum age of the session cookie. If a duration suffix is not specified, seconds will be used.
226226
server.servlet.session.cookie.name= # Session cookie name.
227227
server.servlet.session.cookie.path= # Path of the session cookie.
228-
server.servlet.session.cookie.secure= # "Secure" flag for the session cookie.
228+
server.servlet.session.cookie.secure= # Whether to always mark the session cookie as secure.
229229
server.servlet.session.persistent=false # Whether to persist session data between restarts.
230230
server.servlet.session.store-dir= # Directory used to store session data.
231-
server.servlet.session.timeout= # Session timeout. If a duration suffix is not specified, seconds will be used.
232-
server.servlet.session.tracking-modes= # Session tracking modes (one or more of the following: "cookie", "url", "ssl").
231+
server.servlet.session.timeout=30m # Session timeout. If a duration suffix is not specified, seconds will be used.
232+
server.servlet.session.tracking-modes= # Session tracking modes.
233233
server.ssl.ciphers= # Supported SSL ciphers.
234234
server.ssl.client-auth= # Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store.
235-
server.ssl.enabled= # Enable SSL support.
235+
server.ssl.enabled=true # Whether to enable SSL support.
236236
server.ssl.enabled-protocols= # Enabled SSL protocols.
237237
server.ssl.key-alias= # Alias that identifies the key in the key store.
238238
server.ssl.key-password= # Password used to access the key in the key store.
@@ -1204,21 +1204,21 @@ content into your application. Rather, pick only the properties that you need.
12041204
management.server.address= # Network address to which the management endpoints should bind. Requires a custom management.server.port.
12051205
management.server.port= # Management endpoint HTTP port (uses the same port as the application by default). Configure a different port to use management-specific SSL.
12061206
management.server.servlet.context-path= # Management endpoint context-path (for instance, `/management`). Requires a custom management.server.port.
1207-
management.server.ssl.ciphers= # Supported SSL ciphers. Requires a custom management.port.
1208-
management.server.ssl.client-auth= # Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store. Requires a custom management.server.port.
1209-
management.server.ssl.enabled= # Whether to enable SSL support. Requires a custom management.server.port.
1210-
management.server.ssl.enabled-protocols= # Enabled SSL protocols. Requires a custom management.server.port.
1211-
management.server.ssl.key-alias= # Alias that identifies the key in the key store. Requires a custom management.server.port.
1212-
management.server.ssl.key-password= # Password used to access the key in the key store. Requires a custom management.server.port.
1213-
management.server.ssl.key-store= # Path to the key store that holds the SSL certificate (typically a jks file). Requires a custom management.server.port.
1214-
management.server.ssl.key-store-password= # Password used to access the key store. Requires a custom management.server.port.
1215-
management.server.ssl.key-store-provider= # Provider for the key store. Requires a custom management.server.port.
1216-
management.server.ssl.key-store-type= # Type of the key store. Requires a custom management.server.port.
1217-
management.server.ssl.protocol=TLS # SSL protocol to use. Requires a custom management.server.port.
1218-
management.server.ssl.trust-store= # Trust store that holds SSL certificates. Requires a custom management.server.port.
1219-
management.server.ssl.trust-store-password= # Password used to access the trust store. Requires a custom management.server.port.
1220-
management.server.ssl.trust-store-provider= # Provider for the trust store. Requires a custom management.server.port.
1221-
management.server.ssl.trust-store-type= # Type of the trust store. Requires a custom management.server.port.
1207+
management.server.ssl.ciphers= # Supported SSL ciphers.
1208+
management.server.ssl.client-auth= # Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store.
1209+
management.server.ssl.enabled=true # Whether to enable SSL support.
1210+
management.server.ssl.enabled-protocols= # Enabled SSL protocols.
1211+
management.server.ssl.key-alias= # Alias that identifies the key in the key store.
1212+
management.server.ssl.key-password= # Password used to access the key in the key store.
1213+
management.server.ssl.key-store= # Path to the key store that holds the SSL certificate (typically a jks file).
1214+
management.server.ssl.key-store-password= # Password used to access the key store.
1215+
management.server.ssl.key-store-provider= # Provider for the key store.
1216+
management.server.ssl.key-store-type= # Type of the key store.
1217+
management.server.ssl.protocol=TLS # SSL protocol to use.
1218+
management.server.ssl.trust-store= # Trust store that holds SSL certificates.
1219+
management.server.ssl.trust-store-password= # Password used to access the trust store.
1220+
management.server.ssl.trust-store-provider= # Provider for the trust store.
1221+
management.server.ssl.trust-store-type= # Type of the trust store.
12221222
12231223
# CLOUDFOUNDRY
12241224
management.cloudfoundry.enabled=true # Whether to enable extended Cloud Foundry actuator endpoints.

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,25 @@
2323
*
2424
* @author Ivan Sopov
2525
* @author Andy Wilkinson
26+
* @author Stephane Nicoll
2627
* @since 2.0.0
2728
*/
2829
public class Compression {
2930

30-
/**
31-
* Whether response compression is enabled.
32-
*/
3331
private boolean enabled = false;
3432

35-
/**
36-
* Comma-separated list of MIME types that should be compressed.
37-
*/
3833
private String[] mimeTypes = new String[] { "text/html", "text/xml", "text/plain",
3934
"text/css", "text/javascript", "application/javascript", "application/json",
4035
"application/xml" };
4136

42-
/**
43-
* Comma-separated list of user agents for which responses should not be compressed.
44-
*/
4537
private String[] excludedUserAgents = null;
4638

47-
/**
48-
* Minimum "Content-Length" value that is required for compression to be performed.
49-
*/
5039
private DataSize minResponseSize = DataSize.ofKilobytes(2);
5140

41+
/**
42+
* Return whether response compression is enabled.
43+
* @return {@code true} if response compression is enabled
44+
*/
5245
public boolean getEnabled() {
5346
return this.enabled;
5447
}
@@ -57,6 +50,10 @@ public void setEnabled(boolean enabled) {
5750
this.enabled = enabled;
5851
}
5952

53+
/**
54+
* Return the MIME types that should be compressed.
55+
* @return the MIME types that should be compressed
56+
*/
6057
public String[] getMimeTypes() {
6158
return this.mimeTypes;
6259
}
@@ -65,14 +62,6 @@ public void setMimeTypes(String[] mimeTypes) {
6562
this.mimeTypes = mimeTypes;
6663
}
6764

68-
public DataSize getMinResponseSize() {
69-
return this.minResponseSize;
70-
}
71-
72-
public void setMinResponseSize(DataSize minSize) {
73-
this.minResponseSize = minSize;
74-
}
75-
7665
public String[] getExcludedUserAgents() {
7766
return this.excludedUserAgents;
7867
}
@@ -81,4 +70,17 @@ public void setExcludedUserAgents(String[] excludedUserAgents) {
8170
this.excludedUserAgents = excludedUserAgents;
8271
}
8372

73+
/**
74+
* Return the minimum "Content-Length" value that is required for compression to be
75+
* performed.
76+
* @return the minimum content size in bytes that is required for compression
77+
*/
78+
public DataSize getMinResponseSize() {
79+
return this.minResponseSize;
80+
}
81+
82+
public void setMinResponseSize(DataSize minSize) {
83+
this.minResponseSize = minSize;
84+
}
85+
8486
}

0 commit comments

Comments
 (0)