Add test case for ACME Revoke to Authority

pull/625/head
Herman Slatman 3 years ago
parent 06bb97c91e
commit 47a8a3c463
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

@ -360,6 +360,7 @@ func (a *Authority) Revoke(ctx context.Context, revokeOpts *RevokeOptions) error
ReasonCode: revokeOpts.ReasonCode, ReasonCode: revokeOpts.ReasonCode,
Reason: revokeOpts.Reason, Reason: revokeOpts.Reason,
MTLS: revokeOpts.MTLS, MTLS: revokeOpts.MTLS,
ACME: revokeOpts.ACME,
RevokedAt: time.Now().UTC(), RevokedAt: time.Now().UTC(),
} }

@ -1267,6 +1267,23 @@ func TestAuthority_Revoke(t *testing.T) {
}, },
} }
}, },
"ok/ACME": func() test {
_a := testAuthority(t, WithDatabase(&db.MockAuthDB{}))
crt, err := pemutil.ReadCertificate("./testdata/certs/foo.crt")
assert.FatalError(t, err)
return test{
auth: _a,
opts: &RevokeOptions{
Crt: crt,
Serial: "102012593071130646873265215610956555026",
ReasonCode: reasonCode,
Reason: reason,
ACME: true,
},
}
},
} }
for name, f := range tests { for name, f := range tests {
tc := f() tc := f()

@ -104,6 +104,7 @@ type RevokedCertificateInfo struct {
RevokedAt time.Time RevokedAt time.Time
TokenID string TokenID string
MTLS bool MTLS bool
ACME bool
} }
// IsRevoked returns whether or not a certificate with the given identifier // IsRevoked returns whether or not a certificate with the given identifier

Loading…
Cancel
Save