feat(bridge): gate webhook routes + deposit push on bridge.enabled (ENG-466)#436
Merged
islandbitcoin merged 1 commit intoJul 7, 2026
Merged
Conversation
…NG-466) `bridge.enabled` gated the service-layer mutations (checkBridgeEnabled) but NOT the webhook route handlers (which write to the DB directly) or the deposit push. Defense in depth for the dark-code launch posture: - New bridgeEnabledGuard middleware on the webhook server rejects every route with 503 when bridge is disabled; /health stays up for k8s probes. The chart already gates the workload on galoy.bridge.webhook.enabled, but this covers chart/config drift, local runs, and misconfig — an accidentally-started process can't mutate. - sendBridgeDepositNotificationBestEffort no-ops when disabled. Not changed (assessed, documented): - Migration 20260423…-bridge-virtual-account-unique: safe when bridge is unused — the bridgevirtualaccounts collection is empty, so the dedup is a no-op and the unique index is created on an empty collection. - Bridge GraphQL mutations already reject via checkBridgeEnabled (BridgeDisabledError) and stay in the schema — confirmed acceptable. 5 new tests (guard: enabled/disabled/health; deposit push: no-op when off, proceeds when on); 92 webhook-server + bridge tests green. Refs ENG-466
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
bridge.enabledgated the service-layer mutations but not the webhook route handlers (which write to the DB directly) or the deposit push. Closes the gap for the dark-code launch posture.bridgeEnabledGuardmiddleware on the webhook server → 503 on every route when disabled;/healthstays up for k8s probes. The chart gates the workload ongaloy.bridge.webhook.enabled; this is defense-in-depth for chart/config drift, local runs, and misconfig.sendBridgeDepositNotificationBestEffortno-ops when disabled.Assessed, not changed (documented in the commit)
20260423…-bridge-virtual-account-unique— safe when bridge is unused:bridgevirtualaccountsis empty, so the dedup is a no-op and the unique index is built on an empty collection. No config-awareness needed (migrations shouldn't read runtime flags).checkBridgeEnabledand stay in the schema — confirmed acceptable per the ticket.Test plan
Refs ENG-466
🤖 Generated with Claude Code