BREAKING CHANGE(SmartAcme): Refactor challenge handling by removing legacy setChallenge/removeChallenge in favor of pluggable challengeHandlers and update documentation and tests accordingly
This commit is contained in:
22
ts/handlers/IChallengeHandler.ts
Normal file
22
ts/handlers/IChallengeHandler.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Pluggable interface for ACME challenge handlers.
|
||||
* Supports DNS-01, HTTP-01, TLS-ALPN-01, or custom challenge types.
|
||||
*/
|
||||
export interface IChallengeHandler<T> {
|
||||
/**
|
||||
* ACME challenge types this handler supports (e.g. ['dns-01']).
|
||||
*/
|
||||
getSupportedTypes(): string[];
|
||||
/**
|
||||
* Prepare the challenge: set DNS record, start HTTP/TLS server, etc.
|
||||
*/
|
||||
prepare(ch: T): Promise<void>;
|
||||
/**
|
||||
* Optional extra verify step (HTTP GET, ALPN handshake).
|
||||
*/
|
||||
verify?(ch: T): Promise<void>;
|
||||
/**
|
||||
* Clean up resources: remove DNS record, stop server.
|
||||
*/
|
||||
cleanup(ch: T): Promise<void>;
|
||||
}
|
Reference in New Issue
Block a user