feat(licenses): add archive/soft-delete for license packages #384

Closed
opened 2026-06-01 09:18:14 +00:00 by jmiller · 2 comments
Owner

Summary

Add an IsArchived field to LicensePackage so packages can be archived instead of permanently deleted. Archived packages are hidden from the main list but preserved for audit trails and existing key references.

Requirements

  • Add IsArchived bool field to LicensePackage model
  • Migration to add the column
  • Archive button in template (replaces delete for non-admins)
  • Archived packages hidden from default list, shown in a collapsible "Archived" section
  • Archived packages cannot generate new keys
  • Existing keys from archived packages continue to work
  • Site admins and org owners can permanently delete archived packages

Test Plan

  • Archive a package ? verify hidden from main list
  • Check archived section ? verify package appears there
  • Try to generate key from archived package ? verify rejected
  • Verify existing keys from archived package still validate
  • Unarchive ? verify returns to main list
  • Permanently delete archived package as site admin ? verify removed
  • Permanently delete as org owner ? verify removed
  • Try permanent delete as non-owner ? verify rejected

?? Generated with Claude Code

## Summary Add an `IsArchived` field to `LicensePackage` so packages can be archived instead of permanently deleted. Archived packages are hidden from the main list but preserved for audit trails and existing key references. ## Requirements - Add `IsArchived bool` field to `LicensePackage` model - Migration to add the column - Archive button in template (replaces delete for non-admins) - Archived packages hidden from default list, shown in a collapsible "Archived" section - Archived packages cannot generate new keys - Existing keys from archived packages continue to work - Site admins and org owners can permanently delete archived packages ## Test Plan - [ ] Archive a package ? verify hidden from main list - [ ] Check archived section ? verify package appears there - [ ] Try to generate key from archived package ? verify rejected - [ ] Verify existing keys from archived package still validate - [ ] Unarchive ? verify returns to main list - [ ] Permanently delete archived package as site admin ? verify removed - [ ] Permanently delete as org owner ? verify removed - [ ] Try permanent delete as non-owner ? verify rejected ?? Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Testing Plan — Package Archive

API

  • Archive package via POST → verify hidden from list endpoint
  • Archived package keys still validate via POST /validate
  • Unarchive package → verify returns to list
  • Generate key from archived package → verify rejected

GUI

  • Archive button (orange) visible on non-master packages
  • Collapsible "Archived Packages" section appears with count
  • Unarchive (reply icon) restores to main list
  • Delete button only for owners in archived section
  • Archive modal confirmation appears

🤖 Generated with Claude Code

## Testing Plan — Package Archive ### API - [ ] Archive package via POST → verify hidden from list endpoint - [ ] Archived package keys still validate via POST /validate - [ ] Unarchive package → verify returns to list - [ ] Generate key from archived package → verify rejected ### GUI - [ ] Archive button (orange) visible on non-master packages - [ ] Collapsible "Archived Packages" section appears with count - [ ] Unarchive (reply icon) restores to main list - [ ] Delete button only for owners in archived section - [ ] Archive modal confirmation appears 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jmiller added the pending: testing label 2026-06-01 10:13:50 +00:00
jmiller reopened this issue 2026-06-02 11:21:41 +00:00
Author
Owner

Tested and verified in production on MokoWaaS. All three download gating modes (none/prerelease/all), feed visibility, XML metadata, download URLs, and access control confirmed working.

Tested and verified in production on MokoWaaS. All three download gating modes (none/prerelease/all), feed visibility, XML metadata, download URLs, and access control confirmed working.
Sign in to join this conversation.
No labels pending: testing
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#384