diff --git a/config.sample.toml b/config.sample.toml index bf87003..0e6dd58 100644 --- a/config.sample.toml +++ b/config.sample.toml @@ -12,7 +12,7 @@ apiKey = "" enabled = false baseUrl = "https://porkbun.com/api/json/v3" apiKey = "" -apiSecretKey = "" +secretApiKey = "" ttl = 1800 [cloudflare] diff --git a/services/factory/dns_update_service_factory_test.go b/services/factory/dns_update_service_factory_test.go index b72e163..f6584f7 100644 --- a/services/factory/dns_update_service_factory_test.go +++ b/services/factory/dns_update_service_factory_test.go @@ -22,7 +22,7 @@ func init() { viper.Set("porkbun.enabled", true) viper.Set("porkbun.baseurl", "https://api.foo.com/client/v4") viper.Set("porkbun.apiKey", "foo") - viper.Set("porkbun.apiSecretKey", "bar") + viper.Set("porkbun.secretApiKey", "bar") viper.Set("porkbun.ttl", 42) factory, _ = NewDnsUpdateServiceFactory() diff --git a/services/porkbun.go b/services/porkbun.go index 202fb0b..9b70a0d 100644 --- a/services/porkbun.go +++ b/services/porkbun.go @@ -14,7 +14,7 @@ import ( type PorkbunDnsUpdateService struct { registrarSettings apiKey string - apiSecretKey string + secretApiKey string client HTTPClient } @@ -22,7 +22,7 @@ func NewPorkbunDnsUpdateService(client HTTPClient) (*PorkbunDnsUpdateService, er baseUrl := viper.GetString("porkbun.baseUrl") ttl := viper.GetInt("porkbun.ttl") apikey := viper.GetString("porkbun.apiKey") - apiSecretkey := viper.GetString("porkbun.apiSecretKey") + SecretApiKey := viper.GetString("porkbun.secretApiKey") if len(baseUrl) == 0 || ttl == 0 || len(apikey) == 0 { return nil, ErrMissingInfoForServiceInit @@ -38,7 +38,7 @@ func NewPorkbunDnsUpdateService(client HTTPClient) (*PorkbunDnsUpdateService, er ttl: ttl, }, apiKey: apikey, - apiSecretKey: apiSecretkey, + secretApiKey: SecretApiKey, client: client, }, nil } @@ -72,7 +72,7 @@ func (p *PorkbunDnsUpdateService) UpdateRecord(request *DynDnsRequest) error { TTL: p.ttl, Type: "A", ApiKey: p.apiKey, - SecretApiKey: p.apiSecretKey, + SecretApiKey: p.secretApiKey, } exists, err := p.queryRecordExists(request, porkbunRequest) diff --git a/services/porkbun_test.go b/services/porkbun_test.go index ad30151..12990f5 100644 --- a/services/porkbun_test.go +++ b/services/porkbun_test.go @@ -19,7 +19,7 @@ func setupPorkbunConfig() { viper.Set("porkbun.enabled", true) viper.Set("porkbun.baseurl", "https://api.foo.com/client/v4") viper.Set("porkbun.apiKey", "foo") - viper.Set("porkbun.apiSecretKey", "bar") + viper.Set("porkbun.secretApiKey", "bar") viper.Set("porkbun.ttl", 42) }