Skip to content

feat(audit-server): build server-side logic for log period deletion keys - #22068

Open
ncdiehl11 wants to merge 2 commits into
edgefrom
audit-server_log-deletion-keys
Open

feat(audit-server): build server-side logic for log period deletion keys#22068
ncdiehl11 wants to merge 2 commits into
edgefrom
audit-server_log-deletion-keys

Conversation

@ncdiehl11

@ncdiehl11 ncdiehl11 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Overview

Introduces audit-server-side logic for creating and storing unique deletion keys for each successful log download request at /audit/external/logPeriods/${logPeriodId}/download. Deletion keys do not survive server restarts.

Closes EXEC-2878

Test Plan and Hands on Testing

  • push audit-server to a CRS bot, and make a request to download a log period
  • inspect the response and look for the deletion token in the headers

Changelog

  • add deletion key attribute and creation fn to LogDataManager
  • wire up deletion key creation in log export router
  • pass deletion key back in the headers of the above response
  • add unit tests

Review requests

Please inspect code and unit tests.

Risk assessment

low

Introduces audit-server-side logic for creating and persisting unqiue deletion keys for each
successful log download request at /audit/external/logPeriods/${logPeriodId}/download. Adds required
alembic migration for new DeletionKey table. Keeps the releationship between deletion key and
associated recoord generic to support requiring deletion keys for other record types in the future.

Closes EXEC-2878

@sfoster1 sfoster1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think the deletion key needs to go in the database at all, honestly. the reason this exists is to provide a "hey wait!" warning flag if somebody writes a client that just deletes stuff without thinking about it, and for that purpose having them live in memory (with some limit - one per period, even) is totally fine. there's no need for them to survive reboots.

@ncdiehl11

ncdiehl11 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

i don't think the deletion key needs to go in the database at all, honestly. the reason this exists is to provide a "hey wait!" warning flag if somebody writes a client that just deletes stuff without thinking about it, and for that purpose having them live in memory (with some limit - one per period, even) is totally fine. there's no need for them to survive reboots.

So do you propose this logic lives purely in Redux state? The flow in this case would be:

  • client requests raw log data
  • server sends back a unique deletion key in the headers of a successful response and stores on the log data manager
  • client stores that deletion key linked to the log period for which the download request was made

…interface for key maintenance rather than creating a separate top-level deletion keys store
@ncdiehl11 ncdiehl11 self-assigned this Jul 28, 2026
@ncdiehl11
ncdiehl11 marked this pull request as ready for review July 28, 2026 19:36
@ncdiehl11
ncdiehl11 requested review from mjhuff and sfoster1 July 28, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants