diff --git a/acme/common.go b/acme/common.go index 91cf772b..4f69f1dd 100644 --- a/acme/common.go +++ b/acme/common.go @@ -112,9 +112,13 @@ type MockProvisioner struct { MauthorizeOrderIdentifier func(ctx context.Context, identifier provisioner.ACMEIdentifier) error MauthorizeSign func(ctx context.Context, ott string) ([]provisioner.SignOption, error) MauthorizeRevoke func(ctx context.Context, token string) error +<<<<<<< HEAD MisChallengeEnabled func(ctx context.Context, challenge provisioner.ACMEChallenge) bool MisAttFormatEnabled func(ctx context.Context, format provisioner.ACMEAttestationFormat) bool MgetAttestationRoots func() (*x509.CertPool, bool) +======= + MauthorizeChallenge func(Ctx context.Context, challenge string) error +>>>>>>> 0f84b333 (Add acme property to enable challenges) MdefaultTLSCertDuration func() time.Duration MgetOptions func() *provisioner.Options } @@ -151,6 +155,7 @@ func (m *MockProvisioner) AuthorizeRevoke(ctx context.Context, token string) err return m.Merr } +<<<<<<< HEAD // IsChallengeEnabled mock func (m *MockProvisioner) IsChallengeEnabled(ctx context.Context, challenge provisioner.ACMEChallenge) bool { if m.MisChallengeEnabled != nil { @@ -172,6 +177,14 @@ func (m *MockProvisioner) GetAttestationRoots() (*x509.CertPool, bool) { return m.MgetAttestationRoots() } return m.Mret1.(*x509.CertPool), m.Mret1 != nil +======= +// AuthorizeChallenge mock +func (m *MockProvisioner) AuthorizeChallenge(ctx context.Context, challenge string) error { + if m.MauthorizeChallenge != nil { + return m.MauthorizeChallenge(ctx, challenge) + } + return m.Merr +>>>>>>> 0f84b333 (Add acme property to enable challenges) } // DefaultTLSCertDuration mock diff --git a/acme/order.go b/acme/order.go index a47eb1b0..2eddad53 100644 --- a/acme/order.go +++ b/acme/order.go @@ -1,4 +1,4 @@ -cpackage acme +package acme import ( "bytes" diff --git a/authority/provisioner/acme.go b/authority/provisioner/acme.go index a8741a05..5955ac6a 100644 --- a/authority/provisioner/acme.go +++ b/authority/provisioner/acme.go @@ -217,6 +217,7 @@ type ACMEIdentifier struct { // AuthorizeOrderIdentifier verifies the provisioner is allowed to issue a // certificate for an ACME Order Identifier. func (p *ACME) AuthorizeOrderIdentifier(ctx context.Context, identifier ACMEIdentifier) error { + x509Policy := p.ctl.getPolicy().getX509() // identifier is allowed if no policy is configured diff --git a/authority/provisioners.go b/authority/provisioners.go index 60382b21..dcf8de36 100644 --- a/authority/provisioners.go +++ b/authority/provisioners.go @@ -145,6 +145,7 @@ func (a *Authority) generateProvisionerConfig(ctx context.Context) (provisioner. AuthorizeRenewFunc: a.authorizeRenewFunc, AuthorizeSSHRenewFunc: a.authorizeSSHRenewFunc, }, nil + } // StoreProvisioner stores a provisioner to the authority. @@ -529,7 +530,6 @@ func durationsToLinkedca(d *provisioner.Duration) string { // certifictes claims type. func claimsToCertificates(c *linkedca.Claims) (*provisioner.Claims, error) { if c == nil { - //nolint:nilnil // legacy return nil, nil }