diff --git a/internal/certdeploy/deployers/sp_aliyun_ddos.go b/internal/certdeploy/deployers/sp_aliyun_ddos.go index 2c637a293..ac985fbb0 100644 --- a/internal/certdeploy/deployers/sp_aliyun_ddos.go +++ b/internal/certdeploy/deployers/sp_aliyun_ddos.go @@ -5,18 +5,18 @@ import ( "github.com/certimate-go/certimate/internal/domain" "github.com/certimate-go/certimate/pkg/core" - aliyunddos "github.com/certimate-go/certimate/pkg/core/ssl-deployer/providers/aliyun-ddos" + aliyunddospro "github.com/certimate-go/certimate/pkg/core/ssl-deployer/providers/aliyun-ddospro" xmaps "github.com/certimate-go/certimate/pkg/utils/maps" ) func init() { - if err := Registries.Register(domain.DeploymentProviderTypeAliyunDDoS, func(options *ProviderFactoryOptions) (core.SSLDeployer, error) { + if err := Registries.Register(domain.DeploymentProviderTypeAliyunDDoSPro, func(options *ProviderFactoryOptions) (core.SSLDeployer, error) { credentials := domain.AccessConfigForAliyun{} if err := xmaps.Populate(options.ProviderAccessConfig, &credentials); err != nil { return nil, fmt.Errorf("failed to populate provider access config: %w", err) } - provider, err := aliyunddos.NewSSLDeployerProvider(&aliyunddos.SSLDeployerProviderConfig{ + provider, err := aliyunddospro.NewSSLDeployerProvider(&aliyunddospro.SSLDeployerProviderConfig{ AccessKeyId: credentials.AccessKeyId, AccessKeySecret: credentials.AccessKeySecret, ResourceGroupId: credentials.ResourceGroupId, diff --git a/internal/domain/provider.go b/internal/domain/provider.go index 4980be0c8..91855b8c5 100644 --- a/internal/domain/provider.go +++ b/internal/domain/provider.go @@ -230,7 +230,7 @@ const ( DeploymentProviderTypeAliyunCDN = DeploymentProviderType(AccessProviderTypeAliyun + "-cdn") DeploymentProviderTypeAliyunCLB = DeploymentProviderType(AccessProviderTypeAliyun + "-clb") DeploymentProviderTypeAliyunDCDN = DeploymentProviderType(AccessProviderTypeAliyun + "-dcdn") - DeploymentProviderTypeAliyunDDoS = DeploymentProviderType(AccessProviderTypeAliyun + "-ddos") + DeploymentProviderTypeAliyunDDoSPro = DeploymentProviderType(AccessProviderTypeAliyun + "-ddospro") DeploymentProviderTypeAliyunESA = DeploymentProviderType(AccessProviderTypeAliyun + "-esa") DeploymentProviderTypeAliyunFC = DeploymentProviderType(AccessProviderTypeAliyun + "-fc") DeploymentProviderTypeAliyunGA = DeploymentProviderType(AccessProviderTypeAliyun + "-ga") diff --git a/pkg/core/ssl-deployer/providers/aliyun-ddos/aliyun_ddos.go b/pkg/core/ssl-deployer/providers/aliyun-ddospro/aliyun_ddospro.go similarity index 93% rename from pkg/core/ssl-deployer/providers/aliyun-ddos/aliyun_ddos.go rename to pkg/core/ssl-deployer/providers/aliyun-ddospro/aliyun_ddospro.go index dec81ee75..49548e3f0 100644 --- a/pkg/core/ssl-deployer/providers/aliyun-ddos/aliyun_ddos.go +++ b/pkg/core/ssl-deployer/providers/aliyun-ddospro/aliyun_ddospro.go @@ -1,4 +1,4 @@ -package aliyunddos +package aliyunddospro import ( "context" @@ -9,7 +9,7 @@ import ( "strings" aliopen "github.com/alibabacloud-go/darabonba-openapi/v2/client" - aliddos "github.com/alibabacloud-go/ddoscoo-20200101/v4/client" + aliddoscoo "github.com/alibabacloud-go/ddoscoo-20200101/v4/client" "github.com/alibabacloud-go/tea/tea" "github.com/samber/lo" @@ -33,7 +33,7 @@ type SSLDeployerProviderConfig struct { type SSLDeployerProvider struct { config *SSLDeployerProviderConfig logger *slog.Logger - sdkClient *aliddos.Client + sdkClient *aliddoscoo.Client sslManager core.SSLManager } @@ -95,7 +95,7 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke // 为网站业务转发规则关联 SSL 证书 // REF: https://help.aliyun.com/zh/anti-ddos/anti-ddos-pro-and-premium/developer-reference/api-ddoscoo-2020-01-01-associatewebcert certId, _ := strconv.ParseInt(upres.CertId, 10, 32) - associateWebCertReq := &aliddos.AssociateWebCertRequest{ + associateWebCertReq := &aliddoscoo.AssociateWebCertRequest{ Domain: tea.String(d.config.Domain), CertId: tea.Int32(int32(certId)), } @@ -108,7 +108,7 @@ func (d *SSLDeployerProvider) Deploy(ctx context.Context, certPEM string, privke return &core.SSLDeployResult{}, nil } -func createSDKClient(accessKeyId, accessKeySecret, region string) (*aliddos.Client, error) { +func createSDKClient(accessKeyId, accessKeySecret, region string) (*aliddoscoo.Client, error) { // 接入点一览 https://api.aliyun.com/product/ddoscoo var endpoint string switch region { @@ -124,7 +124,7 @@ func createSDKClient(accessKeyId, accessKeySecret, region string) (*aliddos.Clie Endpoint: tea.String(endpoint), } - client, err := aliddos.NewClient(config) + client, err := aliddoscoo.NewClient(config) if err != nil { return nil, err } diff --git a/pkg/core/ssl-deployer/providers/aliyun-ddos/aliyun_ddos_test.go b/pkg/core/ssl-deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go similarity index 74% rename from pkg/core/ssl-deployer/providers/aliyun-ddos/aliyun_ddos_test.go rename to pkg/core/ssl-deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go index 180b2ad2f..458e1928a 100644 --- a/pkg/core/ssl-deployer/providers/aliyun-ddos/aliyun_ddos_test.go +++ b/pkg/core/ssl-deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go @@ -1,4 +1,4 @@ -package aliyunddos_test +package aliyunddospro_test import ( "context" @@ -8,7 +8,7 @@ import ( "strings" "testing" - provider "github.com/certimate-go/certimate/pkg/core/ssl-deployer/providers/aliyun-ddos" + provider "github.com/certimate-go/certimate/pkg/core/ssl-deployer/providers/aliyun-ddospro" ) var ( @@ -21,7 +21,7 @@ var ( ) func init() { - argsPrefix := "CERTIMATE_SSLDEPLOYER_ALIYUNDDOS_" + argsPrefix := "CERTIMATE_SSLDEPLOYER_ALIYUNDDOSPRO_" flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "") flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "") @@ -34,13 +34,13 @@ func init() { /* Shell command to run this test: - go test -v ./aliyun_ddos_test.go -args \ - --CERTIMATE_SSLDEPLOYER_ALIYUNDDOS_INPUTCERTPATH="/path/to/your-input-cert.pem" \ - --CERTIMATE_SSLDEPLOYER_ALIYUNDDOS_INPUTKEYPATH="/path/to/your-input-key.pem" \ - --CERTIMATE_SSLDEPLOYER_ALIYUNDDOS_ACCESSKEYID="your-access-key-id" \ - --CERTIMATE_SSLDEPLOYER_ALIYUNDDOS_ACCESSKEYSECRET="your-access-key-secret" \ - --CERTIMATE_SSLDEPLOYER_ALIYUNDDOS_REGION="cn-hangzhou" \ - --CERTIMATE_SSLDEPLOYER_ALIYUNDDOS_DOMAIN="example.com" + go test -v ./aliyun_ddospro_test.go -args \ + --CERTIMATE_SSLDEPLOYER_ALIYUNDDOSPRO_INPUTCERTPATH="/path/to/your-input-cert.pem" \ + --CERTIMATE_SSLDEPLOYER_ALIYUNDDOSPRO_INPUTKEYPATH="/path/to/your-input-key.pem" \ + --CERTIMATE_SSLDEPLOYER_ALIYUNDDOSPRO_ACCESSKEYID="your-access-key-id" \ + --CERTIMATE_SSLDEPLOYER_ALIYUNDDOSPRO_ACCESSKEYSECRET="your-access-key-secret" \ + --CERTIMATE_SSLDEPLOYER_ALIYUNDDOSPRO_REGION="cn-hangzhou" \ + --CERTIMATE_SSLDEPLOYER_ALIYUNDDOSPRO_DOMAIN="example.com" */ func TestDeploy(t *testing.T) { flag.Parse() diff --git a/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProvider.tsx b/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProvider.tsx index b1278a1ae..b47ad41ad 100644 --- a/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProvider.tsx +++ b/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProvider.tsx @@ -112,7 +112,7 @@ const providerComponentMap: Partial { } + tooltip={} > - + } + tooltip={} > - + ); @@ -53,7 +53,7 @@ const getSchema = ({ i18n = getI18n() }: { i18n?: ReturnType }) const { t } = i18n; return z.object({ - region: z.string().nonempty(t("workflow_node.deploy.form.aliyun_ddos_region.placeholder")), + region: z.string().nonempty(t("workflow_node.deploy.form.aliyun_ddospro_region.placeholder")), domain: z.string().refine((v) => validDomainName(v, { allowWildcard: true }), t("common.errmsg.domain_invalid")), }); }; diff --git a/ui/src/domain/provider.ts b/ui/src/domain/provider.ts index 1e10f03ec..32e18e3a2 100644 --- a/ui/src/domain/provider.ts +++ b/ui/src/domain/provider.ts @@ -480,7 +480,7 @@ export const DEPLOYMENT_PROVIDERS = Object.freeze({ ALIYUN_CDN: `${ACCESS_PROVIDERS.ALIYUN}-cdn`, ALIYUN_CLB: `${ACCESS_PROVIDERS.ALIYUN}-clb`, ALIYUN_DCDN: `${ACCESS_PROVIDERS.ALIYUN}-dcdn`, - ALIYUN_DDOS: `${ACCESS_PROVIDERS.ALIYUN}-ddospro`, + ALIYUN_DDOSPRO: `${ACCESS_PROVIDERS.ALIYUN}-ddospro`, ALIYUN_ESA: `${ACCESS_PROVIDERS.ALIYUN}-esa`, ALIYUN_FC: `${ACCESS_PROVIDERS.ALIYUN}-fc`, ALIYUN_GA: `${ACCESS_PROVIDERS.ALIYUN}-ga`, @@ -617,7 +617,7 @@ export const deploymentProvidersMap: Maphttps://dcdn.console.aliyun.com", - "workflow_node.deploy.form.aliyun_ddos_region.label": "Alibaba Cloud Anti-DDoS region", - "workflow_node.deploy.form.aliyun_ddos_region.placeholder": "Please enter Alibaba Cloud Anti-DDoS region (e.g. cn-hangzhou)", - "workflow_node.deploy.form.aliyun_ddos_region.tooltip": "For more information, see https://www.alibabacloud.com/help/en/anti-ddos/anti-ddos-pro-and-premium/developer-reference/api-ddoscoo-2020-01-01-endpoint", - "workflow_node.deploy.form.aliyun_ddos_domain.label": "Alibaba Cloud Anti-DDoS domain", - "workflow_node.deploy.form.aliyun_ddos_domain.placeholder": "Please enter Alibaba Cloud Anti-DDoS domain name", - "workflow_node.deploy.form.aliyun_ddos_domain.tooltip": "For more information, see https://yundun.console.aliyun.com/?p=ddoscoo", + "workflow_node.deploy.form.aliyun_ddospro_region.label": "Alibaba Cloud Anti-DDoS region", + "workflow_node.deploy.form.aliyun_ddospro_region.placeholder": "Please enter Alibaba Cloud Anti-DDoS region (e.g. cn-hangzhou)", + "workflow_node.deploy.form.aliyun_ddospro_region.tooltip": "For more information, see https://www.alibabacloud.com/help/en/anti-ddos/anti-ddos-pro-and-premium/developer-reference/api-ddoscoo-2020-01-01-endpoint", + "workflow_node.deploy.form.aliyun_ddospro_domain.label": "Alibaba Cloud Anti-DDoS domain", + "workflow_node.deploy.form.aliyun_ddospro_domain.placeholder": "Please enter Alibaba Cloud Anti-DDoS domain name", + "workflow_node.deploy.form.aliyun_ddospro_domain.tooltip": "For more information, see https://yundun.console.aliyun.com/?p=ddoscoo", "workflow_node.deploy.form.aliyun_esa_region.label": "Alibaba Cloud ESA region", "workflow_node.deploy.form.aliyun_esa_region.placeholder": "Please enter Alibaba Cloud ESA region (e.g. cn-hangzhou)", "workflow_node.deploy.form.aliyun_esa_region.tooltip": "For more information, see https://www.alibabacloud.com/help/en/edge-security-acceleration/esa/api-esa-2024-09-10-endpoint", diff --git a/ui/src/i18n/locales/zh/nls.provider.json b/ui/src/i18n/locales/zh/nls.provider.json index 55d5af7b6..9995b062b 100644 --- a/ui/src/i18n/locales/zh/nls.provider.json +++ b/ui/src/i18n/locales/zh/nls.provider.json @@ -14,7 +14,7 @@ "provider.aliyun.cdn": "阿里云 - 内容分发网络 CDN", "provider.aliyun.clb": "阿里云 - 传统型负载均衡 CLB", "provider.aliyun.dcdn": "阿里云 - 全站加速 DCDN", - "provider.aliyun.ddos": "阿里云 - DDoS 高防", + "provider.aliyun.ddospro": "阿里云 - DDoS 高防", "provider.aliyun.dns": "阿里云 - 云解析 DNS", "provider.aliyun.esa": "阿里云 - 边缘安全加速 ESA", "provider.aliyun.fc": "阿里云 - 函数计算 FC", diff --git a/ui/src/i18n/locales/zh/nls.workflow.nodes.json b/ui/src/i18n/locales/zh/nls.workflow.nodes.json index 0646a48dc..cfa7d3093 100644 --- a/ui/src/i18n/locales/zh/nls.workflow.nodes.json +++ b/ui/src/i18n/locales/zh/nls.workflow.nodes.json @@ -292,12 +292,12 @@ "workflow_node.deploy.form.aliyun_dcdn_domain.label": "阿里云 DCDN 加速域名", "workflow_node.deploy.form.aliyun_dcdn_domain.placeholder": "请输入阿里云 DCDN 加速域名(支持泛域名)", "workflow_node.deploy.form.aliyun_dcdn_domain.tooltip": "这是什么?请参阅 https://dcdn.console.aliyun.com", - "workflow_node.deploy.form.aliyun_ddos_region.label": "阿里云 DDoS 高防服务地域", - "workflow_node.deploy.form.aliyun_ddos_region.placeholder": "请输入阿里云 DDoS 高防服务地域(例如:cn-hangzhou)", - "workflow_node.deploy.form.aliyun_ddos_region.tooltip": "这是什么?请参阅 https://help.aliyun.com/zh/anti-ddos/anti-ddos-pro-and-premium/developer-reference/api-ddoscoo-2020-01-01-endpoint", - "workflow_node.deploy.form.aliyun_ddos_domain.label": "阿里云 DDoS 高防网站域名", - "workflow_node.deploy.form.aliyun_ddos_domain.placeholder": "请输入阿里云 DDoS 高防网站域名(支持泛域名)", - "workflow_node.deploy.form.aliyun_ddos_domain.tooltip": "这是什么?请参阅 https://yundun.console.aliyun.com/?p=ddoscoo", + "workflow_node.deploy.form.aliyun_ddospro_region.label": "阿里云 DDoS 高防服务地域", + "workflow_node.deploy.form.aliyun_ddospro_region.placeholder": "请输入阿里云 DDoS 高防服务地域(例如:cn-hangzhou)", + "workflow_node.deploy.form.aliyun_ddospro_region.tooltip": "这是什么?请参阅 https://help.aliyun.com/zh/anti-ddos/anti-ddos-pro-and-premium/developer-reference/api-ddoscoo-2020-01-01-endpoint", + "workflow_node.deploy.form.aliyun_ddospro_domain.label": "阿里云 DDoS 高防网站域名", + "workflow_node.deploy.form.aliyun_ddospro_domain.placeholder": "请输入阿里云 DDoS 高防网站域名(支持泛域名)", + "workflow_node.deploy.form.aliyun_ddospro_domain.tooltip": "这是什么?请参阅 https://yundun.console.aliyun.com/?p=ddoscoo", "workflow_node.deploy.form.aliyun_esa_region.label": "阿里云 ESA 服务地域", "workflow_node.deploy.form.aliyun_esa_region.placeholder": "请输入阿里云 ESA 服务地域(例如:cn-hangzhou)", "workflow_node.deploy.form.aliyun_esa_region.tooltip": "这是什么?请参阅 https://help.aliyun.com/zh/edge-security-acceleration/esa/api-esa-2024-09-10-endpoint",