Skip to content

Commit 6204458

Browse files
committed
Updated docs
1 parent 45a0131 commit 6204458

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

web-sidecar-common/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,10 @@ It's main use-case is to prevent the requests from reaching the main application
7575
### Error page compatibility
7676

7777
Ensure that registered Web-Server error pages are accessible.
78+
79+
### HTTP Security
80+
81+
Controls how Security Matchers are applied to Sidecars.
82+
83+
By default, it ALWAYS uses `PathPatternRequestMatcher` instead of the internally used `MvcRequestMatcher (deprecated)` (or `AntPathRequestMatcher` if MVC is not present) when calling `HTTPSecurity#securityMatcher(String...)`.
84+
This prevents unexpected bugs that can occur when a url mapping (e.g. `/2025/*`) is registered for a servlet, which can result in unwanted paths being picked up (e.g. `/2025/actuator`).

web-sidecar-common/src/main/java/software/xdev/sse/web/sidecar/httpsecurity/package-info.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
* #securityMatcher(org.springframework.security.web.util.matcher.RequestMatcher)} is applied for sidecars.
2020
* <p>
2121
* By default, it ALWAYS uses {@link org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher}
22-
* instead of the internally used <code>MvcRequestMatcher (deprecated)</code>. This prevents unexpected bugs that can
23-
* occur when a url mapping (e.g. <code>/2025/*</code>) is registered for a servlet, which can result in unwanted paths
24-
* being picked up (e.g. <code>/2025/actuator</code>).
22+
* instead of the internally used <code>MvcRequestMatcher (deprecated)</code> (or <code>AntPathRequestMatcher</code>
23+
* if MVC is not present) when calling <code>HTTPSecurity#securityMatcher(String...)</code>. This prevents unexpected
24+
* bugs that can occur when a url mapping (e.g. <code>/2025/*</code>) is registered for a servlet, which can result
25+
* in unwanted paths being picked up (e.g. <code>/2025/actuator</code>).
2526
* </p>
2627
* <p>
2728
* <i>This package is only designed to be used in Sidecars and not in the main application!</i>

web/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@ public MainLayout {
3131
}
3232
}
3333
```
34+
35+
### HSTS
36+
37+
Configures HSTS, automatically picked up by sidecars for configuration.
38+
39+
Spring Boot has HSTS <a href="https://docs.spring.io/spring-security/reference/features/exploits/headers.html#headers-hsts">enabled by default</a> which means that it always checks if a request is secure or not. If the request is determined to be secure it injects an HSTS header. This is unnecessary as HSTS is nearly always handled by the reverse proxy upstream that also handles certificates.
40+
41+
The default implementation therefore disables HSTS when
42+
* it was explicitly disabled in the config
43+
* no SSL configuration is present

0 commit comments

Comments
 (0)