feature: RBAC + Clinical Audit Logging

This commit is contained in:
voltsrage
2026-06-21 15:46:55 +08:00
parent a43db52813
commit 5af6ab490e
83 changed files with 4281 additions and 70 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BASE_URL="${BASE_URL:-http://localhost:5270}"
echo "=== Phase 31 verification ==="
dotnet test "${ROOT_DIR}/VigilCareClinicalAPI.Tests" \
--filter "FullyQualifiedName~RbacTests" --no-restore
TOKEN=$(curl -sf -X POST "${BASE_URL}/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{"username":"nurse.demo","password":"DemoNurse1!"}' \
| jq -r '.data.accessToken')
echo "Nurse token acquired"
curl -sf "${BASE_URL}/api/v1/patients" \
-H "Authorization: Bearer ${TOKEN}" | jq -e '.success == true'
ADMIN_TOKEN=$(curl -sf -X POST "${BASE_URL}/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{"username":"admin.demo","password":"DemoAdmin1!"}' \
| jq -r '.data.accessToken')
curl -sf "${BASE_URL}/api/v1/audit-logs" \
-H "Authorization: Bearer ${ADMIN_TOKEN}" | jq -e '.success == true'
echo "Phase 31 verification complete."