Skip to content

Commit bd400cc

Browse files
committed
Make Storage a required field for now (close #291)
1 parent c1a6da7 commit bd400cc

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

zerosslissuer.go

+12-5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ type ZeroSSLIssuer struct {
3939
// REQUIRED.
4040
APIKey string
4141

42+
// Where to store verification material temporarily.
43+
// All instances in a cluster should have the same
44+
// Storage value to enable distributed verification.
45+
// REQUIRED. (TODO: Make it optional for those not
46+
// operating in a cluster. For now, it's simpler to
47+
// put info in storage whether distributed or not.)
48+
Storage Storage
49+
4250
// How many days the certificate should be valid for.
4351
ValidityDays int
4452

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

57-
// Where to store verification material temporarily.
58-
// Set this on all instances in a cluster to the same
59-
// value to enable distributed verification.
60-
Storage Storage
61-
6265
// An optional (but highly recommended) logger.
6366
Logger *zap.Logger
6467
}
@@ -266,6 +269,10 @@ func (iss *ZeroSSLIssuer) Revoke(ctx context.Context, cert CertificateResource,
266269
}
267270

268271
func (iss *ZeroSSLIssuer) getDistributedValidationInfo(ctx context.Context, identifier string) (acme.Challenge, bool, error) {
272+
if iss.Storage == nil {
273+
return acme.Challenge{}, false, nil
274+
}
275+
269276
ds := distributedSolver{
270277
storage: iss.Storage,
271278
storageKeyIssuerPrefix: StorageKeys.Safe(iss.IssuerKey()),

0 commit comments

Comments
 (0)