41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import type { InterestMap } from '@push.rocks/lik';
|
|
import type { SmartacmeCert } from '../smartacme.classes.cert.js';
|
|
|
|
// (ICertRecord removed; use SmartacmeCert directly)
|
|
|
|
/**
|
|
* Interface for certificate storage managers.
|
|
* Users can implement this to provide custom persistence (in-memory,
|
|
* file-based, Redis, etc.).
|
|
*/
|
|
export interface ICertManager {
|
|
/**
|
|
* Map for coordinating concurrent certificate requests.
|
|
*/
|
|
interestMap: InterestMap<string, SmartacmeCert>;
|
|
/**
|
|
* Initialize the store (e.g., connect to database).
|
|
*/
|
|
init(): Promise<void>;
|
|
/**
|
|
* Retrieve a certificate record by domain name.
|
|
* Returns null if none found.
|
|
*/
|
|
retrieveCertificate(domainName: string): Promise<SmartacmeCert | null>;
|
|
/**
|
|
* Store a certificate record. Fulfills any pending interests.
|
|
*/
|
|
storeCertificate(cert: SmartacmeCert): Promise<void>;
|
|
/**
|
|
* Delete a certificate record by domain name.
|
|
*/
|
|
deleteCertificate(domainName: string): Promise<void>;
|
|
/**
|
|
* Close the store (e.g., disconnect database).
|
|
*/
|
|
close(): Promise<void>;
|
|
/**
|
|
* Optional: wipe all stored certificates (e.g., for integration testing)
|
|
*/
|
|
wipe?(): Promise<void>;
|
|
} |