diff --git a/cas/apiv1/services.go b/cas/apiv1/services.go index 767d4994..543b609b 100644 --- a/cas/apiv1/services.go +++ b/cas/apiv1/services.go @@ -59,14 +59,14 @@ func (t Type) String() string { return strings.ToLower(string(t)) } -// ErrNotImplemented is the type of error returned if an operation is not implemented. -type ErrNotImplemented struct { //nolint:errname // ignore error name warning +// NotImplementedError is the type of error returned if an operation is not implemented. +type NotImplementedError struct { //nolint:errname // ignore error name warning Message string } -// ErrNotImplemented implements the error interface. -func (e ErrNotImplemented) Error() string { +// NotImplementedError implements the error interface. +func (e NotImplementedError) Error() string { if e.Message != "" { return e.Message } @@ -75,6 +75,6 @@ func (e ErrNotImplemented) Error() string { // StatusCode implements the StatusCoder interface and returns the HTTP 501 // error. -func (e ErrNotImplemented) StatusCode() int { +func (e NotImplementedError) StatusCode() int { return http.StatusNotImplemented } diff --git a/cas/stepcas/stepcas.go b/cas/stepcas/stepcas.go index f8770923..6c2acc84 100644 --- a/cas/stepcas/stepcas.go +++ b/cas/stepcas/stepcas.go @@ -101,7 +101,7 @@ func (s *StepCAS) CreateCertificate(req *apiv1.CreateCertificateRequest) (*apiv1 // RenewCertificate will always return a non-implemented error as mTLS renewals // are not supported yet. func (s *StepCAS) RenewCertificate(req *apiv1.RenewCertificateRequest) (*apiv1.RenewCertificateResponse, error) { - return nil, apiv1.ErrNotImplemented{Message: "stepCAS does not support mTLS renewals"} + return nil, apiv1.NotImplementedError{Message: "stepCAS does not support mTLS renewals"} } // RevokeCertificate revokes a certificate. diff --git a/cas/vaultcas/vaultcas.go b/cas/vaultcas/vaultcas.go index a5658620..c618a0a0 100644 --- a/cas/vaultcas/vaultcas.go +++ b/cas/vaultcas/vaultcas.go @@ -162,7 +162,7 @@ func (v *VaultCAS) GetCertificateAuthority(req *apiv1.GetCertificateAuthorityReq // RenewCertificate will always return a non-implemented error as renewals // are not supported yet. func (v *VaultCAS) RenewCertificate(req *apiv1.RenewCertificateRequest) (*apiv1.RenewCertificateResponse, error) { - return nil, apiv1.ErrNotImplemented{Message: "vaultCAS does not support renewals"} + return nil, apiv1.NotImplementedError{Message: "vaultCAS does not support renewals"} } // RevokeCertificate revokes a certificate by serial number.