Module: vvaharness/config

docs / modules / config

← all docs

Module: vvaharness/config

Role. Loads and merges the active profile, expands environment placeholders, and applies per-scan overlays.

Size. 1 files · ~292 LOC.


flowchart LR IN["Input\nProfile + config.local.yaml + ${ENV}"] --> ACT["Action\nResolve and deep-merge the active profile"] ACT --> VAL["Validation\nUntrusted-input trust-boundary check — refuses a config found inside the scan target"] VAL --> OUT["Output\nA merged Config object"]

This single module is how VVAH reads its settings. It finds the right config file, merges any machine-local overrides on top, and substitutes secrets from environment variables so tokens never live in the config itself. It also refuses configs that live inside the scanned repo, a deliberate trust-boundary rule.

Explain-it-simply. The settings reader — combines the chosen profile with your local tweaks and your secrets, safely.

Data-flow (this module)

flowchart LR PROF[profile yaml] --> LOAD[Config.load] LOCAL[config.local.yaml] --> LOAD ENVV[${ENV} vars] --> LOAD LOAD --> CFG[Config object] OVL[step1 overlay] --> CFG

Technical details

flowchart LR IN["Input\nProfile + config.local.yaml + ${ENV}"] --> ACT["Action\nResolve and deep-merge the active profile"] ACT --> VAL["Validation\nUntrusted-input trust-boundary check — refuses a config found inside the scan target"] VAL --> OUT["Output\nA merged Config object"]

Config.load resolves + deep-merges (_deep_merge, _replace_merge, _append_merge), expands ${ENV:-default} (_expand_env, _expand), applies step1 exclusion overlays (apply_step1_overlay), and guards remote paths (is_network_path). See LLD §2.

File map (quick scan)

File LOC Purpose
config/__init__.py 292 Config loader. Reads config.yaml, expands ${ENV:-default} placeholders.

Files & functions, explained

Every class and function below has a one-line plain-English note — readable whether you write code or not. _name marks an internal helper.

config/__init__.py

292 LOC. Config loader. Reads config.yaml, expands ${ENV:-default} placeholders.

Classes - Config — Represents the “Config” data/behaviour used in this file. - __getattr__() — Python built-in method (__getattr__). - __getitem__() — Python built-in method (__getitem__). - __repr__() — Python built-in method (__repr__).

Functions - _expand_env() — (internal helper) Provides the “expand environment settings” logic. - _expand() — (internal helper) Provides the “expand” logic. - _deep_merge() — (internal helper) Provides the “deep merge” logic. - load() — Looks up / reads the load value. - _replace_merge() — (internal helper) Provides the “replace merge” logic. - _append_merge() — (internal helper) adds detail to the merge value. - is_network_path() — Checks / decides the network path step. - apply_step1_overlay() — Runs the step1 settings override step.


See also: HLD · LLD · Data Flow · module index.