Skip to content

Commit

Permalink
Make Storage a required field for now (close #291)
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed May 29, 2024
1 parent c1a6da7 commit bd400cc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions zerosslissuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ type ZeroSSLIssuer struct {
// REQUIRED.
APIKey string

// Where to store verification material temporarily.
// All instances in a cluster should have the same
// Storage value to enable distributed verification.
// REQUIRED. (TODO: Make it optional for those not
// operating in a cluster. For now, it's simpler to
// put info in storage whether distributed or not.)
Storage Storage

// How many days the certificate should be valid for.
ValidityDays int

Expand All @@ -54,11 +62,6 @@ type ZeroSSLIssuer struct {
// validation, set this field.
CNAMEValidation *DNSManager

// Where to store verification material temporarily.
// Set this on all instances in a cluster to the same
// value to enable distributed verification.
Storage Storage

// An optional (but highly recommended) logger.
Logger *zap.Logger
}
Expand Down Expand Up @@ -266,6 +269,10 @@ func (iss *ZeroSSLIssuer) Revoke(ctx context.Context, cert CertificateResource,
}

func (iss *ZeroSSLIssuer) getDistributedValidationInfo(ctx context.Context, identifier string) (acme.Challenge, bool, error) {
if iss.Storage == nil {
return acme.Challenge{}, false, nil
}

ds := distributedSolver{
storage: iss.Storage,
storageKeyIssuerPrefix: StorageKeys.Safe(iss.IssuerKey()),
Expand Down

0 comments on commit bd400cc

Please sign in to comment.