@push.rocks/smartacme 7.2.2 → 7.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartacme',
6
- version: '7.2.2',
6
+ version: '7.2.3',
7
7
  description: 'A TypeScript-based ACME client for LetsEncrypt certificate management with a focus on simplicity and power.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx1QkFBdUI7SUFDN0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLDZHQUE2RztDQUMzSCxDQUFBIn0=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@push.rocks/smartacme",
3
- "version": "7.2.2",
3
+ "version": "7.2.3",
4
4
  "private": false,
5
5
  "description": "A TypeScript-based ACME client for LetsEncrypt certificate management with a focus on simplicity and power.",
6
6
  "main": "dist_ts/index.js",
package/readme.md CHANGED
@@ -113,6 +113,54 @@ const certManager = new MongoCertManager({
113
113
  });
114
114
  ```
115
115
 
116
+ SmartAcme uses the `ICertManager` interface for certificate storage. Two built-in implementations are available:
117
+
118
+ - **MemoryCertManager**
119
+ - In-memory storage, suitable for testing or ephemeral use.
120
+ - Import example:
121
+ ```typescript
122
+ import { MemoryCertManager } from '@push.rocks/smartacme';
123
+ const certManager = new MemoryCertManager();
124
+ ```
125
+
126
+ - **MongoCertManager**
127
+ - Persistent storage in MongoDB (collection: `SmartacmeCert`).
128
+ - Import example:
129
+ ```typescript
130
+ import { MongoCertManager } from '@push.rocks/smartacme';
131
+ const certManager = new MongoCertManager({
132
+ mongoDbUrl: 'mongodb://yourmongoURL',
133
+ mongoDbName: 'yourDbName',
134
+ mongoDbPass: 'yourDbPassword',
135
+ });
136
+ ```
137
+
138
+ #### Custom Certificate Managers
139
+
140
+ To implement a custom certificate manager, implement the `ICertManager` interface and pass it to `SmartAcme`:
141
+
142
+ ```typescript
143
+ import type { ICertManager, Cert as SmartacmeCert } from '@push.rocks/smartacme';
144
+ import { SmartAcme } from '@push.rocks/smartacme';
145
+
146
+ class MyCustomCertManager implements ICertManager {
147
+ async init(): Promise<void> { /* setup storage */ }
148
+ async get(domainName: string): Promise<SmartacmeCert | null> { /* lookup cert */ }
149
+ async put(cert: SmartacmeCert): Promise<SmartacmeCert> { /* store cert */ }
150
+ async delete(domainName: string): Promise<void> { /* remove cert */ }
151
+ async close?(): Promise<void> { /* optional cleanup */ }
152
+ }
153
+
154
+ // Use your custom manager:
155
+ const customManager = new MyCustomCertManager();
156
+ const smartAcme = new SmartAcme({
157
+ accountEmail: 'youremail@example.com',
158
+ certManager: customManager,
159
+ environment: 'integration',
160
+ challengeHandlers: [], // add your handlers
161
+ });
162
+ ```
163
+
116
164
  ### Environmental Considerations
117
165
 
118
166
  When creating an instance of `SmartAcme`, you can specify an `environment` option. This is particularly useful for testing, as you can use the `integration` environment to avoid hitting rate limits and for testing your setup without issuing real certificates. Switch to `production` when you are ready to obtain actual certificates.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartacme',
6
- version: '7.2.2',
6
+ version: '7.2.3',
7
7
  description: 'A TypeScript-based ACME client for LetsEncrypt certificate management with a focus on simplicity and power.'
8
8
  }