Context
PR#115 (pending) adds credential expiration tracking. A natural follow-up: before a credential expires, its holder should be able to renew it (extend the expiry) without a full revoke + re-issue cycle. This preserves the credential ID and history.
What to implement
Route: POST /api/protocol/passport/[id]/credentials/[credId]/renew
Request body: { expiresAt: number } — must be in the future and beyond the current expiry.
Validation
- Cannot renew an already-expired credential → 400 with
'credential_already_expired'
- Cannot renew a revoked credential → 400
- New
expiresAt must be at least 1 day from now → 400 if too soon
- Admin-only: only an admin or the issuer can renew
Post-renewal
Acceptance criteria
🎁 Evidencia visual = reward extra
- Si tu PR incluye video demo o capturas de pantalla mostrando la funcionalidad pedida funcionando end-to-end, va a ser considerado para rewards de GrantFox en esta issue. No es obligatorio, pero suma mucho para la evaluación.
Context
PR#115 (pending) adds credential expiration tracking. A natural follow-up: before a credential expires, its holder should be able to renew it (extend the expiry) without a full revoke + re-issue cycle. This preserves the credential ID and history.
What to implement
Route: POST /api/protocol/passport/[id]/credentials/[credId]/renew
Request body:
{ expiresAt: number }— must be in the future and beyond the current expiry.Validation
'credential_already_expired'expiresAtmust be at least 1 day from now → 400 if too soonPost-renewal
expiresAtin place (same credential ID)'credential_renewed', old/new expiry in metadatacredential.renewedevent with{ credentialId, oldExpiresAt, newExpiresAt }Acceptance criteria
🎁 Evidencia visual = reward extra