1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

TRANSIP: Enable privatekey authentication (#1212)

* Add PrivateKey authentication for TransIP

* Remove space before comma

* Re-enable CodeQL for Javascript (#1209)

* Create codeql-config.yml

* Update codeql-analysis.yml

Add config to exclude certain files

* deSEC implement pagination (#1208)

* deSEC: Implement pagination for domain list #1177

* deSEC: add debug logging for pagination

* deSEC: simplify get/post methods by allowing url / api endpoints as target

* deSEC: implement pagination for getRecords function

* deSEC: fix linter warnings

* deSEC: replace domainIndexInitalized variable with checking if the domainIndex == nil

* deSEC: add mutex for domainIndex

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>

Co-authored-by: Vincent Hagen <vinnie@script4web.nl>
Co-authored-by: Jauder Ho <jauderho@users.noreply.github.com>
Co-authored-by: Georg <georg@neuland.tech>
This commit is contained in:
Tom Limoncelli
2021-07-21 12:06:29 -04:00
committed by GitHub
parent 2832746a47
commit 8ab0df92cc
2 changed files with 27 additions and 4 deletions

View File

@@ -43,12 +43,19 @@ var features = providers.DocumentationNotes{
}
func NewTransip(m map[string]string, metadata json.RawMessage) (providers.DNSServiceProvider, error) {
if m["AccessToken"] == "" {
return nil, fmt.Errorf("no TransIP token provided")
if m["AccessToken"] == "" && m["PrivateKey"] == "" {
return nil, fmt.Errorf("no TransIP AccessToken or PrivateKey provided")
}
if m["PrivateKey"] != "" && m["AccountName"] == "" {
return nil, fmt.Errorf("no AccountName given, required for authenticating with PrivateKey")
}
client, err := gotransip.NewClient(gotransip.ClientConfiguration{
Token: m["AccessToken"],
Token: m["AccessToken"],
AccountName: m["AccountName"],
PrivateKeyReader: strings.NewReader(m["PrivateKey"]),
})
if err != nil {