Audit log — record who did what and when

Open
#23 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
go

Research direction

Start by reading related issues #2 and #3, then map the mutating handlers for snaps, API keys, and login. Done means the specified actions create audit_log entries and GET /audit returns paginated results only to admins; the optional UI activity surface is not required.

Written by the indexing model from the issue text.

Description

enhancement infrastructure security

Once authentication (#2) lands, actions like snap deletion, rename, and API key creation should be logged for accountability.

What needs to be done

  • audit_log table: id, user_id (nullable — system actions), action (e.g. snap.created, snap.deleted, snap.renamed), target_id, metadata JSONB, created_at.
  • Middleware or explicit calls in handlers write a row after each mutating action.
  • GET /audit (admin only) returns paginated log entries.
  • Optionally surface recent activity in the UI header.

Actions to log

Action Metadata
snap.created snap_id, lat, lng, photo_count
snap.deleted snap_id, name
snap.renamed snap_id, old_name, new_name
api_key.created key_name
api_key.revoked key_name
user.login method (password/google/apple), ip

Related

  • #2 Authentication (user_id comes from here)
  • #3 Authorization (audit access is admin-only)
Dominant language
Go
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from williamokano/SentinelSnap

All issues in williamokano/SentinelSnap

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.