diff --git a/pkg/api/entries.go b/pkg/api/entries.go index cb1ce510e..c16220389 100644 --- a/pkg/api/entries.go +++ b/pkg/api/entries.go @@ -338,11 +338,11 @@ func SearchLogQueryHandler(params entries.SearchLogQueryParams) middleware.Respo resultPayload = append(resultPayload, logEntry) continue } - uuid, err := sharding.GetUUIDFromIDString(entryID) - if err != nil { - return handleRekorAPIError(params, http.StatusBadRequest, err, fmt.Sprintf("could not get UUID from ID string %v", entryID)) + // At this point, check if we got a uuid instead of an EntryID, so search for the hash later + uuid := entryID + if err := sharding.ValidateUUID(uuid); err != nil { + return handleRekorAPIError(params, http.StatusBadRequest, err, fmt.Sprintf("validating uuid %s", uuid)) } - // If we couldn't get the entry, search for the hash later hash, err := hex.DecodeString(uuid) if err != nil { return handleRekorAPIError(params, http.StatusBadRequest, err, malformedUUID)