Spaces:
Build error
Build error
Commit History
-
Add python -m config.credentials CLI (D6, ahead of D5's UI)
What: a thin argparse CLI appended to config/credentials.py -- 'list', 'get [--reveal]', 'set [VALUE]' (prompts hidden if omitted), 'delete' -- over the 6 managed keys. Values are masked to their last 4 chars by default. Calls the exact same get_credential()/set_credential() functions a future D5 setup-wizard UI would call, so nothing here needs to change when that UI exists. Why now rather than waiting for D5: this is the only way to test the 5 keys with no other write path (everything but ADMIN_SECRET) against a REAL OS keychain -- Windows Credential Manager specifically -- since no sandbox in this engagement has ever had one available to test against directly. Small, self-contained, and doesn't conflict with or duplicate D5's eventual work. Verified: python -m py_compile passes; ran 'python -m config.credentials list/get/set/delete' as a real subprocess (not just calling _cli() in-process) to confirm argparse's prog name and --help both render correctly. Behaviorally exercised eve…10d643d -
Add config/credentials.py -- OS-keychain credential storage (D6)
What: new module with get_credential(key), set_credential(key, value), and load_credentials_into_environ(). Extends config.settings's existing 2-level precedence (env var > local config.json) with a third, lowest- precedence source: the OS keychain (Windows Credential Manager / macOS Keychain / Linux Secret Service), via the keyring package. A closed, explicit list of 6 managed keys (ADMIN_SECRET, NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD, DATAGOV_API_KEY, OPENSANCTIONS_API_KEY) -- not an arbitrary-key store, since the OS keychain is a shared per-user resource. Not yet wired into anything (next two commits do that) -- this commit is the module on its own, reviewable in isolation. Verified: python -m py_compile passes. In an isolated venv with keyring installed: (1) with no real OS keychain backend available, confirmed get_credential/set_credential/load_credentials_into_environ all degrade to no-ops with no exceptions -- import and keyring.get_keyring() both succeed, and the failure only …89d90ae