chore: 阿里云上传证书返回值优化为带region的

This commit is contained in:
xiaojunnuo
2026-01-31 19:36:37 +08:00
parent 1a0d3eeb1b
commit 1089aeab9e
10 changed files with 24 additions and 20 deletions

View File

@@ -305,11 +305,11 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
});
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt));
const certIdRes = await sslClient.uploadCert({
const certIdRes = await sslClient.uploadCertificate({
name: certName,
cert: this.cert
});
certId = certIdRes.certId;
certId = certIdRes.certId as any;
}
return certId;

View File

@@ -155,11 +155,11 @@ export class AliyunDeployCertToAll extends AbstractTaskPlugin {
//
let certId: any = this.cert;
if (typeof this.cert === "object") {
const certIdRes = await sslClient.uploadCert({
const certIdRes = await sslClient.uploadCertificate({
name: this.appendTimeSuffix("certd"),
cert: this.cert,
});
certId = certIdRes.certId;
certId = certIdRes.certId as any;
}
const jobId = await this.createDeployJob(sslClient, certId);

View File

@@ -115,11 +115,11 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
if (typeof this.cert === 'object') {
// @ts-ignore
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt))
const certIdRes = await sslClient.uploadCert({
const certIdRes = await sslClient.uploadCertificate({
name:certName,
cert: this.cert,
});
certId = certIdRes.certId;
certId = certIdRes.certId as any;
}
const client = await this.getClient(access);

View File

@@ -119,11 +119,11 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt));
const certIdRes = await sslClient.uploadCert({
const certIdRes = await sslClient.uploadCertificate({
name: certName,
cert: this.cert
});
certId = certIdRes.certId;
certId = certIdRes.certId as any;
this.logger.info("上传证书成功", certId, certName);
}
return {

View File

@@ -294,11 +294,11 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
const certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt))
const certIdRes = await sslClient.uploadCert({
const certIdRes = await sslClient.uploadCertificate({
name: certName,
cert: this.cert,
});
certId = certIdRes.certId;
certId = certIdRes.certId as any;
}
return certId;
}

View File

@@ -212,11 +212,11 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt));
const certIdRes = await sslClient.uploadCert({
const certIdRes = await sslClient.uploadCertificate({
name: certName,
cert: this.cert
});
certId = certIdRes.certId;
certId = certIdRes.certId as any;
this.logger.info("上传证书成功", certId, certName);
}
return {

View File

@@ -251,11 +251,11 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
if (typeof this.cert === 'object') {
const name = this.appendTimeSuffix('certd');
const certIdRes = await sslClient.uploadCert({
const certIdRes = await sslClient.uploadCertificate({
name: name,
cert: this.cert,
});
certId = certIdRes.certId;
certId = certIdRes.certId as any;
}
return await sslClient.getCertInfo(certId);

View File

@@ -152,11 +152,11 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
endpoint: this.casEndpoint,
});
const certIdRes = await sslClient.uploadCert({
const certIdRes = await sslClient.uploadCertificate({
name: this.buildCertName(CertReader.getMainDomain(this.cert.crt)),
cert: this.cert,
});
certId = certIdRes.certId;
certId = certIdRes.certId as any;
}
const client = await this.getWafClient(access);

View File

@@ -104,11 +104,11 @@ export class UploadCertToAliyun extends AbstractTaskPlugin {
}else{
certName = this.buildCertName(CertReader.getMainDomain(this.cert.crt))
}
const certIdRes = await client.uploadCert({
const certIdRes = await client.uploadCertificate({
name: certName,
cert: this.cert,
});
this.aliyunCertId = certIdRes.certId as any;
this.aliyunCertId = certIdRes as any;
}
}
//注册插件

View File

@@ -98,7 +98,11 @@ export class AliyunSslClient {
return `${certId}-${this.getCasRegionFromEndpoint(this.opts.endpoint)}`;
}
async uploadCert(req: AliyunSslUploadCertReq) : Promise<CasCertId> {
async uploadCert(req: AliyunSslUploadCertReq) {
const {certId} = await this.uploadCertificate(req);
return certId;
}
async uploadCertificate(req: AliyunSslUploadCertReq) : Promise<CasCertId> {
const client = await this.getClient();
const params = {
Name: req.name,
@@ -127,7 +131,7 @@ export class AliyunSslClient {
// 上传证书到阿里云
this.logger.info(`开始上传证书`);
const certName = CertReader.buildCertName(cert);
const res = await this.uploadCert({
const res = await this.uploadCertificate({
name: certName,
cert: cert
});