Commit 754f43c
fix: ForwardedHeaderFilter for OIDC behind TLS ingress, gitleaks URL override, graceful SIGTERM shutdown (#163)
* fix(oidc,security,build): ForwardedHeaderFilter, redact diff violations, gitleaks URL override
ForwardedHeaderFilter (GitProxyWithDashboardApplication):
Register Spring's ForwardedHeaderFilter as the first filter in the
chain, ahead of Spring Session and Spring Security. When the app runs
behind a TLS-terminating ingress (OCP Route, nginx, etc.) the pod only
sees plain HTTP internally. Without this filter, Spring Security builds
OAuth2 redirect URIs with an http:// scheme, which Entra ID refuses to
process for non-localhost origins. The filter consumes X-Forwarded-Proto,
X-Forwarded-Host, and X-Forwarded-Port from the ingress and rewraps the
request so all downstream code — including the OAuth2 authorization
request resolver — sees the correct public-facing scheme and host.
Redact regex pattern from blocked-content violation messages (BlockedContentDiffCheck):
Violation messages previously included the raw regex pattern string
("blocked pattern: (?i)(password|secret...)"). This leaks internal
scanning rules to the committer. Changed to a generic "blocked pattern
match" message. The location (file path) is still included so the
committer knows which file triggered the check.
Gitleaks download URL override (build.gradle):
The gitleaks binary download URL is now overridable via the
GITLEAKS_DOWNLOAD_URL environment variable. This allows CI environments
without direct access to github.com releases to redirect the download
to a corporate artifact mirror (e.g. Artifactory) without modifying
the build script.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(jetty): graceful shutdown on SIGTERM with 30s drain period
Both server entry points (GitProxyJettyApplication and
GitProxyWithDashboardApplication) now configure Jetty for graceful
shutdown:
- server.setStopAtShutdown(true): registers a JVM shutdown hook so that
SIGTERM triggers server.stop() rather than an abrupt JVM exit. Without
this the OS kills the process immediately on SIGTERM regardless of
in-flight work.
- server.setStopTimeout(30_000): gives Jetty up to 30s to drain active
connections before the stop completes. Requests still being processed
when SIGTERM arrives (e.g. a slow git push) are allowed to finish
within that window; any that exceed 30s are forcibly closed.
This matches the behaviour Spring Boot provides via server.shutdown=graceful
+ spring.lifecycle.timeout-per-shutdown-phase. It is especially important
on Kubernetes/OCP where the kubelet sends SIGTERM during rolling deploys
and pod eviction — previously any in-flight git push or proxy stream would
be torn down mid-transfer, leaving the client with a broken pack.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* revert: restore BlockedContentDiffCheck violation message
Reverts the regex-redaction change introduced in d34d139 — saving it
for a dedicated PR with fuller context for issue #152.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 5a8c52f commit 754f43c
3 files changed
Lines changed: 25 additions & 1 deletion
File tree
- git-proxy-java-core
- git-proxy-java-dashboard/src/main/java/org/finos/gitproxy/dashboard
- git-proxy-java-server/src/main/java/org/finos/gitproxy/jetty
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
189 | 204 | | |
190 | 205 | | |
191 | 206 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
0 commit comments