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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user