learning-it by example

Back to the video

One Codebase, Many Customers: Config Without Leaks

Customer B got customer A's webhook address and secret reference. The bug was one line.

Video #314 ยท Forward deployed engineer interviews

Steps in the video

  1. 0:00 Customer B was given customer A's webhook address
  2. 0:34 The idea
  3. 1:10 Setup
  4. 1:33 Defaults and overrides
  5. 2:04 Two loaders
  6. 2:24 Count the leaks
  7. 2:49 Run both loaders
  8. 3:31 What this does not show
  9. 4:29 Mistakes to avoid
  10. 4:55 My take and next steps
  11. 5:21 Recap

Files

  • check.py (28 lines)
  • loader.py (24 lines)
  • run.py (14 lines)
  • settings.py (18 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

Made-up customers and settings; secrets are only reference names. One kind of leak (a shared default that is changed), one load order, safe loader first. The check only compares settings that exist in the defaults, and the expected values are built by the same copy and merge.

Sources

Learning IT by Example.