Task · MDE-0005

Delete the stale CFG-BIG getattr guards in app.py

Description

Not migrated from any issue. Found by sweeping the source for TODO/FIXME residue during the 2026-08-14 tracker migration: these are the only two in src/, tests/, scripts/, tools/ and charts/, and CFG-BIG appears nowhere else in the repository — no issue, no doc, no run artefact. It was an untracked commitment to a “config sweep” with no home, which is exactly the class of thing this tracker exists to hold.

The residue

src/meraki_dashboard_exporter/app.py:232
    # TODO(CFG-BIG): webhooks.allow_insecure lands with the config sweep;
    # getattr keeps the secure default (False) until then.
    allow_insecure=getattr(self.settings.webhooks, "allow_insecure", False),

src/meraki_dashboard_exporter/app.py:926
    # TODO(CFG-BIG): server.ui_enabled lands with the config sweep;
    # getattr keeps the default (True = UI enabled) until then.
    ui_enabled=getattr(self.settings.server, "ui_enabled", True),

Both fields already landed — verified 2026-08-14

So the sweep the TODOs were waiting for has happened, and the getattr guards are stale defensive residue on two security-relevant decisions: whether the webhook receiver may run without a shared secret, and whether the human UI surface is exposed.

Why this is worth a task rather than a passing cleanup

getattr with a default silently hides the failure it was written to prevent. If either field is ever renamed, the call site keeps compiling, keeps passing type-checking, and quietly reverts to its default — which for ui_enabled means exposing the UI, not suppressing it. Direct attribute access makes the same rename a mypy error, which is the whole reason the settings tree is typed.

Small, self-contained, and touches only app.py — a good first task for a lane. Not a security fix in itself: the current defaults are the safe ones, so the behaviour is correct today. It is the failure mode that is wrong.

Acceptance Criteria

Definition of Done

Implementation Plan

Wave 1 L1: bounded direct-settings cleanup in app.py; child owns local edits and focused validation, root owns integration and final gate.

Final Summary

Implemented and verified in 7327153. make docgen and make check passed; 2,785 tests passed.

View the source file on GitHub