mirror of
https://github.com/certimate-go/certimate.git
synced 2026-09-24 23:10:13 +08:00
feat: update access fields to AccessKeyId and SecretAccessKey for volcengine services
This commit is contained in:
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcenginealb.NewDeployer(&volcenginealb.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
Region: xmaps.GetString(options.ProviderExtendedConfig, "region"),
|
||||
DeployTarget: xmaps.GetString(options.ProviderExtendedConfig, "deployTarget"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcengineapig.NewDeployer(&volcengineapig.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
Region: xmaps.GetString(options.ProviderExtendedConfig, "region"),
|
||||
DomainMatchPattern: xmaps.GetString(options.ProviderExtendedConfig, "domainMatchPattern"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcenginecdn.NewDeployer(&volcenginecdn.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
DomainMatchPattern: xmaps.GetString(options.ProviderExtendedConfig, "domainMatchPattern"),
|
||||
Domain: xmaps.GetString(options.ProviderExtendedConfig, "domain"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcenginecertcenter.NewDeployer(&volcenginecertcenter.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
Region: xmaps.GetString(options.ProviderExtendedConfig, "region"),
|
||||
})
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcengineclb.NewDeployer(&volcengineclb.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
Region: xmaps.GetString(options.ProviderExtendedConfig, "region"),
|
||||
DeployTarget: xmaps.GetString(options.ProviderExtendedConfig, "deployTarget"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcenginedcdn.NewDeployer(&volcenginedcdn.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
DomainMatchPattern: xmaps.GetString(options.ProviderExtendedConfig, "domainMatchPattern"),
|
||||
Domain: xmaps.GetString(options.ProviderExtendedConfig, "domain"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcengineimagex.NewDeployer(&volcengineimagex.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
Region: xmaps.GetString(options.ProviderExtendedConfig, "region"),
|
||||
ServiceId: xmaps.GetString(options.ProviderExtendedConfig, "serviceId"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcenginelive.NewDeployer(&volcenginelive.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
DomainMatchPattern: xmaps.GetString(options.ProviderExtendedConfig, "domainMatchPattern"),
|
||||
Domain: xmaps.GetString(options.ProviderExtendedConfig, "domain"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcenginetos.NewDeployer(&volcenginetos.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
Region: xmaps.GetString(options.ProviderExtendedConfig, "region"),
|
||||
Bucket: xmaps.GetString(options.ProviderExtendedConfig, "bucket"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcenginevod.NewDeployer(&volcenginevod.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
SpaceName: xmaps.GetString(options.ProviderExtendedConfig, "spaceName"),
|
||||
DomainMatchPattern: xmaps.GetString(options.ProviderExtendedConfig, "domainMatchPattern"),
|
||||
|
||||
@@ -18,7 +18,7 @@ func init() {
|
||||
|
||||
provider, err := volcenginewaf.NewDeployer(&volcenginewaf.DeployerConfig{
|
||||
AccessKeyId: credentials.AccessKeyId,
|
||||
AccessKeySecret: credentials.SecretAccessKey,
|
||||
SecretAccessKey: credentials.SecretAccessKey,
|
||||
ProjectName: credentials.ProjectName,
|
||||
Region: xmaps.GetString(options.ProviderExtendedConfig, "region"),
|
||||
AccessMode: xmaps.GetString(options.ProviderExtendedConfig, "accessMode"),
|
||||
|
||||
@@ -46,6 +46,13 @@ func init() {
|
||||
record.Set("config", config)
|
||||
changed = true
|
||||
}
|
||||
case "volcengine":
|
||||
if _, ok := config["accessKeySecret"]; ok {
|
||||
config["secretAccessKey"] = config["accessKeySecret"]
|
||||
delete(config, "accessKeySecret")
|
||||
record.Set("config", config)
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
|
||||
if changed {
|
||||
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
type CertmgrConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
}
|
||||
@@ -40,7 +40,7 @@ func NewCertmgr(config *CertmgrConfig) (*Certmgr, error) {
|
||||
return nil, fmt.Errorf("the configuration of the certmgr provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
@@ -12,14 +12,14 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
)
|
||||
|
||||
func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -29,7 +29,7 @@ Shell command to run this test:
|
||||
--VOLCENGINECDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINECDN_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINECDN_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINECDN_ACCESSKEYSECRET="your-access-key-secret"
|
||||
--VOLCENGINECDN_SECRETACCESSKEY="your-secret-access-key"
|
||||
*/
|
||||
func TestProvider(t *testing.T) {
|
||||
fp.Parse()
|
||||
@@ -37,7 +37,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Upload", func(t *testing.T) {
|
||||
provider, err := impl.NewCertmgr(&impl.CertmgrConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
})
|
||||
if err != nil {
|
||||
t.Errorf("err: %+v", err)
|
||||
|
||||
@@ -16,8 +16,8 @@ import (
|
||||
type CertmgrConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -37,7 +37,7 @@ func NewCertmgr(config *CertmgrConfig) (*Certmgr, error) {
|
||||
return nil, fmt.Errorf("the configuration of the certmgr provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
@@ -95,13 +95,13 @@ func (c *Certmgr) Replace(ctx context.Context, certIdOrName string, certPEM, pri
|
||||
return nil, certmgr.ErrUnsupported
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret, region string) (*vecertificateservice.CERTIFICATESERVICE, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey, region string) (*vecertificateservice.CERTIFICATESERVICE, error) {
|
||||
if region == "" {
|
||||
region = "cn-beijing" // 证书中心默认区域:北京
|
||||
}
|
||||
|
||||
config := ve.NewConfig().
|
||||
WithAkSk(accessKeyId, accessKeySecret).
|
||||
WithAkSk(accessKeyId, secretAccessKey).
|
||||
WithRegion(region)
|
||||
|
||||
session, err := vesession.NewSession(config)
|
||||
|
||||
@@ -12,14 +12,14 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
)
|
||||
|
||||
func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -29,7 +29,7 @@ Shell command to run this test:
|
||||
--VOLCENGINECERTCENTER_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINECERTCENTER_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINECERTCENTER_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINECERTCENTER_ACCESSKEYSECRET="your-access-key-secret"
|
||||
--VOLCENGINECERTCENTER_SECRETACCESSKEY="your-secret-access-key"
|
||||
*/
|
||||
func TestProvider(t *testing.T) {
|
||||
fp.Parse()
|
||||
@@ -37,7 +37,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Upload", func(t *testing.T) {
|
||||
provider, err := impl.NewCertmgr(&impl.CertmgrConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
})
|
||||
if err != nil {
|
||||
t.Errorf("err: %+v", err)
|
||||
|
||||
@@ -18,8 +18,8 @@ import (
|
||||
type CertmgrConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
}
|
||||
@@ -39,7 +39,7 @@ func NewCertmgr(config *CertmgrConfig) (*Certmgr, error) {
|
||||
|
||||
client := velive.NewInstance()
|
||||
client.SetAccessKey(config.AccessKeyId)
|
||||
client.SetSecretKey(config.AccessKeySecret)
|
||||
client.SetSecretKey(config.SecretAccessKey)
|
||||
|
||||
return &Certmgr{
|
||||
config: config,
|
||||
|
||||
@@ -12,14 +12,14 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
)
|
||||
|
||||
func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -29,7 +29,7 @@ Shell command to run this test:
|
||||
--VOLCENGINELIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINELIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINELIVE_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINELIVE_ACCESSKEYSECRET="your-access-key-secret"
|
||||
--VOLCENGINELIVE_SECRETACCESSKEY="your-secret-access-key"
|
||||
*/
|
||||
func TestProvider(t *testing.T) {
|
||||
fp.Parse()
|
||||
@@ -37,7 +37,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Upload", func(t *testing.T) {
|
||||
provider, err := impl.NewCertmgr(&impl.CertmgrConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
})
|
||||
if err != nil {
|
||||
t.Errorf("err: %+v", err)
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -52,14 +52,14 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
return nil, fmt.Errorf("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
Region: config.Region,
|
||||
})
|
||||
@@ -264,9 +264,9 @@ func (d *Deployer) updateListenerCertificate(ctx context.Context, cloudListenerI
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret, region string) (*vealb.ALB, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey, region string) (*vealb.ALB, error) {
|
||||
config := ve.NewConfig().
|
||||
WithAkSk(accessKeyId, accessKeySecret).
|
||||
WithAkSk(accessKeyId, secretAccessKey).
|
||||
WithRegion(region)
|
||||
|
||||
session, err := vesession.NewSession(config)
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fRegion string
|
||||
fListenerId string
|
||||
)
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fRegion, "REGION")
|
||||
fp.DefineString(&fListenerId, "LISTENERID")
|
||||
}
|
||||
@@ -33,7 +33,7 @@ Shell command to run this test:
|
||||
--VOLCENGINEALB_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINEALB_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINEALB_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINEALB_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINEALB_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINEALB_REGION="cn-beijing" \
|
||||
--VOLCENGINEALB_LISTENERID="your-listener-id"
|
||||
*/
|
||||
@@ -43,7 +43,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy_ToListener", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
Region: fRegion,
|
||||
DeployTarget: impl.DEPLOY_TARGET_LISTENER,
|
||||
ListenerId: fListenerId,
|
||||
|
||||
@@ -20,8 +20,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -47,14 +47,14 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
return nil, fmt.Errorf("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
Region: config.Region,
|
||||
})
|
||||
@@ -260,9 +260,9 @@ func (d *Deployer) updateDomainCertificate(ctx context.Context, cloudDomainId st
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret, region string) (*veapig.APIG, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey, region string) (*veapig.APIG, error) {
|
||||
config := ve.NewConfig().
|
||||
WithAkSk(accessKeyId, accessKeySecret).
|
||||
WithAkSk(accessKeyId, secretAccessKey).
|
||||
WithRegion(region)
|
||||
|
||||
session, err := vesession.NewSession(config)
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fRegion string
|
||||
fDomain string
|
||||
)
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fRegion, "REGION")
|
||||
fp.DefineString(&fDomain, "DOMAIN")
|
||||
}
|
||||
@@ -33,7 +33,7 @@ Shell command to run this test:
|
||||
--VOLCENGINEAPIG_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINEAPIG_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINEAPIG_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINEAPIG_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINEAPIG_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINEALB_REGION="cn-beijing" \
|
||||
--VOLCENGINEAPIG_DOMAIN="example.com"
|
||||
*/
|
||||
@@ -43,7 +43,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
Region: fRegion,
|
||||
DomainMatchPattern: impl.DOMAIN_MATCH_PATTERN_EXACT,
|
||||
Domain: fDomain,
|
||||
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 域名匹配模式。
|
||||
@@ -46,14 +46,14 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
return nil, fmt.Errorf("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -255,9 +255,9 @@ func (d *Deployer) updateDomainCertificate(ctx context.Context, domain string, c
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret string) (*vecdn.CDN, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey string) (*vecdn.CDN, error) {
|
||||
config := ve.NewConfig().
|
||||
WithAkSk(accessKeyId, accessKeySecret).
|
||||
WithAkSk(accessKeyId, secretAccessKey).
|
||||
WithRegion("cn-north-1")
|
||||
|
||||
session, err := vesession.NewSession(config)
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fDomain string
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fDomain, "DOMAIN")
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ Shell command to run this test:
|
||||
--VOLCENGINECDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINECDN_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINECDN_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINECDN_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINECDN_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINECDN_DOMAIN="example.com"
|
||||
*/
|
||||
func TestProvider(t *testing.T) {
|
||||
@@ -40,7 +40,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
DomainMatchPattern: impl.DOMAIN_MATCH_PATTERN_EXACT,
|
||||
Domain: fDomain,
|
||||
})
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -36,7 +36,7 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
Region: config.Region,
|
||||
})
|
||||
|
||||
@@ -18,8 +18,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -48,14 +48,14 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
return nil, fmt.Errorf("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
Region: config.Region,
|
||||
})
|
||||
@@ -215,9 +215,9 @@ func (d *Deployer) updateListenerCertificate(ctx context.Context, cloudListenerI
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret, region string) (*veclb.CLB, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey, region string) (*veclb.CLB, error) {
|
||||
config := ve.NewConfig().
|
||||
WithAkSk(accessKeyId, accessKeySecret).
|
||||
WithAkSk(accessKeyId, secretAccessKey).
|
||||
WithRegion(region)
|
||||
|
||||
session, err := vesession.NewSession(config)
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fRegion string
|
||||
fListenerId string
|
||||
)
|
||||
@@ -21,7 +21,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fRegion, "REGION")
|
||||
fp.DefineString(&fListenerId, "LISTENERID")
|
||||
}
|
||||
@@ -33,7 +33,7 @@ Shell command to run this test:
|
||||
--VOLCENGINECLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINECLB_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINECLB_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINECLB_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINECLB_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINECLB_REGION="cn-beijing" \
|
||||
--VOLCENGINECLB_LISTENERID="your-listener-id"
|
||||
*/
|
||||
@@ -43,7 +43,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy_ToListener", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
Region: fRegion,
|
||||
DeployTarget: impl.DEPLOY_TARGET_LISTENER,
|
||||
ListenerId: fListenerId,
|
||||
|
||||
@@ -20,8 +20,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -47,14 +47,14 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
return nil, fmt.Errorf("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
Region: config.Region,
|
||||
})
|
||||
@@ -205,13 +205,13 @@ func (d *Deployer) getAllDomains(ctx context.Context) ([]string, error) {
|
||||
return domains, nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret, region string) (*vedcdn.DCDN, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey, region string) (*vedcdn.DCDN, error) {
|
||||
if region == "" {
|
||||
region = "cn-beijing" // DCDN 服务默认区域:北京
|
||||
}
|
||||
|
||||
config := ve.NewConfig().
|
||||
WithAkSk(accessKeyId, accessKeySecret).
|
||||
WithAkSk(accessKeyId, secretAccessKey).
|
||||
WithRegion(region)
|
||||
|
||||
session, err := vesession.NewSession(config)
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fDomain string
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fDomain, "DOMAIN")
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ Shell command to run this test:
|
||||
--VOLCENGINEDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINEDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINEDCDN_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINEDCDN_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINEDCDN_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINEDCDN_DOMAIN="example.com"
|
||||
*/
|
||||
func TestProvider(t *testing.T) {
|
||||
@@ -40,7 +40,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
DomainMatchPattern: impl.DOMAIN_MATCH_PATTERN_EXACT,
|
||||
Domain: fDomain,
|
||||
})
|
||||
|
||||
@@ -16,8 +16,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -42,14 +42,14 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
return nil, fmt.Errorf("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
Region: config.Region,
|
||||
})
|
||||
@@ -135,7 +135,7 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*dep
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret, region string) (*veimagex.Imagex, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey, region string) (*veimagex.Imagex, error) {
|
||||
var instance *veimagex.Imagex
|
||||
if region == "" {
|
||||
instance = veimagex.NewInstance()
|
||||
@@ -145,7 +145,7 @@ func createSDKClient(accessKeyId, accessKeySecret, region string) (*veimagex.Ima
|
||||
|
||||
instance.SetCredential(vebase.Credentials{
|
||||
AccessKeyID: accessKeyId,
|
||||
SecretAccessKey: accessKeySecret,
|
||||
SecretAccessKey: secretAccessKey,
|
||||
})
|
||||
|
||||
return instance, nil
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fRegion string
|
||||
fServiceId string
|
||||
fDomain string
|
||||
@@ -22,7 +22,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fRegion, "REGION")
|
||||
fp.DefineString(&fServiceId, "SERVICEID")
|
||||
fp.DefineString(&fDomain, "DOMAIN")
|
||||
@@ -35,7 +35,7 @@ Shell command to run this test:
|
||||
--VOLCENGINEIMAGEX_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINEIMAGEX_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINEIMAGEX_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINEIMAGEX_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINEIMAGEX_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINEIMAGEX_REGION="cn-north-1" \
|
||||
--VOLCENGINEIMAGEX_SERVICEID="your-service-id" \
|
||||
--VOLCENGINEIMAGEX_DOMAIN="example.com"
|
||||
@@ -46,7 +46,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
Region: fRegion,
|
||||
ServiceId: fServiceId,
|
||||
Domain: fDomain,
|
||||
|
||||
@@ -20,8 +20,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 域名匹配模式。
|
||||
@@ -47,11 +47,11 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
|
||||
client := velive.NewInstance()
|
||||
client.SetAccessKey(config.AccessKeyId)
|
||||
client.SetSecretKey(config.AccessKeySecret)
|
||||
client.SetSecretKey(config.SecretAccessKey)
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fDomain string
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fDomain, "DOMAIN")
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ Shell command to run this test:
|
||||
--VOLCENGINELIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINELIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINELIVE_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINELIVE_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINELIVE_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINELIVE_DOMAIN="example.com"
|
||||
*/
|
||||
func TestProvider(t *testing.T) {
|
||||
@@ -40,7 +40,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
DomainMatchPattern: impl.DOMAIN_MATCH_PATTERN_EXACT,
|
||||
Domain: fDomain,
|
||||
})
|
||||
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -41,14 +41,14 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
return nil, fmt.Errorf("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
Region: config.Region,
|
||||
})
|
||||
@@ -108,13 +108,13 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*dep
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret, region string) (*tos.ClientV2, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey, region string) (*tos.ClientV2, error) {
|
||||
endpoint := fmt.Sprintf("tos-%s.volces.com", region)
|
||||
|
||||
client, err := tos.NewClientV2(
|
||||
endpoint,
|
||||
tos.WithRegion(region),
|
||||
tos.WithCredentials(tos.NewStaticCredentials(accessKeyId, accessKeySecret)),
|
||||
tos.WithCredentials(tos.NewStaticCredentials(accessKeyId, secretAccessKey)),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fRegion string
|
||||
fBucket string
|
||||
fDomain string
|
||||
@@ -22,7 +22,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fRegion, "REGION")
|
||||
fp.DefineString(&fBucket, "BUCKET")
|
||||
fp.DefineString(&fDomain, "DOMAIN")
|
||||
@@ -35,7 +35,7 @@ Shell command to run this test:
|
||||
--VOLCENGINETOS_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINETOS_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINETOS_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINETOS_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINETOS_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINETOS_REGION="cn-beijing" \
|
||||
--VOLCENGINETOS_BUCKET="your-tos-bucket" \
|
||||
--VOLCENGINETOS_DOMAIN="example.com"
|
||||
@@ -46,7 +46,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
Region: fRegion,
|
||||
Bucket: fBucket,
|
||||
Domain: fDomain,
|
||||
|
||||
@@ -22,8 +22,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 点播空间名称。
|
||||
@@ -53,11 +53,11 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
|
||||
client := vevod.NewInstance()
|
||||
client.SetAccessKey(config.AccessKeyId)
|
||||
client.SetSecretKey(config.AccessKeySecret)
|
||||
client.SetSecretKey(config.SecretAccessKey)
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fSpaceName string
|
||||
fDomainType string
|
||||
fDomain string
|
||||
@@ -22,7 +22,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fSpaceName, "SPACENAME")
|
||||
fp.DefineString(&fDomainType, "DOMAINTYPE")
|
||||
fp.DefineString(&fDomain, "DOMAIN")
|
||||
@@ -35,7 +35,7 @@ Shell command to run this test:
|
||||
--VOLCENGINEVOD_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINEVOD_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINEVOD_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINEVOD_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINEVOD_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINEVOD_SPACENAME="vod-space-name" \
|
||||
--VOLCENGINEVOD_DOMAINTYPE="play" \
|
||||
--VOLCENGINEVOD_DOMAIN="example.com"
|
||||
@@ -46,7 +46,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
DomainMatchPattern: impl.DOMAIN_MATCH_PATTERN_EXACT,
|
||||
SpaceName: fSpaceName,
|
||||
DomainType: fDomainType,
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
type DeployerConfig struct {
|
||||
// 火山引擎 AccessKeyId。
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
// 火山引擎 AccessKeySecret。
|
||||
AccessKeySecret string `json:"accessKeySecret"`
|
||||
// 火山引擎 SecretAccessKey。
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
// 火山引擎项目名称。
|
||||
ProjectName string `json:"projectName,omitempty"`
|
||||
// 火山引擎地域。
|
||||
@@ -45,14 +45,14 @@ func NewDeployer(config *DeployerConfig) (*Deployer, error) {
|
||||
return nil, fmt.Errorf("the configuration of the deployer provider is nil")
|
||||
}
|
||||
|
||||
client, err := createSDKClient(config.AccessKeyId, config.AccessKeySecret, config.Region)
|
||||
client, err := createSDKClient(config.AccessKeyId, config.SecretAccessKey, config.Region)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not create client: %w", err)
|
||||
}
|
||||
|
||||
pcertmgr, err := certmgrimpl.NewCertmgr(&certmgrimpl.CertmgrConfig{
|
||||
AccessKeyId: config.AccessKeyId,
|
||||
AccessKeySecret: config.AccessKeySecret,
|
||||
SecretAccessKey: config.SecretAccessKey,
|
||||
ProjectName: config.ProjectName,
|
||||
Region: config.Region,
|
||||
})
|
||||
@@ -163,9 +163,9 @@ func (d *Deployer) deployWithCNAME(ctx context.Context, cloudCertId string) erro
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSDKClient(accessKeyId, accessKeySecret, region string) (*vewaf.WAF, error) {
|
||||
func createSDKClient(accessKeyId, secretAccessKey, region string) (*vewaf.WAF, error) {
|
||||
config := ve.NewConfig().
|
||||
WithAkSk(accessKeyId, accessKeySecret).
|
||||
WithAkSk(accessKeyId, secretAccessKey).
|
||||
WithRegion(region)
|
||||
|
||||
session, err := vesession.NewSession(config)
|
||||
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
fTestCertPath string
|
||||
fTestKeyPath string
|
||||
fAccessKeyId string
|
||||
fAccessKeySecret string
|
||||
fSecretAccessKey string
|
||||
fRegion string
|
||||
fAccessMode string
|
||||
fDomain string
|
||||
@@ -22,7 +22,7 @@ func init() {
|
||||
fp.DefineString(&fTestCertPath, "TESTCERTPATH")
|
||||
fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
|
||||
fp.DefineString(&fAccessKeyId, "ACCESSKEYID")
|
||||
fp.DefineString(&fAccessKeySecret, "ACCESSKEYSECRET")
|
||||
fp.DefineString(&fSecretAccessKey, "SECRETACCESSKEY")
|
||||
fp.DefineString(&fRegion, "REGION")
|
||||
fp.DefineString(&fAccessMode, "ACCESSMODE")
|
||||
fp.DefineString(&fDomain, "DOMAIN")
|
||||
@@ -35,7 +35,7 @@ Shell command to run this test:
|
||||
--VOLCENGINEWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
|
||||
--VOLCENGINEWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
|
||||
--VOLCENGINEWAF_ACCESSKEYID="your-access-key-id" \
|
||||
--VOLCENGINEWAF_ACCESSKEYSECRET="your-access-key-secret" \
|
||||
--VOLCENGINEWAF_SECRETACCESSKEY="your-secret-access-key" \
|
||||
--VOLCENGINEWAF_REGION="cn-beijing" \
|
||||
--VOLCENGINEWAF_ACCESSMODE="cname" \
|
||||
--VOLCENGINEWAF_DOMAIN="example.com"
|
||||
@@ -46,7 +46,7 @@ func TestProvider(t *testing.T) {
|
||||
t.Run("Deploy", func(t *testing.T) {
|
||||
provider, err := impl.NewDeployer(&impl.DeployerConfig{
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKeySecret: fAccessKeySecret,
|
||||
SecretAccessKey: fSecretAccessKey,
|
||||
Region: fRegion,
|
||||
AccessMode: fAccessMode,
|
||||
Domain: fDomain,
|
||||
|
||||
Reference in New Issue
Block a user