mirror of
https://github.com/outbackdingo/certificates.git
synced 2026-01-27 10:18:34 +00:00
Add test case for ACME Revoke to Authority
This commit is contained in:
@@ -360,6 +360,7 @@ func (a *Authority) Revoke(ctx context.Context, revokeOpts *RevokeOptions) error
|
||||
ReasonCode: revokeOpts.ReasonCode,
|
||||
Reason: revokeOpts.Reason,
|
||||
MTLS: revokeOpts.MTLS,
|
||||
ACME: revokeOpts.ACME,
|
||||
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 {
|
||||
tc := f()
|
||||
|
||||
Reference in New Issue
Block a user