cisagov / XFD

CyHy Dashboard
Creative Commons Zero v1.0 Universal
8 stars 6 forks source link

Implement logging for user actions #605

Closed jayjaybunce closed 1 month ago

jayjaybunce commented 2 months ago

🗣 Description

💭 Motivation and context

Resolves CRASM-569

🧪 Testing

  1. Create temporary table for the log record sql CREATE TABLE public.log ( "id" SERIAL PRIMARY KEY, "payload" json NOT NULL, "createdAt" timestamptz NOT NULL DEFAULT now(), "eventType" varchar NOT NULL, "result" varchar NOT NULL );
  2. Invite a user and assign them to an organization
  3. Deny a user's request
  4. Approve a user's request
  5. View User Logs by going to Admin Tools => Select the User Logs tab

Filters implemented:

  1. Result => Either 'success' or 'fail'
  2. Payload => JSON object you can search with this format: createdUserPayload.id: a23das12312n-asda912-asd
  3. Timestamp
  4. EventType

✅ Pre-approval checklist

✅ Pre-merge checklist

✅ Post-merge checklist