Skip to content

Commit

Permalink
Merge pull request #1831 from smallstep/mariano/err-not-found
Browse files Browse the repository at this point in the history
Use always acme.IsErrNotFound
  • Loading branch information
maraino authored May 7, 2024
2 parents cca6f6d + b1e31b1 commit a2f2332
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion acme/api/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func extractJWK(next nextHTTP) nextHTTP {
// Get Account OR continue to generate a new one OR continue Revoke with certificate private key
acc, err := db.GetAccountByKeyID(ctx, jwk.KeyID)
switch {
case errors.Is(err, acme.ErrNotFound):
case acme.IsErrNotFound(err):
// For NewAccount and Revoke requests ...
break
case err != nil:
Expand Down
3 changes: 1 addition & 2 deletions authority/admin/api/middleware.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package api

import (
"errors"
"net/http"

"github.com/go-chi/chi/v5"
Expand Down Expand Up @@ -125,7 +124,7 @@ func loadExternalAccountKey(next http.HandlerFunc) http.HandlerFunc {
}

if err != nil {
if errors.Is(err, acme.ErrNotFound) {
if acme.IsErrNotFound(err) {
render.Error(w, admin.NewError(admin.ErrorNotFoundType, "ACME External Account Key not found"))
return
}
Expand Down

0 comments on commit a2f2332

Please sign in to comment.