Files
stackpilot/backend/services/audit_service.py
menzeljandClaude Opus 4.8 f732cb080b Initial commit: StackPilot Phase 1 (Core)
Self-hosted Docker Compose manager.
- Backend: FastAPI + docker-py + SQLite (JWT auth, file-first stacks,
  lifecycle, live status, WebSocket logs, docker-run converter, audit log)
- Frontend: React + Vite + Tailwind (login/setup, dashboard, stacks,
  stack detail, Monaco editor, dark/light theme)
- Deployment: docker-compose.yml, Dockerfiles, nginx reverse proxy

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 16:04:58 +00:00

23 lines
448 B
Python

"""Audit log helper."""
from __future__ import annotations
from typing import Optional
from sqlmodel import Session
from models.audit import AuditLog
def record(
session: Session,
*,
user: str,
action: str,
target: str,
detail: Optional[str] = None,
ip: Optional[str] = None,
) -> None:
entry = AuditLog(user=user, action=action, target=target, detail=detail, ip=ip)
session.add(entry)
session.commit()