mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 02:56:10 +00:00
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user