BREAKING CHANGE(SmartAcme (Cert Management)): Refactor certificate management and challenge handling API to use a unified certManager interface, remove legacy storage, and update challenge workflows.
This commit is contained in:
37
ts/interfaces/certmanager.ts
Normal file
37
ts/interfaces/certmanager.ts
Normal file
@ -0,0 +1,37 @@
|
||||
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>;
|
||||
}
|
Reference in New Issue
Block a user