Skip to content

Commit f05318c

Browse files
committed
fix: param naming for porkbun secret api key, #12
1 parent 51e7c51 commit f05318c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

config.sample.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ apiKey = ""
1212
enabled = false
1313
baseUrl = "https://porkbun.com/api/json/v3"
1414
apiKey = ""
15-
apiSecretKey = ""
15+
secretApiKey = ""
1616
ttl = 1800
1717

1818
[cloudflare]

services/factory/dns_update_service_factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func init() {
2222
viper.Set("porkbun.enabled", true)
2323
viper.Set("porkbun.baseurl", "https://api.foo.com/client/v4")
2424
viper.Set("porkbun.apiKey", "foo")
25-
viper.Set("porkbun.apiSecretKey", "bar")
25+
viper.Set("porkbun.secretApiKey", "bar")
2626
viper.Set("porkbun.ttl", 42)
2727

2828
factory, _ = NewDnsUpdateServiceFactory()

services/porkbun.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ import (
1414
type PorkbunDnsUpdateService struct {
1515
registrarSettings
1616
apiKey string
17-
apiSecretKey string
17+
secretApiKey string
1818
client HTTPClient
1919
}
2020

2121
func NewPorkbunDnsUpdateService(client HTTPClient) (*PorkbunDnsUpdateService, error) {
2222
baseUrl := viper.GetString("porkbun.baseUrl")
2323
ttl := viper.GetInt("porkbun.ttl")
2424
apikey := viper.GetString("porkbun.apiKey")
25-
apiSecretkey := viper.GetString("porkbun.apiSecretKey")
25+
SecretApiKey := viper.GetString("porkbun.secretApiKey")
2626

2727
if len(baseUrl) == 0 || ttl == 0 || len(apikey) == 0 {
2828
return nil, ErrMissingInfoForServiceInit
@@ -38,7 +38,7 @@ func NewPorkbunDnsUpdateService(client HTTPClient) (*PorkbunDnsUpdateService, er
3838
ttl: ttl,
3939
},
4040
apiKey: apikey,
41-
apiSecretKey: apiSecretkey,
41+
secretApiKey: SecretApiKey,
4242
client: client,
4343
}, nil
4444
}
@@ -72,7 +72,7 @@ func (p *PorkbunDnsUpdateService) UpdateRecord(request *DynDnsRequest) error {
7272
TTL: p.ttl,
7373
Type: "A",
7474
ApiKey: p.apiKey,
75-
SecretApiKey: p.apiSecretKey,
75+
SecretApiKey: p.secretApiKey,
7676
}
7777

7878
exists, err := p.queryRecordExists(request, porkbunRequest)

services/porkbun_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func setupPorkbunConfig() {
1919
viper.Set("porkbun.enabled", true)
2020
viper.Set("porkbun.baseurl", "https://api.foo.com/client/v4")
2121
viper.Set("porkbun.apiKey", "foo")
22-
viper.Set("porkbun.apiSecretKey", "bar")
22+
viper.Set("porkbun.secretApiKey", "bar")
2323
viper.Set("porkbun.ttl", 42)
2424
}
2525

0 commit comments

Comments
 (0)