mirror of https://github.com/certd/certd
refactor: 1
parent
30cd62664b
commit
4739d75f4a
|
@ -52,14 +52,14 @@ export class DeployCertToTencentCDN extends AbstractTencentPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async execute ({ cert, props, context }) {
|
async execute ({ cert, props, context }) {
|
||||||
const accessProvider = this.getAccessProvider(props.accessProvider)
|
const accessProvider = this.getAccessProvider(props.accessProvider)
|
||||||
const client = this.getClient(accessProvider)
|
const client = this.getClient(accessProvider)
|
||||||
const params = this.buildParams(props, context, cert)
|
const params = this.buildParams(props, context, cert)
|
||||||
await this.doRequest(client, params)
|
await this.doRequest(client, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
async rollback ({ cert, props, context }) {
|
async rollback ({ cert, props, context }) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ export class DeployCertToTencentCDN extends AbstractTencentPlugin {
|
||||||
buildParams (props, context, cert) {
|
buildParams (props, context, cert) {
|
||||||
const { domainName, from } = props
|
const { domainName, from } = props
|
||||||
const { tencentCertId } = context
|
const { tencentCertId } = context
|
||||||
|
this.logger.info('部署腾讯云证书ID:', tencentCertId)
|
||||||
const params = {
|
const params = {
|
||||||
Https: {
|
Https: {
|
||||||
Switch: 'on',
|
Switch: 'on',
|
||||||
|
|
|
@ -128,7 +128,7 @@ export class DeployCertToTencentCLB extends AbstractTencentPlugin {
|
||||||
buildProps (props, context, cert) {
|
buildProps (props, context, cert) {
|
||||||
const { certName } = props
|
const { certName } = props
|
||||||
const { tencentCertId } = context
|
const { tencentCertId } = context
|
||||||
|
this.logger.info('部署腾讯云证书ID:', tencentCertId)
|
||||||
const params = {
|
const params = {
|
||||||
Certificate: {
|
Certificate: {
|
||||||
SSLMode: 'UNIDIRECTIONAL', // 单向认证
|
SSLMode: 'UNIDIRECTIONAL', // 单向认证
|
||||||
|
|
|
@ -123,6 +123,7 @@ export class DeployCertToTencentTKEIngress extends AbstractTencentPlugin {
|
||||||
if (tencentCertId == null) {
|
if (tencentCertId == null) {
|
||||||
throw new Error('请先将【上传证书到腾讯云】作为前置任务')
|
throw new Error('请先将【上传证书到腾讯云】作为前置任务')
|
||||||
}
|
}
|
||||||
|
this.logger.info('腾讯云证书ID:', tencentCertId)
|
||||||
const certIdBase64 = Buffer.from(tencentCertId).toString('base64')
|
const certIdBase64 = Buffer.from(tencentCertId).toString('base64')
|
||||||
|
|
||||||
const { namespace, secretName } = props
|
const { namespace, secretName } = props
|
||||||
|
|
Loading…
Reference in New Issue