Use new types in config.

This commit is contained in:
Mariano Cano 2019-03-06 14:49:25 -08:00
parent 62dab7b6b8
commit 34ff388828

View file

@ -7,6 +7,7 @@ import (
"time" "time"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/smallstep/certificates/authority/provisioner"
"github.com/smallstep/cli/crypto/tlsutil" "github.com/smallstep/cli/crypto/tlsutil"
"github.com/smallstep/cli/crypto/x509util" "github.com/smallstep/cli/crypto/x509util"
) )
@ -25,10 +26,10 @@ var (
Renegotiation: false, Renegotiation: false,
} }
defaultDisableRenewal = false defaultDisableRenewal = false
globalProvisionerClaims = ProvisionerClaims{ globalProvisionerClaims = provisioner.Claims{
MinTLSDur: &Duration{5 * time.Minute}, MinTLSDur: &provisioner.Duration{5 * time.Minute},
MaxTLSDur: &Duration{24 * time.Hour}, MaxTLSDur: &provisioner.Duration{24 * time.Hour},
DefaultTLSDur: &Duration{24 * time.Hour}, DefaultTLSDur: &provisioner.Duration{24 * time.Hour},
DisableRenewal: &defaultDisableRenewal, DisableRenewal: &defaultDisableRenewal,
} }
) )
@ -50,10 +51,10 @@ type Config struct {
// AuthConfig represents the configuration options for the authority. // AuthConfig represents the configuration options for the authority.
type AuthConfig struct { type AuthConfig struct {
Provisioners []*Provisioner `json:"provisioners,omitempty"` Provisioners []*provisioner.Provisioner `json:"provisioners"`
Template *x509util.ASN1DN `json:"template,omitempty"` Template *x509util.ASN1DN `json:"template,omitempty"`
Claims *ProvisionerClaims `json:"claims,omitempty"` Claims *provisioner.Claims `json:"claims,omitempty"`
DisableIssuedAtCheck bool `json:"disableIssuedAtCheck,omitempty"` DisableIssuedAtCheck bool `json:"disableIssuedAtCheck,omitempty"`
} }
// Validate validates the authority configuration. // Validate validates the authority configuration.