feat: add audit logging for admin trash restore/purge and notification clear actions

- Record audit events in `admin_trash_restore` and `admin_trash_purge` endpoints with target metadata
- Log `notification.read.all` event when user clears devRant notification feed
- Include `devrant` as a valid origin in audit categories
- Add `admin_section` and `pagination_query` fields to audit and backup schemas for UI consistency
This commit is contained in:
2026-06-16 05:08:58 +00:00
parent 1934dd5727
commit 99ed5c4f15
24 changed files with 466 additions and 186 deletions
+16
View File
@@ -428,3 +428,19 @@ def test_project_uid_redirects_to_canonical_slug(app_server):
assert r.headers["location"].endswith(f"/projects/{slug}"), r.headers.get(
"location"
)
def test_private_detail_is_noindex_for_owner(app_server):
_, _, key = _signup_project_visibility()
slug = _create_project_project_visibility(key, "Private NoIndex", is_private=True)["slug"]
r = requests.get(f"{BASE_URL}/projects/{slug}", headers={"X-API-KEY": key})
assert r.status_code == 200, r.text[:300]
assert '<meta name="robots" content="noindex,nofollow">' in r.text
def test_public_detail_is_indexable(app_server):
_, _, key = _signup_project_visibility()
slug = _create_project_project_visibility(key, "Public Indexable", is_private=False)["slug"]
r = requests.get(f"{BASE_URL}/projects/{slug}", headers={"X-API-KEY": key})
assert r.status_code == 200, r.text[:300]
assert '<meta name="robots" content="index,follow">' in r.text