feat(handlers): Add in-memory HTTP-01 challenge handler and rename file-based handler to Http01Webroot
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
import { Http01Handler } from '../ts/handlers/Http01Handler.js';
|
||||
import { Http01Webroot } from '../ts/handlers/Http01Handler.js';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import os from 'os';
|
||||
|
||||
tap.test('Http01Handler writes challenge file and removes it on cleanup', async () => {
|
||||
tap.test('Http01Webroot writes challenge file and removes it on cleanup', async () => {
|
||||
// create temporary webroot directory
|
||||
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'http01-'));
|
||||
const handler = new Http01Handler({ webroot: tmpDir });
|
||||
const handler = new Http01Webroot({ webroot: tmpDir });
|
||||
const token = 'testtoken';
|
||||
const keyAuth = 'keyAuthValue';
|
||||
const webPath = `/.well-known/acme-challenge/${token}`;
|
||||
|
Reference in New Issue
Block a user