feat(smartproxy/certificate): Integrate HTTP-01 challenge handler into ACME certificate provisioning workflow
This commit is contained in:
50
test/test.smartacme-integration.ts
Normal file
50
test/test.smartacme-integration.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import * as plugins from '../ts/plugins.js';
|
||||
import { tap } from '@push.rocks/tapbundle';
|
||||
import { SmartCertManager } from '../ts/proxies/smart-proxy/certificate-manager.js';
|
||||
import type { IRouteConfig } from '../ts/proxies/smart-proxy/models/route-types.js';
|
||||
|
||||
let certManager: SmartCertManager;
|
||||
|
||||
tap.test('should create a SmartCertManager instance', async () => {
|
||||
const routes: IRouteConfig[] = [
|
||||
{
|
||||
name: 'test-acme-route',
|
||||
match: {
|
||||
domains: ['test.example.com']
|
||||
},
|
||||
action: {
|
||||
type: 'proxy',
|
||||
target: 'http://localhost:3000',
|
||||
tls: {
|
||||
mode: 'terminate',
|
||||
certificate: 'auto'
|
||||
},
|
||||
acme: {
|
||||
email: 'test@example.com'
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
certManager = new SmartCertManager(routes, './test-certs', {
|
||||
email: 'test@example.com',
|
||||
useProduction: false
|
||||
});
|
||||
|
||||
// Just verify it creates without error
|
||||
expect(certManager).toBeInstanceOf(SmartCertManager);
|
||||
});
|
||||
|
||||
tap.test('should verify SmartAcme handlers are accessible', async () => {
|
||||
// Test that we can access SmartAcme handlers
|
||||
const http01Handler = new plugins.smartacme.handlers.Http01MemoryHandler();
|
||||
expect(http01Handler).toBeDefined();
|
||||
});
|
||||
|
||||
tap.test('should verify SmartAcme cert managers are accessible', async () => {
|
||||
// Test that we can access SmartAcme cert managers
|
||||
const memoryCertManager = new plugins.smartacme.certmanagers.MemoryCertManager();
|
||||
expect(memoryCertManager).toBeDefined();
|
||||
});
|
||||
|
||||
tap.start();
|
Reference in New Issue
Block a user