forked from TrueCloudLab/certificates
updates after rebase to keep up with master
This commit is contained in:
parent
7eeebca529
commit
ed4b56732e
3 changed files with 17 additions and 16 deletions
|
@ -9,7 +9,7 @@ import (
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/smallstep/certificates/authority/provisioner"
|
"github.com/smallstep/certificates/authority/provisioner"
|
||||||
"go.step.sm/cli-utils/config"
|
"go.step.sm/cli-utils/step"
|
||||||
"go.step.sm/linkedca"
|
"go.step.sm/linkedca"
|
||||||
"google.golang.org/protobuf/types/known/structpb"
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
)
|
)
|
||||||
|
@ -245,7 +245,7 @@ func mustReadFileOrURI(fn string, m map[string][]byte) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
stepPath := filepath.ToSlash(config.StepPath())
|
stepPath := filepath.ToSlash(step.Path())
|
||||||
if !strings.HasSuffix(stepPath, "/") {
|
if !strings.HasSuffix(stepPath, "/") {
|
||||||
stepPath += "/"
|
stepPath += "/"
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ func mustReadFileOrURI(fn string, m map[string][]byte) string {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
if ok {
|
if ok {
|
||||||
b, err := ioutil.ReadFile(config.StepAbs(fn))
|
b, err := ioutil.ReadFile(step.Abs(fn))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(errors.Wrapf(err, "error reading %s", fn))
|
panic(errors.Wrapf(err, "error reading %s", fn))
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
"github.com/smallstep/certificates/authority/config"
|
"github.com/smallstep/certificates/authority/config"
|
||||||
"github.com/smallstep/certificates/authority/provisioner"
|
"github.com/smallstep/certificates/authority/provisioner"
|
||||||
"github.com/smallstep/certificates/errs"
|
"github.com/smallstep/certificates/errs"
|
||||||
step "go.step.sm/cli-utils/config"
|
"go.step.sm/cli-utils/step"
|
||||||
"go.step.sm/cli-utils/ui"
|
"go.step.sm/cli-utils/ui"
|
||||||
"go.step.sm/crypto/jose"
|
"go.step.sm/crypto/jose"
|
||||||
"go.step.sm/linkedca"
|
"go.step.sm/linkedca"
|
||||||
|
@ -523,7 +523,7 @@ func provisionerOptionsToLinkedca(p *provisioner.Options) (*linkedca.Template, *
|
||||||
if p.X509.Template != "" {
|
if p.X509.Template != "" {
|
||||||
x509Template.Template = []byte(p.SSH.Template)
|
x509Template.Template = []byte(p.SSH.Template)
|
||||||
} else if p.X509.TemplateFile != "" {
|
} else if p.X509.TemplateFile != "" {
|
||||||
filename := step.StepAbs(p.X509.TemplateFile)
|
filename := step.Abs(p.X509.TemplateFile)
|
||||||
if x509Template.Template, err = ioutil.ReadFile(filename); err != nil {
|
if x509Template.Template, err = ioutil.ReadFile(filename); err != nil {
|
||||||
return nil, nil, errors.Wrap(err, "error reading x509 template")
|
return nil, nil, errors.Wrap(err, "error reading x509 template")
|
||||||
}
|
}
|
||||||
|
@ -539,7 +539,7 @@ func provisionerOptionsToLinkedca(p *provisioner.Options) (*linkedca.Template, *
|
||||||
if p.SSH.Template != "" {
|
if p.SSH.Template != "" {
|
||||||
sshTemplate.Template = []byte(p.SSH.Template)
|
sshTemplate.Template = []byte(p.SSH.Template)
|
||||||
} else if p.SSH.TemplateFile != "" {
|
} else if p.SSH.TemplateFile != "" {
|
||||||
filename := step.StepAbs(p.SSH.TemplateFile)
|
filename := step.Abs(p.SSH.TemplateFile)
|
||||||
if sshTemplate.Template, err = ioutil.ReadFile(filename); err != nil {
|
if sshTemplate.Template, err = ioutil.ReadFile(filename); err != nil {
|
||||||
return nil, nil, errors.Wrap(err, "error reading ssh template")
|
return nil, nil, errors.Wrap(err, "error reading ssh template")
|
||||||
}
|
}
|
||||||
|
|
21
pki/pki.go
21
pki/pki.go
|
@ -293,16 +293,17 @@ func WithKeyURIs(rootKey, intermediateKey, hostKey, userKey string) Option {
|
||||||
// PKI represents the Public Key Infrastructure used by a certificate authority.
|
// PKI represents the Public Key Infrastructure used by a certificate authority.
|
||||||
type PKI struct {
|
type PKI struct {
|
||||||
linkedca.Configuration
|
linkedca.Configuration
|
||||||
Defaults linkedca.Defaults
|
Defaults linkedca.Defaults
|
||||||
casOptions apiv1.Options
|
casOptions apiv1.Options
|
||||||
caService apiv1.CertificateAuthorityService
|
caService apiv1.CertificateAuthorityService
|
||||||
caCreator apiv1.CertificateAuthorityCreator
|
caCreator apiv1.CertificateAuthorityCreator
|
||||||
keyManager kmsapi.KeyManager
|
keyManager kmsapi.KeyManager
|
||||||
config string
|
config string
|
||||||
defaults string
|
defaults string
|
||||||
ottPublicKey *jose.JSONWebKey
|
profileDefaults string
|
||||||
ottPrivateKey *jose.JSONWebEncryption
|
ottPublicKey *jose.JSONWebKey
|
||||||
options *options
|
ottPrivateKey *jose.JSONWebEncryption
|
||||||
|
options *options
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new PKI configuration.
|
// New creates a new PKI configuration.
|
||||||
|
|
Loading…
Reference in a new issue