Skip to content

feat(bridge): gate webhook routes + deposit push on bridge.enabled (ENG-466)#436

Merged
islandbitcoin merged 1 commit into
mainfrom
jabariennis/eng-466-gate-bridge-webhook-on-enabled
Jul 7, 2026
Merged

feat(bridge): gate webhook routes + deposit push on bridge.enabled (ENG-466)#436
islandbitcoin merged 1 commit into
mainfrom
jabariennis/eng-466-gate-bridge-webhook-on-enabled

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

Summary

bridge.enabled gated 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.

  • bridgeEnabledGuard middleware on the webhook server → 503 on every route when disabled; /health stays up for k8s probes. The chart gates the workload on galoy.bridge.webhook.enabled; this is defense-in-depth for chart/config drift, local runs, and misconfig.
  • sendBridgeDepositNotificationBestEffort no-ops when disabled.

Assessed, not changed (documented in the commit)

  • Migration 20260423…-bridge-virtual-account-unique — safe when bridge is unused: bridgevirtualaccounts is 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).
  • Bridge GraphQL mutations already reject via checkBridgeEnabled and stay in the schema — confirmed acceptable per the ticket.

Test plan

  • 5 new unit tests (guard enabled/disabled/health; deposit no-op/proceed)
  • 92 webhook-server + bridge unit tests green; tsc + eslint clean

Refs ENG-466

🤖 Generated with Claude Code

…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
@linear

linear Bot commented Jul 7, 2026

Copy link
Copy Markdown

ENG-466

@islandbitcoin islandbitcoin merged commit aea038e into main Jul 7, 2026
14 checks passed
@islandbitcoin islandbitcoin deleted the jabariennis/eng-466-gate-bridge-webhook-on-enabled branch July 7, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants