Ver Fonte

Use step.Abs to load the certificate templates

step.Abs has been removed from crypto and they need to be set when those
methods are used
Mariano Cano há 3 anos atrás
pai
commit
7061147885

+ 2 - 1
authority/provisioner/options.go

@@ -6,6 +6,7 @@ import (
 
 	"github.com/pkg/errors"
 
+	"go.step.sm/cli-utils/step"
 	"go.step.sm/crypto/jose"
 	"go.step.sm/crypto/x509util"
 
@@ -160,7 +161,7 @@ func CustomTemplateOptions(o *Options, data x509util.TemplateData, defaultTempla
 		// Load a template from a file if Template is not defined.
 		if opts.Template == "" && opts.TemplateFile != "" {
 			return []x509util.Option{
-				x509util.WithTemplateFile(opts.TemplateFile, data),
+				x509util.WithTemplateFile(step.Abs(opts.TemplateFile), data),
 			}
 		}
 

+ 2 - 1
authority/provisioner/ssh_options.go

@@ -5,6 +5,7 @@ import (
 	"strings"
 
 	"github.com/pkg/errors"
+	"go.step.sm/cli-utils/step"
 	"go.step.sm/crypto/sshutil"
 
 	"github.com/smallstep/certificates/authority/policy"
@@ -144,7 +145,7 @@ func CustomSSHTemplateOptions(o *Options, data sshutil.TemplateData, defaultTemp
 		// Load a template from a file if Template is not defined.
 		if opts.Template == "" && opts.TemplateFile != "" {
 			return []sshutil.Option{
-				sshutil.WithTemplateFile(opts.TemplateFile, data),
+				sshutil.WithTemplateFile(step.Abs(opts.TemplateFile), data),
 			}
 		}