forked from TrueCloudLab/certificates
acme/api: Remove unused BackoffChallenge func
The mock has an old func that is no longer used. Remove it.
This commit is contained in:
parent
8556d45c3f
commit
794725bcc3
1 changed files with 1 additions and 13 deletions
|
@ -41,7 +41,6 @@ type mockAcmeAuthority struct {
|
|||
updateAccount func(provisioner.Interface, string, []string) (*acme.Account, error)
|
||||
useNonce func(string) error
|
||||
validateChallenge func(p provisioner.Interface, accID string, id string, jwk *jose.JSONWebKey) (*acme.Challenge, error)
|
||||
backoffChallenge func(p provisioner.Interface, accID, chID string, jwk *jose.JSONWebKey) (time.Duration, error)
|
||||
ret1 interface{}
|
||||
err error
|
||||
}
|
||||
|
@ -204,17 +203,6 @@ func (m *mockAcmeAuthority) ValidateChallenge(p provisioner.Interface, accID str
|
|||
}
|
||||
}
|
||||
|
||||
func (m *mockAcmeAuthority) BackoffChallenge(p provisioner.Interface, accID, chID string, jwk *jose.JSONWebKey) (time.Duration, error) {
|
||||
switch {
|
||||
case m.backoffChallenge != nil:
|
||||
return m.backoffChallenge(p, accID, chID, jwk)
|
||||
case m.err != nil:
|
||||
return -1, m.err
|
||||
default:
|
||||
return m.ret1.(time.Duration), m.err
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandlerGetNonce(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
@ -807,7 +795,7 @@ func TestHandlerGetChallenge(t *testing.T) {
|
|||
case "processing":
|
||||
assert.Equals(t, res.Header["Cache-Control"], []string{"no-cache"})
|
||||
assert.Equals(t, res.Header["Retry-After"], []string{tc.ch.RetryAfter})
|
||||
case "valid":
|
||||
case "valid", "invalid":
|
||||
assert.Equals(t, res.Header["Location"], []string{url})
|
||||
assert.Equals(t, res.Header["Link"], []string{fmt.Sprintf("<https://ca.smallstep.com/acme/authz/%s>;rel=\"up\"", tc.ch.AuthzID)})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue