Update audit.py
Browse files
audit.py
CHANGED
|
@@ -2,7 +2,7 @@ import uuid
|
|
| 2 |
from datetime import datetime
|
| 3 |
from typing import Dict, List
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
def log_event(action: str, payload: Dict) -> Dict:
|
| 8 |
entry = {
|
|
@@ -11,8 +11,8 @@ def log_event(action: str, payload: Dict) -> Dict:
|
|
| 11 |
"action": action,
|
| 12 |
"payload": payload
|
| 13 |
}
|
| 14 |
-
|
| 15 |
return entry
|
| 16 |
|
| 17 |
def export_audit_log() -> List[Dict]:
|
| 18 |
-
return
|
|
|
|
| 2 |
from datetime import datetime
|
| 3 |
from typing import Dict, List
|
| 4 |
|
| 5 |
+
_AUDIT_LOG: List[Dict] = []
|
| 6 |
|
| 7 |
def log_event(action: str, payload: Dict) -> Dict:
|
| 8 |
entry = {
|
|
|
|
| 11 |
"action": action,
|
| 12 |
"payload": payload
|
| 13 |
}
|
| 14 |
+
_AUDIT_LOG.append(entry)
|
| 15 |
return entry
|
| 16 |
|
| 17 |
def export_audit_log() -> List[Dict]:
|
| 18 |
+
return list(_AUDIT_LOG)
|