fix(server): mark the identity reset as writing its new key on its own

Regenerating clears the stored key at once and writes the new one only after the issuer answered in the background, so the two writes cannot share a transaction.
This commit is contained in:
Maurice
2026-10-29 09:56:32 +01:00
committed by Maurice
parent cb546e4a72
commit 4ab3244f8f
@@ -138,7 +138,10 @@ export class ServiceKeyService {
});
}
/** The admin's way out of a revoked or cloned identity: forget the key and ask for a new one. */
/**
* The admin's way out of a revoked or cloned identity: forget the key and ask for a new one.
* @txIndependent the new key is written in the background once the issuer answered, long after the old one is gone.
*/
async regenerate(): Promise<void> {
if (this.config.key) throw conflict('The key is set by TREK_SERVICES_KEY and is changed there');
if (!this.inUse()) throw conflict('TREK services are not in use on this instance');