"not-found":{"foo",&apiError{errors.New("certificate with fingerprint foo was not found"),http.StatusNotFound,context{}}},
"invalid-stored-certificate":{"invaliddata",&apiError{errors.New("stored value is not a *x509.Certificate"),http.StatusInternalServerError,context{}}},
"not-found":{"foo",&apiError{errors.New("certificate with fingerprint foo was not found"),http.StatusNotFound,apiCtx{}}},
"invalid-stored-certificate":{"invaliddata",&apiError{errors.New("stored value is not a *x509.Certificate"),http.StatusInternalServerError,apiCtx{}}},
err:&apiError{errors.New("sign: invalid extra option type string"),
http.StatusInternalServerError,
context{"csr":csr,"signOptions":signOpts},
apiCtx{"csr":csr,"signOptions":signOpts},
},
}
},
@ -152,7 +154,7 @@ func TestSign(t *testing.T) {
signOpts:signOpts,
err:&apiError{errors.New("sign: default ASN1DN template cannot be nil"),
http.StatusInternalServerError,
context{"csr":csr,"signOptions":signOpts},
apiCtx{"csr":csr,"signOptions":signOpts},
},
}
},
@ -167,7 +169,7 @@ func TestSign(t *testing.T) {
signOpts:signOpts,
err:&apiError{errors.New("sign: error creating new leaf certificate"),
http.StatusInternalServerError,
context{"csr":csr,"signOptions":signOpts},
apiCtx{"csr":csr,"signOptions":signOpts},
},
}
},
@ -184,7 +186,7 @@ func TestSign(t *testing.T) {
signOpts:_signOpts,
err:&apiError{errors.New("sign: requested duration of 25h0m0s is more than the authorized maximum certificate duration of 24h0m0s"),
http.StatusUnauthorized,
context{"csr":csr,"signOptions":_signOpts},
apiCtx{"csr":csr,"signOptions":_signOpts},
},
}
},
@ -199,7 +201,7 @@ func TestSign(t *testing.T) {
signOpts:signOpts,
err:&apiError{errors.New("sign: certificate request does not contain the valid DNS names - got [test.smallstep.com smallstep test], want [test.smallstep.com]"),
http.StatusUnauthorized,
context{"csr":csr,"signOptions":signOpts},
apiCtx{"csr":csr,"signOptions":signOpts},
},
}
},
@ -210,7 +212,7 @@ func TestSign(t *testing.T) {
storeCertificate:func(crt*x509.Certificate)error{
return&apiError{errors.New("force"),
http.StatusInternalServerError,
context{"csr":csr,"signOptions":signOpts}}
apiCtx{"csr":csr,"signOptions":signOpts}}
},
}
return&signTest{
@ -220,7 +222,7 @@ func TestSign(t *testing.T) {
signOpts:signOpts,
err:&apiError{errors.New("sign: error storing certificate in db: force"),
http.StatusInternalServerError,
context{"csr":csr,"signOptions":signOpts},
apiCtx{"csr":csr,"signOptions":signOpts},
},
}
},
@ -373,7 +375,7 @@ func TestRenew(t *testing.T) {
auth:_a,
crt:crt,
err:&apiError{errors.New("error renewing certificate from existing server certificate"),