docs(P12): complete gitignore-credential-hygiene phase (v1.13.15)

---ci---
project: acdl
phase: 12
milestone: v1.14
status: complete
requirements:
  covered: [REQ-146]
  partial: []
---/ci---
This commit is contained in:
Jon Chery
2026-07-29 21:00:34 +00:00
parent 986171a165
commit 3e90d994e6
2 changed files with 46 additions and 1 deletions
+11 -1
View File
@@ -18,4 +18,14 @@ terraform/bootstrap/.bootstrap_state.json
**/.terraform/
**/.terraform.lock.hcl
**/tfplan
**/*.tfstate*
**/*.tfstate*
# Credential patterns (v1.14, REQ-146)
*.pem
*.key
*.p12
*.pfx
*.cer
*.crt
*.jks
*.keystore
+35
View File
@@ -0,0 +1,35 @@
"""v1.14 (REQ-146): no credential-looking files are tracked by git."""
import subprocess
import sys
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parent.parent
CREDENTIAL_EXTENSIONS = [".pem", ".key", ".p12", ".pfx", ".cer", ".crt", ".jks", ".keystore"]
def test_no_credential_files_tracked():
"""Assert no file with a credential extension is tracked by git."""
result = subprocess.run(
["git", "ls-files"],
cwd=str(ROOT),
capture_output=True,
text=True,
)
if result.returncode != 0:
pytest.skip("git not available or not a repo")
tracked = result.stdout.strip().split("\n")
cred_files = [
f for f in tracked
if any(f.endswith(ext) for ext in CREDENTIAL_EXTENSIONS)
]
assert cred_files == [], f"credential files tracked by git: {cred_files}"
def test_gitignore_has_credential_patterns():
"""Assert .gitignore contains the credential-pattern catch-all."""
gitignore = (ROOT / ".gitignore").read_text()
for ext in [".pem", ".key", ".p12", ".pfx"]:
assert f"*{ext}" in gitignore, f".gitignore missing credential pattern *{ext}"