mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-18 17:31:55 +08:00
feat: add edgio applications v7 deployer
This commit is contained in:
parent
dd236b925d
commit
974c320925
@ -127,6 +127,7 @@ make local.run
|
|||||||
| [多吉云](https://www.dogecloud.com/) | 可部署到多吉云 CDN |
|
| [多吉云](https://www.dogecloud.com/) | 可部署到多吉云 CDN |
|
||||||
| [BytePlus](https://www.byteplus.com/) | 可部署到 BytePlus CDN 等服务 |
|
| [BytePlus](https://www.byteplus.com/) | 可部署到 BytePlus CDN 等服务 |
|
||||||
| [优刻得](https://www.ucloud.cn/) | 可部署到优刻得 US3、UCDN 等服务 |
|
| [优刻得](https://www.ucloud.cn/) | 可部署到优刻得 US3、UCDN 等服务 |
|
||||||
|
| [Edgio](https://edg.io/) | 可部署到 Edgio Applications 等服务 |
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -126,6 +126,7 @@ The following hosting providers are supported:
|
|||||||
| [Doge Cloud](https://www.dogecloud.com/) | Supports deployment to Doge Cloud CDN |
|
| [Doge Cloud](https://www.dogecloud.com/) | Supports deployment to Doge Cloud CDN |
|
||||||
| [BytePlus](https://www.byteplus.com/) | Supports deployment to BytePlus CDN |
|
| [BytePlus](https://www.byteplus.com/) | Supports deployment to BytePlus CDN |
|
||||||
| [UCloud](https://www.ucloud-global.com/) | Supports deployment to UCloud US3, UCDN |
|
| [UCloud](https://www.ucloud-global.com/) | Supports deployment to UCloud US3, UCDN |
|
||||||
|
| [Edgio](https://edg.io/) | Supports deployment to Edgio Applications |
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
1
go.mod
1
go.mod
@ -18,6 +18,7 @@ require (
|
|||||||
github.com/baidubce/bce-sdk-go v0.9.209
|
github.com/baidubce/bce-sdk-go v0.9.209
|
||||||
github.com/byteplus-sdk/byteplus-sdk-golang v1.0.35
|
github.com/byteplus-sdk/byteplus-sdk-golang v1.0.35
|
||||||
github.com/go-acme/lego/v4 v4.21.0
|
github.com/go-acme/lego/v4 v4.21.0
|
||||||
|
github.com/go-resty/resty/v2 v2.16.3
|
||||||
github.com/go-viper/mapstructure/v2 v2.2.1
|
github.com/go-viper/mapstructure/v2 v2.2.1
|
||||||
github.com/gojek/heimdall/v7 v7.0.3
|
github.com/gojek/heimdall/v7 v7.0.3
|
||||||
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.128
|
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.128
|
||||||
|
2
go.sum
2
go.sum
@ -398,6 +398,8 @@ github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa
|
|||||||
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
||||||
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
|
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
|
||||||
github.com/go-playground/validator/v10 v10.7.0/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk=
|
github.com/go-playground/validator/v10 v10.7.0/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk=
|
||||||
|
github.com/go-resty/resty/v2 v2.16.3 h1:zacNT7lt4b8M/io2Ahj6yPypL7bqx9n1iprfQuodV+E=
|
||||||
|
github.com/go-resty/resty/v2 v2.16.3/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
|
||||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||||
|
@ -20,9 +20,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ApplyCertResult struct {
|
type ApplyCertResult struct {
|
||||||
Certificate string
|
CertificateChain string
|
||||||
PrivateKey string
|
|
||||||
IssuerCertificate string
|
IssuerCertificate string
|
||||||
|
PrivateKey string
|
||||||
ACMECertUrl string
|
ACMECertUrl string
|
||||||
ACMECertStableUrl string
|
ACMECertStableUrl string
|
||||||
CSR string
|
CSR string
|
||||||
@ -150,9 +150,9 @@ func apply(challengeProvider challenge.Provider, options *applicantOptions) (*Ap
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &ApplyCertResult{
|
return &ApplyCertResult{
|
||||||
PrivateKey: string(certResource.PrivateKey),
|
CertificateChain: strings.TrimSpace(string(certResource.Certificate)),
|
||||||
Certificate: string(certResource.Certificate),
|
IssuerCertificate: strings.TrimSpace(string(certResource.IssuerCertificate)),
|
||||||
IssuerCertificate: string(certResource.IssuerCertificate),
|
PrivateKey: strings.TrimSpace(string(certResource.PrivateKey)),
|
||||||
ACMECertUrl: certResource.CertURL,
|
ACMECertUrl: certResource.CertURL,
|
||||||
ACMECertStableUrl: certResource.CertStableURL,
|
ACMECertStableUrl: certResource.CertStableURL,
|
||||||
CSR: string(certResource.CSR),
|
CSR: string(certResource.CSR),
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
providerBaiduCloudCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/baiducloud-cdn"
|
providerBaiduCloudCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/baiducloud-cdn"
|
||||||
providerBytePlusCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/byteplus-cdn"
|
providerBytePlusCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/byteplus-cdn"
|
||||||
providerDogeCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/dogecloud-cdn"
|
providerDogeCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/dogecloud-cdn"
|
||||||
|
providerEdgioApplications "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/edgio-applications"
|
||||||
providerHuaweiCloudCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/huaweicloud-cdn"
|
providerHuaweiCloudCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/huaweicloud-cdn"
|
||||||
providerHuaweiCloudELB "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/huaweicloud-elb"
|
providerHuaweiCloudELB "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/huaweicloud-elb"
|
||||||
providerK8sSecret "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/k8s-secret"
|
providerK8sSecret "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/k8s-secret"
|
||||||
@ -175,6 +176,21 @@ func createDeployer(options *deployerOptions) (deployer.Deployer, logger.Logger,
|
|||||||
return deployer, logger, err
|
return deployer, logger, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case domain.DeployProviderTypeEdgioApplications:
|
||||||
|
{
|
||||||
|
access := domain.AccessConfigForEdgio{}
|
||||||
|
if err := maps.Decode(options.ProviderAccessConfig, &access); err != nil {
|
||||||
|
return nil, nil, fmt.Errorf("failed to decode provider access config: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
deployer, err := providerEdgioApplications.NewWithLogger(&providerEdgioApplications.EdgioApplicationsDeployerConfig{
|
||||||
|
ClientId: access.ClientId,
|
||||||
|
ClientSecret: access.ClientSecret,
|
||||||
|
EnvironmentId: maps.GetValueAsString(options.ProviderDeployConfig, "environmentId"),
|
||||||
|
}, logger)
|
||||||
|
return deployer, logger, err
|
||||||
|
}
|
||||||
|
|
||||||
case domain.DeployProviderTypeHuaweiCloudCDN, domain.DeployProviderTypeHuaweiCloudELB:
|
case domain.DeployProviderTypeHuaweiCloudCDN, domain.DeployProviderTypeHuaweiCloudELB:
|
||||||
{
|
{
|
||||||
access := domain.AccessConfigForHuaweiCloud{}
|
access := domain.AccessConfigForHuaweiCloud{}
|
||||||
|
@ -66,6 +66,11 @@ type AccessConfigForDogeCloud struct {
|
|||||||
SecretKey string `json:"secretKey"`
|
SecretKey string `json:"secretKey"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AccessConfigForEdgio struct {
|
||||||
|
ClientId string `json:"clientId"`
|
||||||
|
ClientSecret string `json:"clientSecret"`
|
||||||
|
}
|
||||||
|
|
||||||
type AccessConfigForGoDaddy struct {
|
type AccessConfigForGoDaddy struct {
|
||||||
ApiKey string `json:"apiKey"`
|
ApiKey string `json:"apiKey"`
|
||||||
ApiSecret string `json:"apiSecret"`
|
ApiSecret string `json:"apiSecret"`
|
||||||
|
@ -17,6 +17,7 @@ const (
|
|||||||
AccessProviderTypeBytePlus = AccessProviderType("byteplus")
|
AccessProviderTypeBytePlus = AccessProviderType("byteplus")
|
||||||
AccessProviderTypeCloudflare = AccessProviderType("cloudflare")
|
AccessProviderTypeCloudflare = AccessProviderType("cloudflare")
|
||||||
AccessProviderTypeDogeCloud = AccessProviderType("dogecloud")
|
AccessProviderTypeDogeCloud = AccessProviderType("dogecloud")
|
||||||
|
AccessProviderTypeEdgio = AccessProviderType("edgio")
|
||||||
AccessProviderTypeGoDaddy = AccessProviderType("godaddy")
|
AccessProviderTypeGoDaddy = AccessProviderType("godaddy")
|
||||||
AccessProviderTypeHuaweiCloud = AccessProviderType("huaweicloud")
|
AccessProviderTypeHuaweiCloud = AccessProviderType("huaweicloud")
|
||||||
AccessProviderTypeKubernetes = AccessProviderType("k8s")
|
AccessProviderTypeKubernetes = AccessProviderType("k8s")
|
||||||
@ -83,6 +84,7 @@ const (
|
|||||||
DeployProviderTypeBaiduCloudCDN = DeployProviderType("baiducloud-cdn")
|
DeployProviderTypeBaiduCloudCDN = DeployProviderType("baiducloud-cdn")
|
||||||
DeployProviderTypeBytePlusCDN = DeployProviderType("byteplus-cdn")
|
DeployProviderTypeBytePlusCDN = DeployProviderType("byteplus-cdn")
|
||||||
DeployProviderTypeDogeCloudCDN = DeployProviderType("dogecloud-cdn")
|
DeployProviderTypeDogeCloudCDN = DeployProviderType("dogecloud-cdn")
|
||||||
|
DeployProviderTypeEdgioApplications = DeployProviderType("edgio-applications")
|
||||||
DeployProviderTypeHuaweiCloudCDN = DeployProviderType("huaweicloud-cdn")
|
DeployProviderTypeHuaweiCloudCDN = DeployProviderType("huaweicloud-cdn")
|
||||||
DeployProviderTypeHuaweiCloudELB = DeployProviderType("huaweicloud-elb")
|
DeployProviderTypeHuaweiCloudELB = DeployProviderType("huaweicloud-elb")
|
||||||
DeployProviderTypeKubernetesSecret = DeployProviderType("k8s-secret")
|
DeployProviderTypeKubernetesSecret = DeployProviderType("k8s-secret")
|
||||||
|
@ -0,0 +1,112 @@
|
|||||||
|
package edgioapplications
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/pem"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
xerrors "github.com/pkg/errors"
|
||||||
|
|
||||||
|
"github.com/usual2970/certimate/internal/pkg/core/deployer"
|
||||||
|
"github.com/usual2970/certimate/internal/pkg/core/logger"
|
||||||
|
edgsdk "github.com/usual2970/certimate/internal/pkg/vendors/edgio-sdk/applications/v7"
|
||||||
|
edgsdkDtos "github.com/usual2970/certimate/internal/pkg/vendors/edgio-sdk/applications/v7/dtos"
|
||||||
|
)
|
||||||
|
|
||||||
|
type EdgioApplicationsDeployerConfig struct {
|
||||||
|
// Edgio ClientId。
|
||||||
|
ClientId string `json:"clientId"`
|
||||||
|
// Edgio ClientSecret。
|
||||||
|
ClientSecret string `json:"clientSecret"`
|
||||||
|
// Edgio 环境 ID。
|
||||||
|
EnvironmentId string `json:"environmentId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type EdgioApplicationsDeployer struct {
|
||||||
|
config *EdgioApplicationsDeployerConfig
|
||||||
|
logger logger.Logger
|
||||||
|
sdkClient *edgsdk.EdgioClient
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ deployer.Deployer = (*EdgioApplicationsDeployer)(nil)
|
||||||
|
|
||||||
|
func New(config *EdgioApplicationsDeployerConfig) (*EdgioApplicationsDeployer, error) {
|
||||||
|
return NewWithLogger(config, logger.NewNilLogger())
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewWithLogger(config *EdgioApplicationsDeployerConfig, logger logger.Logger) (*EdgioApplicationsDeployer, error) {
|
||||||
|
if config == nil {
|
||||||
|
return nil, errors.New("config is nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
if logger == nil {
|
||||||
|
return nil, errors.New("logger is nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
client, err := createSdkClient(config.ClientId, config.ClientSecret)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Wrap(err, "failed to create sdk client")
|
||||||
|
}
|
||||||
|
|
||||||
|
return &EdgioApplicationsDeployer{
|
||||||
|
logger: logger,
|
||||||
|
config: config,
|
||||||
|
sdkClient: client,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *EdgioApplicationsDeployer) Deploy(ctx context.Context, certPem string, privkeyPem string) (*deployer.DeployResult, error) {
|
||||||
|
// 提取 Edgio 所需的服务端证书和中间证书内容
|
||||||
|
privateCertPem, intermediateCertPem := extractCertChains(certPem)
|
||||||
|
|
||||||
|
// 上传 TLS 证书
|
||||||
|
// REF: https://docs.edg.io/rest_api/#tag/tls-certs/operation/postConfigV01TlsCerts
|
||||||
|
uploadTlsCertReq := edgsdkDtos.UploadTlsCertRequest{
|
||||||
|
EnvironmentID: d.config.EnvironmentId,
|
||||||
|
PrimaryCert: privateCertPem,
|
||||||
|
IntermediateCert: intermediateCertPem,
|
||||||
|
PrivateKey: privkeyPem,
|
||||||
|
}
|
||||||
|
uploadTlsCertResp, err := d.sdkClient.UploadTlsCert(uploadTlsCertReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Wrap(err, "failed to execute sdk request 'edgio.UploadTlsCert'")
|
||||||
|
}
|
||||||
|
|
||||||
|
d.logger.Logt("已上传 TLS 证书", uploadTlsCertResp)
|
||||||
|
|
||||||
|
return &deployer.DeployResult{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func createSdkClient(clientId, clientSecret string) (*edgsdk.EdgioClient, error) {
|
||||||
|
client := edgsdk.NewEdgioClient(clientId, clientSecret, "", "")
|
||||||
|
return client, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func extractCertChains(certPem string) (primaryCertPem string, intermediateCertPem string) {
|
||||||
|
pemBlocks := make([]*pem.Block, 0)
|
||||||
|
pemData := []byte(certPem)
|
||||||
|
for {
|
||||||
|
block, rest := pem.Decode(pemData)
|
||||||
|
if block == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
pemBlocks = append(pemBlocks, block)
|
||||||
|
pemData = rest
|
||||||
|
}
|
||||||
|
|
||||||
|
primaryCertPem = ""
|
||||||
|
intermediateCertPem = ""
|
||||||
|
|
||||||
|
if len(pemBlocks) > 0 {
|
||||||
|
primaryCertPem = string(pem.EncodeToMemory(pemBlocks[0]))
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(pemBlocks) > 1 {
|
||||||
|
for i := 1; i < len(pemBlocks); i++ {
|
||||||
|
intermediateCertPem += string(pem.EncodeToMemory(pemBlocks[i]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return primaryCertPem, intermediateCertPem
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package edgioapplications_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
provider "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/edgio-applications"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
fInputCertPath string
|
||||||
|
fInputKeyPath string
|
||||||
|
fClientId string
|
||||||
|
fClientSecret string
|
||||||
|
fEnvironmentId string
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
argsPrefix := "CERTIMATE_DEPLOYER_EDGIOAPPLICATIONS_"
|
||||||
|
|
||||||
|
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||||
|
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||||
|
flag.StringVar(&fClientId, argsPrefix+"CLIENTID", "", "")
|
||||||
|
flag.StringVar(&fClientSecret, argsPrefix+"CLIENTSECRET", "", "")
|
||||||
|
flag.StringVar(&fEnvironmentId, argsPrefix+"ENVIRONMENTID", "", "")
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Shell command to run this test:
|
||||||
|
|
||||||
|
go test -v ./edgio_applications_test.go -args \
|
||||||
|
--CERTIMATE_DEPLOYER_EDGIOAPPLICATIONS_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||||
|
--CERTIMATE_DEPLOYER_EDGIOAPPLICATIONS_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||||
|
--CERTIMATE_DEPLOYER_EDGIOAPPLICATIONS_CLIENTID="your-client-id" \
|
||||||
|
--CERTIMATE_DEPLOYER_EDGIOAPPLICATIONS_CLIENTSECRET="your-client-secret" \
|
||||||
|
--CERTIMATE_DEPLOYER_EDGIOAPPLICATIONS_ENVIRONMENTID="your-enviroment-id"
|
||||||
|
*/
|
||||||
|
func TestDeploy(t *testing.T) {
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
t.Run("Deploy", func(t *testing.T) {
|
||||||
|
t.Log(strings.Join([]string{
|
||||||
|
"args:",
|
||||||
|
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||||
|
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||||
|
fmt.Sprintf("CLIENTID: %v", fClientId),
|
||||||
|
fmt.Sprintf("CLIENTSECRET: %v", fClientSecret),
|
||||||
|
fmt.Sprintf("ENVIRONMENTID: %v", fEnvironmentId),
|
||||||
|
}, "\n"))
|
||||||
|
|
||||||
|
deployer, err := provider.New(&provider.EdgioApplicationsDeployerConfig{
|
||||||
|
ClientId: fClientId,
|
||||||
|
ClientSecret: fClientSecret,
|
||||||
|
EnvironmentId: fEnvironmentId,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("err: %+v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fInputCertData, _ := os.ReadFile(fInputCertPath)
|
||||||
|
fInputKeyData, _ := os.ReadFile(fInputKeyPath)
|
||||||
|
res, err := deployer.Deploy(context.Background(), string(fInputCertData), string(fInputKeyData))
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("err: %+v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Logf("ok: %v", res)
|
||||||
|
})
|
||||||
|
}
|
3
internal/pkg/vendors/edgio-sdk/applications/v7/README.md
vendored
Normal file
3
internal/pkg/vendors/edgio-sdk/applications/v7/README.md
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
```shell
|
||||||
|
git clone https://github.com/Edgio/terraform-provider-edgio.git
|
||||||
|
```
|
93
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/cdn_configuration.go
vendored
Normal file
93
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/cdn_configuration.go
vendored
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
package dtos
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
|
type CDNConfiguration struct {
|
||||||
|
ConfigurationID string `json:"id"`
|
||||||
|
EnvironmentID string `json:"environment_id"`
|
||||||
|
Rules json.RawMessage `json:"rules"`
|
||||||
|
Origins []Origin `json:"origins"`
|
||||||
|
Hostnames []Hostname `json:"hostnames"`
|
||||||
|
Experiments *[]string `json:"experiments,omitempty"`
|
||||||
|
EdgeFunctionsSources *map[string]string `json:"edge_functions_sources,omitempty"`
|
||||||
|
EdgeFunctionInitScript *string `json:"edge_function_init_script,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Origin struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Type *string `json:"type,omitempty"`
|
||||||
|
Hosts []Host `json:"hosts"`
|
||||||
|
Balancer *string `json:"balancer,omitempty"`
|
||||||
|
OverrideHostHeader *string `json:"override_host_header,omitempty"`
|
||||||
|
Shields *Shields `json:"shields,omitempty"`
|
||||||
|
PciCertifiedShields *bool `json:"pci_certified_shields,omitempty"`
|
||||||
|
TLSVerify *TLSVerify `json:"tls_verify,omitempty"`
|
||||||
|
Retry *Retry `json:"retry,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Host struct {
|
||||||
|
Weight *int64 `json:"weight,omitempty"`
|
||||||
|
DNSMaxTTL *int64 `json:"dns_max_ttl,omitempty"`
|
||||||
|
DNSPreference *string `json:"dns_preference,omitempty"`
|
||||||
|
MaxHardPool *int64 `json:"max_hard_pool,omitempty"`
|
||||||
|
DNSMinTTL *int64 `json:"dns_min_ttl,omitempty"`
|
||||||
|
Location *[]Location `json:"location,omitempty"`
|
||||||
|
MaxPool *int64 `json:"max_pool,omitempty"`
|
||||||
|
Balancer *string `json:"balancer,omitempty"`
|
||||||
|
Scheme *string `json:"scheme,omitempty"`
|
||||||
|
OverrideHostHeader *string `json:"override_host_header,omitempty"`
|
||||||
|
SNIHintAndStrictSanCheck *string `json:"sni_hint_and_strict_san_check,omitempty"`
|
||||||
|
UseSNI *bool `json:"use_sni,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Location struct {
|
||||||
|
Port *int64 `json:"port,omitempty"`
|
||||||
|
Hostname *string `json:"hostname,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Shields struct {
|
||||||
|
Apac *string `json:"apac,omitempty"`
|
||||||
|
Emea *string `json:"emea,omitempty"`
|
||||||
|
USWest *string `json:"us_west,omitempty"`
|
||||||
|
USEast *string `json:"us_east,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type TLSVerify struct {
|
||||||
|
UseSNI *bool `json:"use_sni,omitempty"`
|
||||||
|
SNIHintAndStrictSanCheck *string `json:"sni_hint_and_strict_san_check,omitempty"`
|
||||||
|
AllowSelfSignedCerts *bool `json:"allow_self_signed_certs,omitempty"`
|
||||||
|
PinnedCerts *[]string `json:"pinned_certs,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Retry struct {
|
||||||
|
StatusCodes *[]int64 `json:"status_codes,omitempty"`
|
||||||
|
IgnoreRetryAfterHeader *bool `json:"ignore_retry_after_header,omitempty"`
|
||||||
|
AfterSeconds *int64 `json:"after_seconds,omitempty"`
|
||||||
|
MaxRequests *int64 `json:"max_requests,omitempty"`
|
||||||
|
MaxWaitSeconds *int64 `json:"max_wait_seconds,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Hostname struct {
|
||||||
|
Hostname *string `json:"hostname,omitempty"`
|
||||||
|
DefaultOriginName *string `json:"default_origin_name,omitempty"`
|
||||||
|
ReportCode *int64 `json:"report_code,omitempty"`
|
||||||
|
TLS *TLS `json:"tls,omitempty"`
|
||||||
|
Directory *string `json:"directory,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type TLS struct {
|
||||||
|
NPN *bool `json:"npn,omitempty"`
|
||||||
|
ALPN *bool `json:"alpn,omitempty"`
|
||||||
|
Protocols *string `json:"protocols,omitempty"`
|
||||||
|
UseSigAlgs *bool `json:"use_sigalgs,omitempty"`
|
||||||
|
SNI *bool `json:"sni,omitempty"`
|
||||||
|
SniStrict *bool `json:"sni_strict,omitempty"`
|
||||||
|
SniHostMatch *bool `json:"sni_host_match,omitempty"`
|
||||||
|
ClientRenegotiation *bool `json:"client_renegotiation,omitempty"`
|
||||||
|
Options *string `json:"options,omitempty"`
|
||||||
|
CipherList *string `json:"cipher_list,omitempty"`
|
||||||
|
NamedCurve *string `json:"named_curve,omitempty"`
|
||||||
|
OCSP *bool `json:"oscp,omitempty"`
|
||||||
|
PEM *string `json:"pem,omitempty"`
|
||||||
|
CA *string `json:"ca,omitempty"`
|
||||||
|
}
|
29
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/environment.go
vendored
Normal file
29
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/environment.go
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package dtos
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Environment struct {
|
||||||
|
Type string `json:"@type"`
|
||||||
|
IdLink string `json:"@id"`
|
||||||
|
Id string `json:"id"`
|
||||||
|
PropertyID string `json:"property_id"`
|
||||||
|
LegacyAccountNumber string `json:"legacy_account_number"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
CanMembersDeploy bool `json:"can_members_deploy"`
|
||||||
|
OnlyMaintainersCanDeploy bool `json:"only_maintainers_can_deploy"`
|
||||||
|
HttpRequestLogging bool `json:"http_request_logging"`
|
||||||
|
DefaultDomainName string `json:"default_domain_name"`
|
||||||
|
PciCompliance bool `json:"pci_compliance"`
|
||||||
|
DnsDomainName string `json:"dns_domain_name"`
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type EnvironmentsResponse struct {
|
||||||
|
Type string `json:"@type"`
|
||||||
|
Id string `json:"@id"`
|
||||||
|
TotalItems int `json:"total_items"`
|
||||||
|
Items []Environment `json:"items"`
|
||||||
|
}
|
18
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/property.go
vendored
Normal file
18
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/property.go
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package dtos
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
type Property struct {
|
||||||
|
IdLink string `json:"@id"`
|
||||||
|
Id string `json:"id"`
|
||||||
|
OrganizationID string `json:"organization_id"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Properties struct {
|
||||||
|
ID string `json:"@id"`
|
||||||
|
TotalItems int `json:"total_items"`
|
||||||
|
Items []Property `json:"items"`
|
||||||
|
}
|
18
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/purge.go
vendored
Normal file
18
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/purge.go
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package dtos
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
type PurgeResponse struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
CompletedAt time.Time `json:"completed_at"`
|
||||||
|
ProgressPercentage float32 `json:"progress_percentage"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PurgeRequest struct {
|
||||||
|
EnvironmentID string `json:"environment_id"`
|
||||||
|
PurgeType string `json:"purge_type"`
|
||||||
|
Values []string `json:"values"`
|
||||||
|
Hostname *string `json:"hostname"`
|
||||||
|
}
|
30
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/tls_cert.go
vendored
Normal file
30
internal/pkg/vendors/edgio-sdk/applications/v7/dtos/tls_cert.go
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package dtos
|
||||||
|
|
||||||
|
type TLSCertResponse struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
EnvironmentID string `json:"environment_id"`
|
||||||
|
PrimaryCert string `json:"primary_cert"`
|
||||||
|
IntermediateCert string `json:"intermediate_cert"`
|
||||||
|
Expiration string `json:"expiration"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Generated bool `json:"generated"`
|
||||||
|
Serial string `json:"serial"`
|
||||||
|
CommonName string `json:"common_name"`
|
||||||
|
AlternativeNames []string `json:"alternative_names"`
|
||||||
|
ActivationError string `json:"activation_error"`
|
||||||
|
CreatedAt string `json:"created_at"`
|
||||||
|
UpdatedAt string `json:"updated_at"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UploadTlsCertRequest struct {
|
||||||
|
EnvironmentID string `json:"environment_id"`
|
||||||
|
PrimaryCert string `json:"primary_cert"`
|
||||||
|
IntermediateCert string `json:"intermediate_cert"`
|
||||||
|
PrivateKey string `json:"private_key"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type TLSCertSResponse struct {
|
||||||
|
EnvironmentID string `json:"environment_id"`
|
||||||
|
TotalItems int32 `json:"total_items"`
|
||||||
|
Certificates []TLSCertResponse `json:"items"`
|
||||||
|
}
|
546
internal/pkg/vendors/edgio-sdk/applications/v7/edgio_client.go
vendored
Normal file
546
internal/pkg/vendors/edgio-sdk/applications/v7/edgio_client.go
vendored
Normal file
@ -0,0 +1,546 @@
|
|||||||
|
package edgio_api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-resty/resty/v2"
|
||||||
|
|
||||||
|
"github.com/usual2970/certimate/internal/pkg/vendors/edgio-sdk/applications/v7/dtos"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AccessTokenResponse represents the response from the token endpoint.
|
||||||
|
type AccessTokenResponse struct {
|
||||||
|
AccessToken string `json:"access_token"`
|
||||||
|
ExpiresIn int `json:"expires_in"`
|
||||||
|
TokenType string `json:"token_type"`
|
||||||
|
Scope string `json:"scope"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// TokenCache represents a cached token. The token is stored along
|
||||||
|
// with its expiry time. Because different endpoints require different
|
||||||
|
// scopes, we store the token with the scope as the key, so that we
|
||||||
|
// can fetch the token from the cache based on the scope.
|
||||||
|
type TokenCache struct {
|
||||||
|
AccessToken string
|
||||||
|
Expiry time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
type EdgioClient struct {
|
||||||
|
client *resty.Client
|
||||||
|
clientID string
|
||||||
|
clientSecret string
|
||||||
|
tokenURL string
|
||||||
|
apiURL string
|
||||||
|
tokenCache map[string]TokenCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewEdgioClient(clientID, clientSecret, tokenURL, apiURL string) *EdgioClient {
|
||||||
|
client := resty.New().
|
||||||
|
SetTimeout(30 * time.Second).
|
||||||
|
SetRetryCount(3).
|
||||||
|
SetRetryWaitTime(5 * time.Second).
|
||||||
|
SetRetryMaxWaitTime(20 * time.Second)
|
||||||
|
|
||||||
|
if tokenURL == "" {
|
||||||
|
tokenURL = "https://id.edgio.app/connect/token"
|
||||||
|
}
|
||||||
|
|
||||||
|
if apiURL == "" {
|
||||||
|
apiURL = "https://edgioapis.com"
|
||||||
|
}
|
||||||
|
|
||||||
|
return &EdgioClient{
|
||||||
|
client: client,
|
||||||
|
clientID: clientID,
|
||||||
|
clientSecret: clientSecret,
|
||||||
|
tokenURL: tokenURL,
|
||||||
|
apiURL: apiURL,
|
||||||
|
tokenCache: make(map[string]TokenCache),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) getToken(scope string) (string, error) {
|
||||||
|
if cachedToken, exists := c.tokenCache[scope]; exists && time.Now().Before(cachedToken.Expiry) {
|
||||||
|
return cachedToken.AccessToken, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var tokenResp AccessTokenResponse
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetFormData(map[string]string{
|
||||||
|
"client_id": c.clientID,
|
||||||
|
"client_secret": c.clientSecret,
|
||||||
|
"grant_type": "client_credentials",
|
||||||
|
"scope": scope,
|
||||||
|
}).
|
||||||
|
SetResult(&tokenResp).
|
||||||
|
Post(c.tokenURL)
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("failed to request token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return "", fmt.Errorf("unexpected status code for getToken: %d", resp.StatusCode())
|
||||||
|
}
|
||||||
|
|
||||||
|
c.tokenCache[scope] = TokenCache{
|
||||||
|
AccessToken: tokenResp.AccessToken,
|
||||||
|
Expiry: time.Now().Add(time.Duration(tokenResp.ExpiresIn) * time.Second),
|
||||||
|
}
|
||||||
|
|
||||||
|
return tokenResp.AccessToken, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) GetProperty(ctx context.Context, propertyID string) (*dtos.Property, error) {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/properties/%s", c.apiURL, propertyID)
|
||||||
|
|
||||||
|
var property dtos.Property
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetContext(ctx).
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetResult(&property).
|
||||||
|
Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to send request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("unexpected status code for getSpecificProperty: %d, %s", resp.StatusCode(), resp.Request.URL)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &property, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) GetProperties(page int, pageSize int, organizationID string) (*dtos.Properties, error) {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/properties", c.apiURL)
|
||||||
|
|
||||||
|
var propertiesResp dtos.Properties
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetQueryParams(map[string]string{
|
||||||
|
"page": fmt.Sprintf("%d", page),
|
||||||
|
"page_size": fmt.Sprintf("%d", pageSize),
|
||||||
|
"organization_id": organizationID,
|
||||||
|
}).
|
||||||
|
SetResult(&propertiesResp).
|
||||||
|
Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to send request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("unexpected status code for getProperties: %d, %s", resp.StatusCode(), resp.Body())
|
||||||
|
}
|
||||||
|
|
||||||
|
return &propertiesResp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) CreateProperty(ctx context.Context, organizationID, slug string) (*dtos.Property, error) {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/properties", c.apiURL)
|
||||||
|
|
||||||
|
var createdProperty dtos.Property
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetContext(ctx).
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetHeader("Content-Type", "application/json").
|
||||||
|
SetBody(map[string]string{
|
||||||
|
"organization_id": organizationID,
|
||||||
|
"slug": slug,
|
||||||
|
}).
|
||||||
|
SetResult(&createdProperty).
|
||||||
|
Post(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to send request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("unexpected status code for createProperty: %d, response: %s", resp.StatusCode(), resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return &createdProperty, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) DeleteProperty(propertyID string) error {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/properties/%s", c.apiURL, propertyID)
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
Delete(url)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error sending DELETE request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return fmt.Errorf("error deleting property: status code %d", resp.StatusCode())
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) UpdateProperty(ctx context.Context, propertyID string, slug string) (*dtos.Property, error) {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/properties/%s", c.apiURL, propertyID)
|
||||||
|
|
||||||
|
requestBody := map[string]interface{}{
|
||||||
|
"slug": slug,
|
||||||
|
}
|
||||||
|
|
||||||
|
var updatedProperty dtos.Property
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetContext(ctx).
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetBody(requestBody).
|
||||||
|
SetResult(&updatedProperty).
|
||||||
|
Patch(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to send request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("unexpected status code for updateProperty: %d", resp.StatusCode())
|
||||||
|
}
|
||||||
|
|
||||||
|
return &updatedProperty, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) GetEnvironments(page, pageSize int, propertyID string) (*dtos.EnvironmentsResponse, error) {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/environments", c.apiURL)
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetQueryParams(map[string]string{
|
||||||
|
"page": fmt.Sprintf("%d", page),
|
||||||
|
"page_size": fmt.Sprintf("%d", pageSize),
|
||||||
|
"property_id": propertyID,
|
||||||
|
}).
|
||||||
|
SetResult(&dtos.EnvironmentsResponse{}).
|
||||||
|
Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("error response: %s", resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.Result().(*dtos.EnvironmentsResponse), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) GetEnvironment(environmentID string) (*dtos.Environment, error) {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/environments/%s", c.apiURL, environmentID)
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetPathParams(map[string]string{
|
||||||
|
"environment_id": environmentID,
|
||||||
|
}).
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetResult(&dtos.Environment{}).
|
||||||
|
Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("error response: %s", resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.Result().(*dtos.Environment), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) CreateEnvironment(propertyID, name string, onlyMaintainersCanDeploy, httpRequestLogging bool) (*dtos.Environment, error) {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/environments", c.apiURL)
|
||||||
|
|
||||||
|
body := map[string]interface{}{
|
||||||
|
"property_id": propertyID,
|
||||||
|
"name": name,
|
||||||
|
"only_maintainers_can_deploy": onlyMaintainersCanDeploy,
|
||||||
|
"http_request_logging": httpRequestLogging,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetBody(body).
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetResult(&dtos.Environment{}).
|
||||||
|
Post(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("error response: %s", resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.Result().(*dtos.Environment), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) UpdateEnvironment(environmentID, name string, onlyMaintainersCanDeploy, httpRequestLogging, preserveCache bool) (*dtos.Environment, error) {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/environments/%s", c.apiURL, environmentID)
|
||||||
|
|
||||||
|
body := map[string]interface{}{
|
||||||
|
"name": name,
|
||||||
|
// as can_members_deploy is depricated, but update api is not
|
||||||
|
// we need to use it to map onlyMaintainersCanDeploy
|
||||||
|
"only_maintainers_can_deploy": onlyMaintainersCanDeploy,
|
||||||
|
"http_request_logging": httpRequestLogging,
|
||||||
|
"preserve_cache": preserveCache,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetPathParams(map[string]string{
|
||||||
|
"environment_id": environmentID,
|
||||||
|
}).
|
||||||
|
SetBody(body).
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetResult(&dtos.Environment{}).
|
||||||
|
Patch(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("error response: %s", resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.Result().(*dtos.Environment), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) DeleteEnvironment(environmentID string) error {
|
||||||
|
token, err := c.getToken("app.accounts")
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/accounts/v0.1/environments/%s", c.apiURL, environmentID)
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetPathParams(map[string]string{
|
||||||
|
"environment_id": environmentID,
|
||||||
|
}).
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetResult(&dtos.Environment{}).
|
||||||
|
Delete(url)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return fmt.Errorf("error response: %s", resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) GetTlsCert(tlsCertId string) (*dtos.TLSCertResponse, error) {
|
||||||
|
token, err := c.getToken("app.config")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/config/v0.1/tls-certs/%s", c.apiURL, tlsCertId)
|
||||||
|
|
||||||
|
var tlsCertResponse dtos.TLSCertResponse
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetResult(&tlsCertResponse).
|
||||||
|
Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error response: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("error response: %s", resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return &tlsCertResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) UploadTlsCert(req dtos.UploadTlsCertRequest) (*dtos.TLSCertResponse, error) {
|
||||||
|
token, err := c.getToken("app.config")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/config/v0.1/tls-certs", c.apiURL)
|
||||||
|
response := &dtos.TLSCertResponse{}
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetHeader("Content-Type", "application/json").
|
||||||
|
SetBody(req).
|
||||||
|
SetResult(response).
|
||||||
|
Post(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to upload TLS certificate: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("API responded with error: %s", resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) GenerateTlsCert(environmentId string) (*dtos.TLSCertResponse, error) {
|
||||||
|
token, err := c.getToken("app.config")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/config/v0.1/tls-certs/generate", c.apiURL)
|
||||||
|
request := map[string]interface{}{
|
||||||
|
"environment_id": environmentId,
|
||||||
|
}
|
||||||
|
response := &dtos.TLSCertResponse{}
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetHeader("Content-Type", "application/json").
|
||||||
|
SetBody(request).
|
||||||
|
SetResult(response).
|
||||||
|
Post(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to upload TLS certificate: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("API responded with error: %s", resp.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) GetTlsCerts(page int, pageSize int, environmentID string) (*dtos.TLSCertSResponse, error) {
|
||||||
|
token, err := c.getToken("app.config")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/config/v0.1/tls-certs", c.apiURL)
|
||||||
|
|
||||||
|
var tlsCertsResponse dtos.TLSCertSResponse
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetQueryParams(map[string]string{
|
||||||
|
"page": fmt.Sprintf("%d", page),
|
||||||
|
"page_size": fmt.Sprintf("%d", pageSize),
|
||||||
|
"environment_id": environmentID,
|
||||||
|
}).
|
||||||
|
SetResult(&tlsCertsResponse).
|
||||||
|
Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to send request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("unexpected status code for getTlsCerts: %d", resp.StatusCode())
|
||||||
|
}
|
||||||
|
|
||||||
|
return &tlsCertsResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) UploadCdnConfiguration(config *dtos.CDNConfiguration) (*dtos.CDNConfiguration, error) {
|
||||||
|
fmt.Println("------------------------------------------------------------------------- uploading")
|
||||||
|
|
||||||
|
token, err := c.getToken("app.config")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/config/v0.1/configs", c.apiURL)
|
||||||
|
var response dtos.CDNConfiguration
|
||||||
|
|
||||||
|
// Convert config to json
|
||||||
|
jsonBody, _ := json.MarshalIndent(config, "", " ")
|
||||||
|
jsonString := string(jsonBody)
|
||||||
|
fmt.Println("------------------------- config report code: ", config.Hostnames[0].ReportCode == nil)
|
||||||
|
fmt.Println("------------------------- config report code value: ", config.Hostnames[0].ReportCode)
|
||||||
|
fmt.Println("----------------------------------- jsonBody: ", jsonString)
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetHeader("Content-Type", "application/json").
|
||||||
|
SetBody(config).
|
||||||
|
SetResult(&response).
|
||||||
|
Post(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to upload CDN configuration: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("unexpected status code for uploadCdnConfiguration: %d, %s", resp.StatusCode(), resp.Body())
|
||||||
|
}
|
||||||
|
|
||||||
|
return &response, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *EdgioClient) GetCDNConfiguration(configID string) (*dtos.CDNConfiguration, error) {
|
||||||
|
fmt.Println("------------------------------------------------------------------------- reading config")
|
||||||
|
|
||||||
|
token, err := c.getToken("app.config")
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("https://edgioapis.com/config/v0.1/configs/%s", configID)
|
||||||
|
var response dtos.CDNConfiguration
|
||||||
|
|
||||||
|
resp, err := c.client.R().
|
||||||
|
SetAuthToken(token).
|
||||||
|
SetResult(&response).
|
||||||
|
Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get CDN configuration: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.IsError() {
|
||||||
|
return nil, fmt.Errorf("unexpected status code for GetCDNConfiguration: %d", resp.StatusCode())
|
||||||
|
}
|
||||||
|
|
||||||
|
return &response, nil
|
||||||
|
}
|
26
internal/pkg/vendors/edgio-sdk/applications/v7/edgio_client_interface.go
vendored
Normal file
26
internal/pkg/vendors/edgio-sdk/applications/v7/edgio_client_interface.go
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package edgio_api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/usual2970/certimate/internal/pkg/vendors/edgio-sdk/applications/v7/dtos"
|
||||||
|
)
|
||||||
|
|
||||||
|
type EdgioClientInterface interface {
|
||||||
|
GetProperty(ctx context.Context, propertyID string) (*dtos.Property, error)
|
||||||
|
GetProperties(page int, pageSize int, organizationID string) (*dtos.Properties, error)
|
||||||
|
CreateProperty(ctx context.Context, organizationID, slug string) (*dtos.Property, error)
|
||||||
|
DeleteProperty(propertyID string) error
|
||||||
|
UpdateProperty(ctx context.Context, propertyID string, slug string) (*dtos.Property, error)
|
||||||
|
GetEnvironments(page, pageSize int, propertyID string) (*dtos.EnvironmentsResponse, error)
|
||||||
|
GetEnvironment(environmentID string) (*dtos.Environment, error)
|
||||||
|
CreateEnvironment(propertyID, name string, onlyMaintainersCanDeploy, httpRequestLogging bool) (*dtos.Environment, error)
|
||||||
|
UpdateEnvironment(environmentID, name string, onlyMaintainersCanDeploy, httpRequestLogging, preserveCache bool) (*dtos.Environment, error)
|
||||||
|
DeleteEnvironment(environmentID string) error
|
||||||
|
GetTlsCert(tlsCertId string) (*dtos.TLSCertResponse, error)
|
||||||
|
UploadTlsCert(req dtos.UploadTlsCertRequest) (*dtos.TLSCertResponse, error)
|
||||||
|
GenerateTlsCert(environmentId string) (*dtos.TLSCertResponse, error)
|
||||||
|
GetTlsCerts(page int, pageSize int, environmentID string) (*dtos.TLSCertSResponse, error)
|
||||||
|
UploadCdnConfiguration(config *dtos.CDNConfiguration) (*dtos.CDNConfiguration, error)
|
||||||
|
GetCDNConfiguration(configID string) (*dtos.CDNConfiguration, error)
|
||||||
|
}
|
@ -89,7 +89,7 @@ func (a *applyNode) Run(ctx context.Context) error {
|
|||||||
Outputs: a.node.Outputs,
|
Outputs: a.node.Outputs,
|
||||||
}
|
}
|
||||||
|
|
||||||
certX509, err := x509.ParseCertificateFromPEM(applyResult.Certificate)
|
certX509, err := x509.ParseCertificateFromPEM(applyResult.CertificateChain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.AddOutput(ctx, a.node.Name, "解析证书失败", err.Error())
|
a.AddOutput(ctx, a.node.Name, "解析证书失败", err.Error())
|
||||||
return err
|
return err
|
||||||
@ -98,7 +98,7 @@ func (a *applyNode) Run(ctx context.Context) error {
|
|||||||
certificate := &domain.Certificate{
|
certificate := &domain.Certificate{
|
||||||
Source: domain.CertificateSourceTypeWorkflow,
|
Source: domain.CertificateSourceTypeWorkflow,
|
||||||
SubjectAltNames: strings.Join(certX509.DNSNames, ";"),
|
SubjectAltNames: strings.Join(certX509.DNSNames, ";"),
|
||||||
Certificate: applyResult.Certificate,
|
Certificate: applyResult.CertificateChain,
|
||||||
PrivateKey: applyResult.PrivateKey,
|
PrivateKey: applyResult.PrivateKey,
|
||||||
IssuerCertificate: applyResult.IssuerCertificate,
|
IssuerCertificate: applyResult.IssuerCertificate,
|
||||||
ACMECertUrl: applyResult.ACMECertUrl,
|
ACMECertUrl: applyResult.ACMECertUrl,
|
||||||
|
1
ui/public/imgs/providers/edgio.svg
Normal file
1
ui/public/imgs/providers/edgio.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 256 256"><defs><radialGradient id="logosEdgioIcon0" cx="104.362%" cy="13.088%" r="94.575%" fx="104.362%" fy="13.088%"><stop offset="0%" stop-color="#01B07D"></stop><stop offset="100%" stop-color="#01B07D" stop-opacity="0"></stop></radialGradient><radialGradient id="logosEdgioIcon1" cx="68.749%" cy="120.916%" r="68.487%" fx="68.749%" fy="120.916%"><stop offset="0%" stop-color="#00AAE5"></stop><stop offset="100%" stop-color="#00AAE5" stop-opacity="0"></stop></radialGradient><linearGradient id="logosEdgioIcon2" x1="3.185%" x2="57.325%" y1="2.866%" y2="58.917%"><stop offset="0%" stop-color="#793092"></stop><stop offset="100%" stop-color="#6144A1"></stop></linearGradient></defs><path fill="url(#logosEdgioIcon2)" d="M0 0h256v256H0z"></path><path fill="url(#logosEdgioIcon0)" d="M0 0h256v256H0z"></path><path fill="url(#logosEdgioIcon1)" d="M0 0h256v256H0z"></path><path fill="#FFF" d="m170.908 77.201l16.225-29.253H68.867v160.103h118.266l-16.144-29.293h-70.24v-36.819h55.755l8.983-29.294h-64.738V77.201z"></path></svg>
|
@ -17,6 +17,7 @@ import AccessFormBaiduCloudConfig from "./AccessFormBaiduCloudConfig";
|
|||||||
import AccessFormBytePlusConfig from "./AccessFormBytePlusConfig";
|
import AccessFormBytePlusConfig from "./AccessFormBytePlusConfig";
|
||||||
import AccessFormCloudflareConfig from "./AccessFormCloudflareConfig";
|
import AccessFormCloudflareConfig from "./AccessFormCloudflareConfig";
|
||||||
import AccessFormDogeCloudConfig from "./AccessFormDogeCloudConfig";
|
import AccessFormDogeCloudConfig from "./AccessFormDogeCloudConfig";
|
||||||
|
import AccessFormEdgioConfig from "./AccessFormEdgioConfig";
|
||||||
import AccessFormGoDaddyConfig from "./AccessFormGoDaddyConfig";
|
import AccessFormGoDaddyConfig from "./AccessFormGoDaddyConfig";
|
||||||
import AccessFormHuaweiCloudConfig from "./AccessFormHuaweiCloudConfig";
|
import AccessFormHuaweiCloudConfig from "./AccessFormHuaweiCloudConfig";
|
||||||
import AccessFormKubernetesConfig from "./AccessFormKubernetesConfig";
|
import AccessFormKubernetesConfig from "./AccessFormKubernetesConfig";
|
||||||
@ -102,6 +103,8 @@ const AccessForm = forwardRef<AccessFormInstance, AccessFormProps>(({ className,
|
|||||||
return <AccessFormDogeCloudConfig {...nestedFormProps} />;
|
return <AccessFormDogeCloudConfig {...nestedFormProps} />;
|
||||||
case ACCESS_PROVIDERS.GODADDY:
|
case ACCESS_PROVIDERS.GODADDY:
|
||||||
return <AccessFormGoDaddyConfig {...nestedFormProps} />;
|
return <AccessFormGoDaddyConfig {...nestedFormProps} />;
|
||||||
|
case ACCESS_PROVIDERS.EDGIO:
|
||||||
|
return <AccessFormEdgioConfig {...nestedFormProps} />;
|
||||||
case ACCESS_PROVIDERS.HUAWEICLOUD:
|
case ACCESS_PROVIDERS.HUAWEICLOUD:
|
||||||
return <AccessFormHuaweiCloudConfig {...nestedFormProps} />;
|
return <AccessFormHuaweiCloudConfig {...nestedFormProps} />;
|
||||||
case ACCESS_PROVIDERS.KUBERNETES:
|
case ACCESS_PROVIDERS.KUBERNETES:
|
||||||
|
76
ui/src/components/access/AccessFormEdgioConfig.tsx
Normal file
76
ui/src/components/access/AccessFormEdgioConfig.tsx
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
import { type AccessConfigForEdgio } from "@/domain/access";
|
||||||
|
|
||||||
|
type AccessFormEdgioConfigFieldValues = Nullish<AccessConfigForEdgio>;
|
||||||
|
|
||||||
|
export type AccessFormEdgioConfigProps = {
|
||||||
|
form: FormInstance;
|
||||||
|
formName: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
initialValues?: AccessFormEdgioConfigFieldValues;
|
||||||
|
onValuesChange?: (values: AccessFormEdgioConfigFieldValues) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
const initFormModel = (): AccessFormEdgioConfigFieldValues => {
|
||||||
|
return {
|
||||||
|
clientId: "",
|
||||||
|
clientSecret: "",
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const AccessFormEdgioConfig = ({ form: formInst, formName, disabled, initialValues, onValuesChange }: AccessFormEdgioConfigProps) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const formSchema = z.object({
|
||||||
|
clientId: z
|
||||||
|
.string()
|
||||||
|
.min(1, t("access.form.edgio_client_id.placeholder"))
|
||||||
|
.max(64, t("common.errmsg.string_max", { max: 64 }))
|
||||||
|
.trim(),
|
||||||
|
clientSecret: z
|
||||||
|
.string()
|
||||||
|
.min(1, t("access.form.edgio_client_secret.placeholder"))
|
||||||
|
.max(64, t("common.errmsg.string_max", { max: 64 }))
|
||||||
|
.trim(),
|
||||||
|
});
|
||||||
|
const formRule = createSchemaFieldRule(formSchema);
|
||||||
|
|
||||||
|
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
|
||||||
|
onValuesChange?.(values);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Form
|
||||||
|
form={formInst}
|
||||||
|
disabled={disabled}
|
||||||
|
initialValues={initialValues ?? initFormModel()}
|
||||||
|
layout="vertical"
|
||||||
|
name={formName}
|
||||||
|
onValuesChange={handleFormChange}
|
||||||
|
>
|
||||||
|
<Form.Item
|
||||||
|
name="clientId"
|
||||||
|
label={t("access.form.edgio_client_id.label")}
|
||||||
|
rules={[formRule]}
|
||||||
|
tooltip={<span dangerouslySetInnerHTML={{ __html: t("access.form.edgio_client_id.tooltip") }}></span>}
|
||||||
|
>
|
||||||
|
<Input autoComplete="new-password" placeholder={t("access.form.edgio_client_id.placeholder")} />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item
|
||||||
|
name="clientSecret"
|
||||||
|
label={t("access.form.edgio_client_secret.label")}
|
||||||
|
rules={[formRule]}
|
||||||
|
tooltip={<span dangerouslySetInnerHTML={{ __html: t("access.form.edgio_client_secret.tooltip") }}></span>}
|
||||||
|
>
|
||||||
|
<Input.Password autoComplete="new-password" placeholder={t("access.form.edgio_client_secret.placeholder")} />
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AccessFormEdgioConfig;
|
@ -25,6 +25,7 @@ import DeployNodeConfigFormAliyunOSSConfig from "./DeployNodeConfigFormAliyunOSS
|
|||||||
import DeployNodeConfigFormBaiduCloudCDNConfig from "./DeployNodeConfigFormBaiduCloudCDNConfig";
|
import DeployNodeConfigFormBaiduCloudCDNConfig from "./DeployNodeConfigFormBaiduCloudCDNConfig";
|
||||||
import DeployNodeConfigFormBytePlusCDNConfig from "./DeployNodeConfigFormBytePlusCDNConfig";
|
import DeployNodeConfigFormBytePlusCDNConfig from "./DeployNodeConfigFormBytePlusCDNConfig";
|
||||||
import DeployNodeConfigFormDogeCloudCDNConfig from "./DeployNodeConfigFormDogeCloudCDNConfig";
|
import DeployNodeConfigFormDogeCloudCDNConfig from "./DeployNodeConfigFormDogeCloudCDNConfig";
|
||||||
|
import DeployNodeConfigFormEdgioApplicationsConfig from "./DeployNodeConfigFormEdgioApplicationsConfig";
|
||||||
import DeployNodeConfigFormHuaweiCloudCDNConfig from "./DeployNodeConfigFormHuaweiCloudCDNConfig";
|
import DeployNodeConfigFormHuaweiCloudCDNConfig from "./DeployNodeConfigFormHuaweiCloudCDNConfig";
|
||||||
import DeployNodeConfigFormHuaweiCloudELBConfig from "./DeployNodeConfigFormHuaweiCloudELBConfig";
|
import DeployNodeConfigFormHuaweiCloudELBConfig from "./DeployNodeConfigFormHuaweiCloudELBConfig";
|
||||||
import DeployNodeConfigFormKubernetesSecretConfig from "./DeployNodeConfigFormKubernetesSecretConfig";
|
import DeployNodeConfigFormKubernetesSecretConfig from "./DeployNodeConfigFormKubernetesSecretConfig";
|
||||||
@ -134,6 +135,8 @@ const DeployNodeConfigForm = forwardRef<DeployNodeConfigFormInstance, DeployNode
|
|||||||
return <DeployNodeConfigFormBytePlusCDNConfig {...nestedFormProps} />;
|
return <DeployNodeConfigFormBytePlusCDNConfig {...nestedFormProps} />;
|
||||||
case DEPLOY_PROVIDERS.DOGECLOUD_CDN:
|
case DEPLOY_PROVIDERS.DOGECLOUD_CDN:
|
||||||
return <DeployNodeConfigFormDogeCloudCDNConfig {...nestedFormProps} />;
|
return <DeployNodeConfigFormDogeCloudCDNConfig {...nestedFormProps} />;
|
||||||
|
case DEPLOY_PROVIDERS.EDGIO_APPLICATIONS:
|
||||||
|
return <DeployNodeConfigFormEdgioApplicationsConfig {...nestedFormProps} />;
|
||||||
case DEPLOY_PROVIDERS.HUAWEICLOUD_CDN:
|
case DEPLOY_PROVIDERS.HUAWEICLOUD_CDN:
|
||||||
return <DeployNodeConfigFormHuaweiCloudCDNConfig {...nestedFormProps} />;
|
return <DeployNodeConfigFormHuaweiCloudCDNConfig {...nestedFormProps} />;
|
||||||
case DEPLOY_PROVIDERS.HUAWEICLOUD_ELB:
|
case DEPLOY_PROVIDERS.HUAWEICLOUD_ELB:
|
||||||
|
@ -0,0 +1,65 @@
|
|||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
type DeployNodeConfigFormEdgioApplicationsConfigFieldValues = Nullish<{
|
||||||
|
environmentId: string;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
export type DeployNodeConfigFormEdgioApplicationsConfigProps = {
|
||||||
|
form: FormInstance;
|
||||||
|
formName: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
initialValues?: DeployNodeConfigFormEdgioApplicationsConfigFieldValues;
|
||||||
|
onValuesChange?: (values: DeployNodeConfigFormEdgioApplicationsConfigFieldValues) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
const initFormModel = (): DeployNodeConfigFormEdgioApplicationsConfigFieldValues => {
|
||||||
|
return {};
|
||||||
|
};
|
||||||
|
|
||||||
|
const DeployNodeConfigFormEdgioApplicationsConfig = ({
|
||||||
|
form: formInst,
|
||||||
|
formName,
|
||||||
|
disabled,
|
||||||
|
initialValues,
|
||||||
|
onValuesChange,
|
||||||
|
}: DeployNodeConfigFormEdgioApplicationsConfigProps) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const formSchema = z.object({
|
||||||
|
environmentId: z
|
||||||
|
.string({ message: t("workflow_node.deploy.form.edgio_applications_environment_id.placeholder") })
|
||||||
|
.min(1, t("workflow_node.deploy.form.edgio_applications_environment_id.placeholder"))
|
||||||
|
.max(64, t("common.errmsg.string_max", { max: 64 }))
|
||||||
|
.trim(),
|
||||||
|
});
|
||||||
|
const formRule = createSchemaFieldRule(formSchema);
|
||||||
|
|
||||||
|
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
|
||||||
|
onValuesChange?.(values);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Form
|
||||||
|
form={formInst}
|
||||||
|
disabled={disabled}
|
||||||
|
initialValues={initialValues ?? initFormModel()}
|
||||||
|
layout="vertical"
|
||||||
|
name={formName}
|
||||||
|
onValuesChange={handleFormChange}
|
||||||
|
>
|
||||||
|
<Form.Item
|
||||||
|
name="environmentId"
|
||||||
|
label={t("workflow_node.deploy.form.edgio_applications_environment_id.label")}
|
||||||
|
rules={[formRule]}
|
||||||
|
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.edgio_applications_environment_id.tooltip") }}></span>}
|
||||||
|
>
|
||||||
|
<Input placeholder={t("workflow_node.deploy.form.edgio_applications_environment_id.placeholder")} />
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DeployNodeConfigFormEdgioApplicationsConfig;
|
@ -16,6 +16,7 @@ export interface AccessModel extends BaseModel {
|
|||||||
| AccessConfigForBytePlus
|
| AccessConfigForBytePlus
|
||||||
| AccessConfigForCloudflare
|
| AccessConfigForCloudflare
|
||||||
| AccessConfigForDogeCloud
|
| AccessConfigForDogeCloud
|
||||||
|
| AccessConfigForEdgio
|
||||||
| AccessConfigForGoDaddy
|
| AccessConfigForGoDaddy
|
||||||
| AccessConfigForHuaweiCloud
|
| AccessConfigForHuaweiCloud
|
||||||
| AccessConfigForKubernetes
|
| AccessConfigForKubernetes
|
||||||
@ -77,6 +78,11 @@ export type AccessConfigForDogeCloud = {
|
|||||||
secretKey: string;
|
secretKey: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type AccessConfigForEdgio = {
|
||||||
|
clientId: string;
|
||||||
|
clientSecret: string;
|
||||||
|
};
|
||||||
|
|
||||||
export type AccessConfigForGoDaddy = {
|
export type AccessConfigForGoDaddy = {
|
||||||
apiKey: string;
|
apiKey: string;
|
||||||
apiSecret: string;
|
apiSecret: string;
|
||||||
|
@ -13,6 +13,7 @@ export const ACCESS_PROVIDERS = Object.freeze({
|
|||||||
CLOUDFLARE: "cloudflare",
|
CLOUDFLARE: "cloudflare",
|
||||||
DOGECLOUD: "dogecloud",
|
DOGECLOUD: "dogecloud",
|
||||||
GODADDY: "godaddy",
|
GODADDY: "godaddy",
|
||||||
|
EDGIO: "edgio",
|
||||||
HUAWEICLOUD: "huaweicloud",
|
HUAWEICLOUD: "huaweicloud",
|
||||||
KUBERNETES: "k8s",
|
KUBERNETES: "k8s",
|
||||||
LOCAL: "local",
|
LOCAL: "local",
|
||||||
@ -64,6 +65,7 @@ export const accessProvidersMap: Map<AccessProvider["type"] | string, AccessProv
|
|||||||
[ACCESS_PROVIDERS.VOLCENGINE, "common.provider.volcengine", "/imgs/providers/volcengine.svg", ACCESS_USAGES.ALL],
|
[ACCESS_PROVIDERS.VOLCENGINE, "common.provider.volcengine", "/imgs/providers/volcengine.svg", ACCESS_USAGES.ALL],
|
||||||
[ACCESS_PROVIDERS.BYTEPLUS, "common.provider.byteplus", "/imgs/providers/byteplus.svg", ACCESS_USAGES.DEPLOY],
|
[ACCESS_PROVIDERS.BYTEPLUS, "common.provider.byteplus", "/imgs/providers/byteplus.svg", ACCESS_USAGES.DEPLOY],
|
||||||
[ACCESS_PROVIDERS.UCLOUD, "common.provider.ucloud", "/imgs/providers/ucloud.svg", ACCESS_USAGES.DEPLOY],
|
[ACCESS_PROVIDERS.UCLOUD, "common.provider.ucloud", "/imgs/providers/ucloud.svg", ACCESS_USAGES.DEPLOY],
|
||||||
|
[ACCESS_PROVIDERS.EDGIO, "common.provider.edgio", "/imgs/providers/edgio.svg", ACCESS_USAGES.DEPLOY],
|
||||||
[ACCESS_PROVIDERS.AWS, "common.provider.aws", "/imgs/providers/aws.svg", ACCESS_USAGES.APPLY],
|
[ACCESS_PROVIDERS.AWS, "common.provider.aws", "/imgs/providers/aws.svg", ACCESS_USAGES.APPLY],
|
||||||
[ACCESS_PROVIDERS.AZURE, "common.provider.azure", "/imgs/providers/azure.svg", ACCESS_USAGES.APPLY],
|
[ACCESS_PROVIDERS.AZURE, "common.provider.azure", "/imgs/providers/azure.svg", ACCESS_USAGES.APPLY],
|
||||||
[ACCESS_PROVIDERS.CLOUDFLARE, "common.provider.cloudflare", "/imgs/providers/cloudflare.svg", ACCESS_USAGES.APPLY],
|
[ACCESS_PROVIDERS.CLOUDFLARE, "common.provider.cloudflare", "/imgs/providers/cloudflare.svg", ACCESS_USAGES.APPLY],
|
||||||
@ -167,6 +169,7 @@ export const DEPLOY_PROVIDERS = Object.freeze({
|
|||||||
BAIDUCLOUD_CDN: `${ACCESS_PROVIDERS.BAIDUCLOUD}-cdn`,
|
BAIDUCLOUD_CDN: `${ACCESS_PROVIDERS.BAIDUCLOUD}-cdn`,
|
||||||
BYTEPLUS_CDN: `${ACCESS_PROVIDERS.BYTEPLUS}-cdn`,
|
BYTEPLUS_CDN: `${ACCESS_PROVIDERS.BYTEPLUS}-cdn`,
|
||||||
DOGECLOUD_CDN: `${ACCESS_PROVIDERS.DOGECLOUD}-cdn`,
|
DOGECLOUD_CDN: `${ACCESS_PROVIDERS.DOGECLOUD}-cdn`,
|
||||||
|
EDGIO_APPLICATIONS: `${ACCESS_PROVIDERS.EDGIO}-applications`,
|
||||||
HUAWEICLOUD_CDN: `${ACCESS_PROVIDERS.HUAWEICLOUD}-cdn`,
|
HUAWEICLOUD_CDN: `${ACCESS_PROVIDERS.HUAWEICLOUD}-cdn`,
|
||||||
HUAWEICLOUD_ELB: `${ACCESS_PROVIDERS.HUAWEICLOUD}-elb`,
|
HUAWEICLOUD_ELB: `${ACCESS_PROVIDERS.HUAWEICLOUD}-elb`,
|
||||||
KUBERNETES_SECRET: `${ACCESS_PROVIDERS.KUBERNETES}-secret`,
|
KUBERNETES_SECRET: `${ACCESS_PROVIDERS.KUBERNETES}-secret`,
|
||||||
@ -234,6 +237,7 @@ export const deployProvidersMap: Map<DeployProvider["type"] | string, DeployProv
|
|||||||
[DEPLOY_PROVIDERS.BYTEPLUS_CDN, "common.provider.byteplus.cdn"],
|
[DEPLOY_PROVIDERS.BYTEPLUS_CDN, "common.provider.byteplus.cdn"],
|
||||||
[DEPLOY_PROVIDERS.UCLOUD_US3, "common.provider.ucloud.us3"],
|
[DEPLOY_PROVIDERS.UCLOUD_US3, "common.provider.ucloud.us3"],
|
||||||
[DEPLOY_PROVIDERS.UCLOUD_UCDN, "common.provider.ucloud.ucdn"],
|
[DEPLOY_PROVIDERS.UCLOUD_UCDN, "common.provider.ucloud.ucdn"],
|
||||||
|
[DEPLOY_PROVIDERS.EDGIO_APPLICATIONS, "common.provider.edgio.applications"],
|
||||||
].map(([type, name]) => [
|
].map(([type, name]) => [
|
||||||
type,
|
type,
|
||||||
{
|
{
|
||||||
|
@ -78,6 +78,12 @@
|
|||||||
"access.form.dogecloud_secret_key.label": "Doge Cloud SecretKey",
|
"access.form.dogecloud_secret_key.label": "Doge Cloud SecretKey",
|
||||||
"access.form.dogecloud_secret_key.placeholder": "Please enter Doge Cloud SecretKey",
|
"access.form.dogecloud_secret_key.placeholder": "Please enter Doge Cloud SecretKey",
|
||||||
"access.form.dogecloud_secret_key.tooltip": "For more information, see <a href=\"https://console.dogecloud.com/\" target=\"_blank\">https://console.dogecloud.com/</a>",
|
"access.form.dogecloud_secret_key.tooltip": "For more information, see <a href=\"https://console.dogecloud.com/\" target=\"_blank\">https://console.dogecloud.com/</a>",
|
||||||
|
"access.form.edgio_client_id.label": "Edgio ClientId",
|
||||||
|
"access.form.edgio_client_id.placeholder": "Please enter Edgio ClientId",
|
||||||
|
"access.form.edgio_client_id.tooltip": "For more information, see <a href=\"https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients\" target=\"_blank\">https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients</a>",
|
||||||
|
"access.form.edgio_client_secret.label": "Edgio ClientSecret",
|
||||||
|
"access.form.edgio_client_secret.placeholder": "Please enter Edgio ClientSecret",
|
||||||
|
"access.form.edgio_client_secret.tooltip": "For more information, see <a href=\"https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients\" target=\"_blank\">https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients</a>",
|
||||||
"access.form.godaddy_api_key.label": "GoDaddy API key",
|
"access.form.godaddy_api_key.label": "GoDaddy API key",
|
||||||
"access.form.godaddy_api_key.placeholder": "Please enter GoDaddy API key",
|
"access.form.godaddy_api_key.placeholder": "Please enter GoDaddy API key",
|
||||||
"access.form.godaddy_api_key.tooltip": "For more information, see <a href=\"https://developer.godaddy.com/\" target=\"_blank\">https://developer.godaddy.com/</a>",
|
"access.form.godaddy_api_key.tooltip": "For more information, see <a href=\"https://developer.godaddy.com/\" target=\"_blank\">https://developer.godaddy.com/</a>",
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
"common.provider.cloudflare": "Cloudflare",
|
"common.provider.cloudflare": "Cloudflare",
|
||||||
"common.provider.dogecloud": "Doge Cloud",
|
"common.provider.dogecloud": "Doge Cloud",
|
||||||
"common.provider.dogecloud.cdn": "Doge Cloud - Content Delivery Network (CDN)",
|
"common.provider.dogecloud.cdn": "Doge Cloud - Content Delivery Network (CDN)",
|
||||||
|
"common.provider.edgio": "Edgio",
|
||||||
|
"common.provider.edgio.applications": "Edgio - Applications",
|
||||||
"common.provider.godaddy": "GoDaddy",
|
"common.provider.godaddy": "GoDaddy",
|
||||||
"common.provider.huaweicloud": "Huawei Cloud",
|
"common.provider.huaweicloud": "Huawei Cloud",
|
||||||
"common.provider.huaweicloud.cdn": "Huawei Cloud - Content Delivery Network (CDN)",
|
"common.provider.huaweicloud.cdn": "Huawei Cloud - Content Delivery Network (CDN)",
|
||||||
|
@ -148,6 +148,9 @@
|
|||||||
"workflow_node.deploy.form.dogecloud_cdn_domain.label": "Doge Cloud CDN domain",
|
"workflow_node.deploy.form.dogecloud_cdn_domain.label": "Doge Cloud CDN domain",
|
||||||
"workflow_node.deploy.form.dogecloud_cdn_domain.placeholder": "Please enter Doge Cloud CDN domain name",
|
"workflow_node.deploy.form.dogecloud_cdn_domain.placeholder": "Please enter Doge Cloud CDN domain name",
|
||||||
"workflow_node.deploy.form.dogecloud_cdn_domain.tooltip": "For more information, see <a href=\"https://console.dogecloud.com/\" target=\"_blank\">https://console.dogecloud.com/</a>",
|
"workflow_node.deploy.form.dogecloud_cdn_domain.tooltip": "For more information, see <a href=\"https://console.dogecloud.com/\" target=\"_blank\">https://console.dogecloud.com/</a>",
|
||||||
|
"workflow_node.deploy.form.edgio_applications_environment_id.label": "Edgio Applications environment ID",
|
||||||
|
"workflow_node.deploy.form.edgio_applications_environment_id.placeholder": "Please enter Edgio Applications environment ID",
|
||||||
|
"workflow_node.deploy.form.edgio_applications_environment_id.tooltip": "For more information, see <a href=\"https://edgio.app/\" target=\"_blank\">https://edgio.app/</a>",
|
||||||
"workflow_node.deploy.form.huaweicloud_cdn_region.label": "Huawei Cloud region",
|
"workflow_node.deploy.form.huaweicloud_cdn_region.label": "Huawei Cloud region",
|
||||||
"workflow_node.deploy.form.huaweicloud_cdn_region.placeholder": "Please enter Huawei Cloud region (e.g. cn-north-1)",
|
"workflow_node.deploy.form.huaweicloud_cdn_region.placeholder": "Please enter Huawei Cloud region (e.g. cn-north-1)",
|
||||||
"workflow_node.deploy.form.huaweicloud_cdn_region.tooltip": "For more information, see <a href=\"https://console-intl.huaweicloud.com/apiexplorer/#/endpoint?locale=en-us\" target=\"_blank\">https://console-intl.huaweicloud.com/apiexplorer/#/endpoint</a>",
|
"workflow_node.deploy.form.huaweicloud_cdn_region.tooltip": "For more information, see <a href=\"https://console-intl.huaweicloud.com/apiexplorer/#/endpoint?locale=en-us\" target=\"_blank\">https://console-intl.huaweicloud.com/apiexplorer/#/endpoint</a>",
|
||||||
|
@ -78,6 +78,12 @@
|
|||||||
"access.form.dogecloud_secret_key.label": "多吉云 SecretKey",
|
"access.form.dogecloud_secret_key.label": "多吉云 SecretKey",
|
||||||
"access.form.dogecloud_secret_key.placeholder": "请输入多吉云 SecretKey",
|
"access.form.dogecloud_secret_key.placeholder": "请输入多吉云 SecretKey",
|
||||||
"access.form.dogecloud_secret_key.tooltip": "这是什么?请参阅 <a href=\"https://console.dogecloud.com/\" target=\"_blank\">https://console.dogecloud.com/</a>",
|
"access.form.dogecloud_secret_key.tooltip": "这是什么?请参阅 <a href=\"https://console.dogecloud.com/\" target=\"_blank\">https://console.dogecloud.com/</a>",
|
||||||
|
"access.form.edgio_client_id.label": "Edgio 客户端 ID",
|
||||||
|
"access.form.edgio_client_id.placeholder": "请输入 Edgio 客户端 ID",
|
||||||
|
"access.form.edgio_client_id.tooltip": "这是什么?请参阅 <a href=\"https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients\" target=\"_blank\">https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients</a>",
|
||||||
|
"access.form.edgio_client_secret.label": "Edgio 客户端密码",
|
||||||
|
"access.form.edgio_client_secret.placeholder": "请输入 Edgio 客户端密码",
|
||||||
|
"access.form.edgio_client_secret.tooltip": "这是什么?请参阅 <a href=\"https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients\" target=\"_blank\">https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients</a>",
|
||||||
"access.form.godaddy_api_key.label": "GoDaddy API Key",
|
"access.form.godaddy_api_key.label": "GoDaddy API Key",
|
||||||
"access.form.godaddy_api_key.placeholder": "请输入 GoDaddy API Key",
|
"access.form.godaddy_api_key.placeholder": "请输入 GoDaddy API Key",
|
||||||
"access.form.godaddy_api_key.tooltip": "这是什么?请参阅 <a href=\"https://developer.godaddy.com/\" target=\"_blank\">https://developer.godaddy.com/</a>",
|
"access.form.godaddy_api_key.tooltip": "这是什么?请参阅 <a href=\"https://developer.godaddy.com/\" target=\"_blank\">https://developer.godaddy.com/</a>",
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
"common.provider.cloudflare": "Cloudflare",
|
"common.provider.cloudflare": "Cloudflare",
|
||||||
"common.provider.dogecloud": "多吉云",
|
"common.provider.dogecloud": "多吉云",
|
||||||
"common.provider.dogecloud.cdn": "多吉云 - 内容分发网络 CDN",
|
"common.provider.dogecloud.cdn": "多吉云 - 内容分发网络 CDN",
|
||||||
|
"common.provider.edgio": "Edgio",
|
||||||
|
"common.provider.edgio.applications": "Edgio - Applications",
|
||||||
"common.provider.godaddy": "GoDaddy",
|
"common.provider.godaddy": "GoDaddy",
|
||||||
"common.provider.huaweicloud": "华为云",
|
"common.provider.huaweicloud": "华为云",
|
||||||
"common.provider.huaweicloud.cdn": "华为云 - 内容分发网络 CDN",
|
"common.provider.huaweicloud.cdn": "华为云 - 内容分发网络 CDN",
|
||||||
|
@ -148,6 +148,9 @@
|
|||||||
"workflow_node.deploy.form.dogecloud_cdn_domain.label": "多吉云 CDN 加速域名",
|
"workflow_node.deploy.form.dogecloud_cdn_domain.label": "多吉云 CDN 加速域名",
|
||||||
"workflow_node.deploy.form.dogecloud_cdn_domain.placeholder": "请输入多吉云 CDN 加速域名",
|
"workflow_node.deploy.form.dogecloud_cdn_domain.placeholder": "请输入多吉云 CDN 加速域名",
|
||||||
"workflow_node.deploy.form.dogecloud_cdn_domain.tooltip": "这是什么?请参阅 <a href=\"https://console.dogecloud.com\" target=\"_blank\">https://console.dogecloud.com</a>",
|
"workflow_node.deploy.form.dogecloud_cdn_domain.tooltip": "这是什么?请参阅 <a href=\"https://console.dogecloud.com\" target=\"_blank\">https://console.dogecloud.com</a>",
|
||||||
|
"workflow_node.deploy.form.edgio_applications_environment_id.label": "Edgio Applications 环境 ID",
|
||||||
|
"workflow_node.deploy.form.edgio_applications_environment_id.placeholder": "请输入 Edgio Applications 环境 ID",
|
||||||
|
"workflow_node.deploy.form.edgio_applications_environment_id.tooltip": "这是什么?请参阅 <a href=\"https://edgio.app/\" target=\"_blank\">https://edgio.app/</a>",
|
||||||
"workflow_node.deploy.form.huaweicloud_cdn_region.label": "华为云区域",
|
"workflow_node.deploy.form.huaweicloud_cdn_region.label": "华为云区域",
|
||||||
"workflow_node.deploy.form.huaweicloud_cdn_region.placeholder": "请输入华为云区域(例如:cn-north-1)",
|
"workflow_node.deploy.form.huaweicloud_cdn_region.placeholder": "请输入华为云区域(例如:cn-north-1)",
|
||||||
"workflow_node.deploy.form.huaweicloud_cdn_region.tooltip": "这是什么?请参阅 <a href=\"https://console.huaweicloud.com/apiexplorer/#/endpoint\" target=\"_blank\">https://console.huaweicloud.com/apiexplorer/#/endpoint</a>",
|
"workflow_node.deploy.form.huaweicloud_cdn_region.tooltip": "这是什么?请参阅 <a href=\"https://console.huaweicloud.com/apiexplorer/#/endpoint\" target=\"_blank\">https://console.huaweicloud.com/apiexplorer/#/endpoint</a>",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user