Return 404 when deleting non-existing API key (#33346)

The server needs to return a HTTP 404 (Not Found) when an API key that does not exist is deleted.
This commit is contained in:
Christian Haudum
2021-04-28 13:30:09 +02:00
committed by GitHub
parent 1336a57e99
commit 076e2ce06a
4 changed files with 43 additions and 14 deletions
+6 -3
View File
@@ -5,9 +5,12 @@ import (
"time"
)
var ErrInvalidApiKey = errors.New("invalid API key")
var ErrInvalidApiKeyExpiration = errors.New("negative value for SecondsToLive")
var ErrDuplicateApiKey = errors.New("API key, organization ID and name must be unique")
var (
ErrApiKeyNotFound = errors.New("API key not found")
ErrInvalidApiKey = errors.New("invalid API key")
ErrInvalidApiKeyExpiration = errors.New("negative value for SecondsToLive")
ErrDuplicateApiKey = errors.New("API key, organization ID and name must be unique")
)
type ApiKey struct {
Id int64