feat(api): add RenewLicenseKey API endpoint #387

Open
opened 2026-06-01 09:19:16 +00:00 by jmiller · 1 comment
Owner

Summary

The web UI has a Renew button for license keys (extends expiry by package duration), but there is no corresponding API endpoint for programmatic renewal.

Requirements

  • POST /api/v1/repos/{owner}/{repo}/license-keys/{id}/renew
  • Optional days parameter (defaults to package DurationDays)
  • Returns updated key with new expiry
  • Requires repo admin auth

Test Plan

  • Renew key via API → verify expiry extended
  • Renew expired key → verify re-activated from now
  • Renew with custom days → verify uses specified duration
  • Renew without auth → verify 401
  • Renew master key → verify works (master keys can be renewed)

🤖 Generated with Claude Code

## Summary The web UI has a Renew button for license keys (extends expiry by package duration), but there is no corresponding API endpoint for programmatic renewal. ## Requirements - `POST /api/v1/repos/{owner}/{repo}/license-keys/{id}/renew` - Optional `days` parameter (defaults to package DurationDays) - Returns updated key with new expiry - Requires repo admin auth ## Test Plan - [ ] Renew key via API → verify expiry extended - [ ] Renew expired key → verify re-activated from now - [ ] Renew with custom days → verify uses specified duration - [ ] Renew without auth → verify 401 - [ ] Renew master key → verify works (master keys can be renewed) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Testing Plan — API Renew Endpoint

API

  • POST /license-keys/{id}/renew → 200, new expiry in response
  • Renew expired key → expiry extends from now, is_active re-enabled
  • Renew active key → expiry extends from current expiry date
  • Renew lifetime package (duration=0) → extends by 365 days default
  • Renew without auth → 401
  • Renew nonexistent key → 404

🤖 Generated with Claude Code

## Testing Plan — API Renew Endpoint ### API - [ ] POST /license-keys/{id}/renew → 200, new expiry in response - [ ] Renew expired key → expiry extends from now, is_active re-enabled - [ ] Renew active key → expiry extends from current expiry date - [ ] Renew lifetime package (duration=0) → extends by 365 days default - [ ] Renew without auth → 401 - [ ] Renew nonexistent key → 404 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jmiller added the pending: testing label 2026-06-01 10:13:52 +00:00
jmiller reopened this issue 2026-06-02 11:21:42 +00:00
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#387