mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
perf: 支持部署到阿里云NLB、SLB
This commit is contained in:
@@ -29,6 +29,8 @@ export type AliyunSslUploadCertReq = {
|
||||
cert: AliyunCertInfo;
|
||||
};
|
||||
|
||||
export type CasCertInfo = { certId: number; certName: string; certIdentifier: string };
|
||||
|
||||
export class AliyunSslClient {
|
||||
opts: AliyunSslClientOpts;
|
||||
constructor(opts: AliyunSslClientOpts) {
|
||||
@@ -53,6 +55,22 @@ export class AliyunSslClient {
|
||||
return client;
|
||||
}
|
||||
|
||||
async getCertInfo(certId: number): Promise<CasCertInfo> {
|
||||
const client = await this.getClient();
|
||||
const params = {
|
||||
CertId: certId,
|
||||
};
|
||||
|
||||
const res = await client.request("GetUserCertificateDetail", params);
|
||||
this.checkRet(res);
|
||||
|
||||
return {
|
||||
certId: certId,
|
||||
certName: res.Name,
|
||||
certIdentifier: res.CertIdentifier,
|
||||
};
|
||||
}
|
||||
|
||||
async uploadCert(req: AliyunSslUploadCertReq) {
|
||||
const client = await this.getClient();
|
||||
const params = {
|
||||
|
||||
Reference in New Issue
Block a user