mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
perf: 支持http校验方式申请证书
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { BaseHttpChallengeUploader } from "../api";
|
||||
import { FtpAccess } from "@certd/plugin-lib";
|
||||
import { FtpClient } from "@certd/plugin-lib/dist/ftp/client";
|
||||
|
||||
export class FtpHttpChallengeUploader extends BaseHttpChallengeUploader<FtpAccess> {
|
||||
async upload(fileName: string, fileContent: string) {
|
||||
const client = new FtpClient({
|
||||
access: this.access,
|
||||
logger: this.logger,
|
||||
});
|
||||
await client.connect(async (client) => {
|
||||
await client.upload(fileName, fileContent);
|
||||
});
|
||||
}
|
||||
|
||||
async remove(fileName: string) {
|
||||
const client = new FtpClient({
|
||||
access: this.access,
|
||||
logger: this.logger,
|
||||
});
|
||||
await client.connect(async (client) => {
|
||||
await client.client.remove(fileName);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user