feat(smartacme): add forceRenew option to bypass cached certificate reuse during issuance
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-04-05 - 9.5.0 - feat(smartacme)
|
||||||
|
add forceRenew option to bypass cached certificate reuse during issuance
|
||||||
|
|
||||||
|
- adds a forceRenew flag to certificate issuance input handling
|
||||||
|
- skips the cached valid-certificate check when forceRenew is enabled
|
||||||
|
|
||||||
## 2026-04-03 - 9.4.0 - feat(smartacme)
|
## 2026-04-03 - 9.4.0 - feat(smartacme)
|
||||||
add forceRenew option for certificate issuance requests
|
add forceRenew option for certificate issuance requests
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartacme',
|
name: '@push.rocks/smartacme',
|
||||||
version: '9.4.0',
|
version: '9.5.0',
|
||||||
description: 'A TypeScript-based ACME client and server for certificate management with built-in CA, supporting LetsEncrypt and custom ACME authorities.'
|
description: 'A TypeScript-based ACME client and server for certificate management with built-in CA, supporting LetsEncrypt and custom ACME authorities.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ interface ICertIssuanceInput {
|
|||||||
domainArg: string;
|
domainArg: string;
|
||||||
isWildcardRequest: boolean;
|
isWildcardRequest: boolean;
|
||||||
includeWildcard: boolean;
|
includeWildcard: boolean;
|
||||||
|
forceRenew: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CERT_ISSUANCE_STEPS = [
|
const CERT_ISSUANCE_STEPS = [
|
||||||
@@ -159,6 +160,7 @@ export class SmartAcme {
|
|||||||
},
|
},
|
||||||
shouldExecute: async (_task, input?: ICertIssuanceInput) => {
|
shouldExecute: async (_task, input?: ICertIssuanceInput) => {
|
||||||
if (!input?.certDomainName || !this.certmanager) return true;
|
if (!input?.certDomainName || !this.certmanager) return true;
|
||||||
|
if (input.forceRenew) return true;
|
||||||
// Safety net: if a valid cert is already cached, skip re-issuance
|
// Safety net: if a valid cert is already cached, skip re-issuance
|
||||||
const existing = await this.certmanager.retrieveCertificate(input.certDomainName);
|
const existing = await this.certmanager.retrieveCertificate(input.certDomainName);
|
||||||
if (existing && !existing.shouldBeRenewed()) {
|
if (existing && !existing.shouldBeRenewed()) {
|
||||||
@@ -397,6 +399,7 @@ export class SmartAcme {
|
|||||||
domainArg,
|
domainArg,
|
||||||
isWildcardRequest,
|
isWildcardRequest,
|
||||||
includeWildcard: options?.includeWildcard ?? false,
|
includeWildcard: options?.includeWildcard ?? false,
|
||||||
|
forceRenew,
|
||||||
};
|
};
|
||||||
|
|
||||||
const result = await this.taskManager.triggerTaskConstrained(
|
const result = await this.taskManager.triggerTaskConstrained(
|
||||||
|
|||||||
Reference in New Issue
Block a user