feat: new settings, CLI skeleton and interface skeletons
Adds the pydantic-settings Settings with validated GITEA_URL, OAuth scopes and toolsets, the argparse CLI skeleton, catalog.model, identity and GiteaAPIError. Test fixtures now isolate env, cwd and state paths in tmp.
This commit is contained in:
1 parent
4ac9626eb5
commit
b82e2866cb
24 files changed
+1512
-605
No files matched your search
@@ -4,10 +4,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from aegis_gitea_mcp.audit import validate_audit_log_integrity
|
||||
from aegis_gitea_mcp.config import default_data_dir
|
||||
|
||||
|
||||
def default_audit_path() -> Path:
|
||||
"""Resolve the audit log path the server would use (env first, then DATA_DIR)."""
|
||||
explicit = os.environ.get("AUDIT_LOG_PATH", "").strip()
|
||||
if explicit:
|
||||
return Path(explicit).expanduser()
|
||||
data_dir = os.environ.get("DATA_DIR", "").strip()
|
||||
base = Path(data_dir).expanduser() if data_dir else default_data_dir()
|
||||
return base / "audit.log"
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
@@ -16,7 +27,7 @@ def parse_args() -> argparse.Namespace:
|
||||
parser.add_argument(
|
||||
"--path",
|
||||
type=Path,
|
||||
default=Path("/var/log/aegis-mcp/audit.log"),
|
||||
default=default_audit_path(),
|
||||
help="Path to audit log file",
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
Reference in new issue
Block a user