mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
perf: 阿里云部分插件优化 @nicheng-he
1.新增RemoteAutoComplete插件 2.阿里云OSS部署插件支持自动获取BucketList 3.阿里云ESA支持选择上传到阿里云CAS产物 4.解决阿里云OSS默认接入点配置错误问题
This commit is contained in:
@@ -26,7 +26,7 @@ export class AliyunDeployCertToESA extends AbstractTaskPlugin {
|
||||
helper: "请选择证书申请任务输出的域名证书",
|
||||
component: {
|
||||
name: "output-selector",
|
||||
from: [...CertApplyPluginNames]
|
||||
from: [...CertApplyPluginNames, 'uploadCertToAliyun']
|
||||
},
|
||||
required: true
|
||||
})
|
||||
|
||||
@@ -59,6 +59,15 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
|
||||
@TaskInput({
|
||||
title: 'Bucket',
|
||||
helper: '存储桶名称',
|
||||
component: {
|
||||
name: 'remote-auto-complete',
|
||||
vModel: 'value',
|
||||
type: 'plugin',
|
||||
action: 'onGetBucketList',
|
||||
search: false,
|
||||
pager: false,
|
||||
watches: ['accessId', 'region']
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
bucket!: string;
|
||||
@@ -91,7 +100,7 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
|
||||
@TaskInput({
|
||||
title: '证书服务接入点',
|
||||
helper: '不会选就按默认',
|
||||
value: 'cas.aliyuncs.com',
|
||||
value: 'cn-hangzhou',
|
||||
component: {
|
||||
name: 'a-select',
|
||||
options: [
|
||||
@@ -101,6 +110,7 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
|
||||
],
|
||||
},
|
||||
required: true,
|
||||
order: -99,
|
||||
})
|
||||
casRegion!: string;
|
||||
|
||||
@@ -112,6 +122,7 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
|
||||
type: 'aliyun',
|
||||
},
|
||||
required: true,
|
||||
order: -98,
|
||||
})
|
||||
accessId!: string;
|
||||
|
||||
@@ -170,6 +181,24 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
|
||||
});
|
||||
}
|
||||
|
||||
async onGetBucketList(data: any) {
|
||||
console.log('data', data)
|
||||
|
||||
const access = (await this.getAccess(this.accessId)) as AliyunAccess;
|
||||
const client = await this.getClient(access);
|
||||
|
||||
let res;
|
||||
const buckets = []
|
||||
do{
|
||||
const requestData = {'marker': res?.nextMarker || null, 'max-keys': 1000};
|
||||
res = await client.listBuckets(requestData)
|
||||
buckets.push(...(res?.buckets || []))
|
||||
} while (!!res?.nextMarker)
|
||||
return buckets
|
||||
.filter(bucket => bucket?.region === this.region)
|
||||
.map(bucket => ({label: `${bucket.name}<${bucket.region}>`, value: bucket.name}));
|
||||
}
|
||||
|
||||
async doRequest(client: any, params: any) {
|
||||
params = client._bucketRequestParams('POST', this.bucket, {
|
||||
cname: '',
|
||||
|
||||
Reference in New Issue
Block a user