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

switch to new go-acme imports from xenolf. Fix api changes (#540)

* switch to new go-acme imports from xenolf. Fix api changes

* update many vault related dependencies
This commit is contained in:
Craig Peterson
2019-07-29 10:54:32 -04:00
committed by GitHub
parent cafd4d387a
commit 2ee086d41c
177 changed files with 10978 additions and 4075 deletions

View File

@@ -7,7 +7,7 @@ import (
"fmt"
"strings"
"github.com/xenolf/lego/acme"
"github.com/go-acme/lego/certificate"
"github.com/hashicorp/vault/api"
)
@@ -32,7 +32,7 @@ func makeVaultStorage(vaultPath string) (Storage, error) {
return storage, nil
}
func (v *vaultStorage) GetCertificate(name string) (*acme.CertificateResource, error) {
func (v *vaultStorage) GetCertificate(name string) (*certificate.Resource, error) {
path := v.certPath(name)
secret, err := v.client.Read(path)
if err != nil {
@@ -41,7 +41,7 @@ func (v *vaultStorage) GetCertificate(name string) (*acme.CertificateResource, e
if secret == nil {
return nil, nil
}
cert := &acme.CertificateResource{}
cert := &certificate.Resource{}
if dat, err := v.getString("meta", secret.Data, path); err != nil {
return nil, err
} else if err = json.Unmarshal(dat, cert); err != nil {
@@ -75,7 +75,7 @@ func (v *vaultStorage) getString(key string, data map[string]interface{}, path s
return []byte(str), nil
}
func (v *vaultStorage) StoreCertificate(name string, cert *acme.CertificateResource) error {
func (v *vaultStorage) StoreCertificate(name string, cert *certificate.Resource) error {
jDat, err := json.MarshalIndent(cert, "", " ")
if err != nil {
return err