fix: ForwardedHeaderFilter for OIDC behind TLS ingress, gitleaks URL override, graceful SIGTERM shutdown#163
Merged
coopernetes merged 3 commits intomainfrom Apr 15, 2026
Merged
Conversation
…ns, 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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ForwardedHeaderFilteras the first filter inGitProxyWithDashboardApplication, ahead of Spring Session and Security. Fixes OAuth2 redirect URIs being built withhttp://when running behind a TLS-terminating ingress (OCP Route, nginx), causing Entra ID to reject the authorization request for non-localhost origins.build.gradlenow readsGITLEAKS_DOWNLOAD_URLenv var, allowing air-gapped/restricted CI environments to redirect the binary download to a corporate artifact mirror (e.g. Artifactory) without modifying the build script.GitProxyJettyApplicationandGitProxyWithDashboardApplicationnow configuresetStopAtShutdown(true)andsetStopTimeout(30_000). Prevents in-flight git pushes from being torn down mid-transfer during Kubernetes rolling deploys or pod eviction.Test plan
https://GITLEAKS_DOWNLOAD_URLto a mirror URL and confirm./gradlew buildfetches from it