Refuse a Read, Grep or Bash call that reads ~/.claude/.env or a config's env-file
CI / tests (pull_request) Failing after 2m29s

This commit is contained in:
2026-11-13 20:56:17 +01:00
parent effe6393c0
commit 333ebe58b8
10 changed files with 143 additions and 12 deletions
+6
View File
@@ -87,6 +87,12 @@ def held(folder: pathlib.Path, home: pathlib.Path) -> ProjectConfig | Failure |
return config if isinstance(config, Failure) else load(config[0], config[0], home)
def env_files(home: pathlib.Path) -> list[pathlib.Path]:
"""Every config's env-file, read without the checks load makes, so a config that fails them still keeps its credentials guarded; a config that cannot be read names none."""
configs = [read(file, home) for file in sorted((home / PROJECTS).glob(f"*/{CONFIG}"))]
return [path for config in configs if not isinstance(config, Failure) and (path := anywhere(config[1].get(ENV_FILE), home))]
def read(file: pathlib.Path, home: pathlib.Path) -> tuple[pathlib.Path, dict[str, object]] | Failure:
"""The checkout a config names, as an absolute path, and its other values."""
try: