feat(audit): implement audit logging for search requests and results
All checks were successful
Publish FaceAI Container / publish (push) Successful in 13m22s

- Added configuration options for audit database path and retention days in backend and processor.
- Integrated audit logging in server and worker processes to track search requests, completions, and failures.
- Created utility functions for reading and parsing audit logs in end-to-end tests.
- Updated Docker Compose files to include audit database configuration.
- Added new tests to verify audit log entries for successful and no-results searches.
This commit is contained in:
MaddoScientisto 2026-05-19 23:29:38 +02:00
commit 32db61c381
14 changed files with 1067 additions and 16 deletions

View file

@ -0,0 +1,128 @@
{
"config": {
"configFile": "K:\\various\\regalamiunsorriso\\faceai\\playwright.config.js",
"rootDir": "K:/various/regalamiunsorriso/faceai/tests/e2e",
"forbidOnly": false,
"fullyParallel": false,
"globalSetup": "K:\\various\\regalamiunsorriso\\faceai\\tests\\e2e\\global-setup.js",
"globalTeardown": "K:\\various\\regalamiunsorriso\\faceai\\tests\\e2e\\global-teardown.js",
"globalTimeout": 0,
"grep": {},
"grepInvert": null,
"maxFailures": 0,
"metadata": {
"actualWorkers": 1
},
"preserveOutput": "always",
"projects": [
{
"outputDir": "K:/various/regalamiunsorriso/faceai/test-results",
"repeatEach": 1,
"retries": 0,
"metadata": {
"actualWorkers": 1
},
"id": "",
"name": "",
"testDir": "K:/various/regalamiunsorriso/faceai/tests/e2e",
"testIgnore": [],
"testMatch": [
"**/*.@(spec|test).?(c|m)[jt]s?(x)"
],
"timeout": 60000
}
],
"quiet": false,
"reporter": [
[
"json"
]
],
"reportSlowTests": {
"max": 5,
"threshold": 300000
},
"shard": null,
"tags": [],
"updateSnapshots": "missing",
"updateSourceMethod": "patch",
"version": "1.59.1",
"workers": 1,
"webServer": null
},
"suites": [
{
"title": "faceai-simulator.spec.js",
"file": "faceai-simulator.spec.js",
"column": 0,
"line": 0,
"specs": [
{
"title": "records structured logs for a completed no-results FaceAI search in the dev compose stack",
"ok": true,
"tags": [],
"tests": [
{
"timeout": 180000,
"annotations": [
{
"type": "slow",
"location": {
"file": "K:\\various\\regalamiunsorriso\\faceai\\tests\\e2e\\faceai-simulator.spec.js",
"line": 283,
"column": 8
}
}
],
"expectedStatus": "passed",
"projectId": "",
"projectName": "",
"results": [
{
"workerIndex": 0,
"parallelIndex": 0,
"status": "passed",
"duration": 4768,
"errors": [],
"stdout": [],
"stderr": [
{
"text": "(node:36288) ExperimentalWarning: SQLite is an experimental feature and might change at any time\n(Use `node --trace-warnings ...` to show where the warning was created)\n"
}
],
"retry": 0,
"startTime": "2026-05-19T21:25:46.138Z",
"annotations": [
{
"type": "slow",
"location": {
"file": "K:\\various\\regalamiunsorriso\\faceai\\tests\\e2e\\faceai-simulator.spec.js",
"line": 283,
"column": 8
}
}
],
"attachments": []
}
],
"status": "expected"
}
],
"id": "3529663bd1948fd400e2-8c368f494576987888aa",
"file": "faceai-simulator.spec.js",
"line": 282,
"column": 1
}
]
}
],
"errors": [],
"stats": {
"startTime": "2026-05-19T21:24:59.845Z",
"duration": 51905.866,
"expected": 1,
"skipped": 0,
"unexpected": 0,
"flaky": 0
}
}