merge(cordis): abort helpers and gold upgrade fixture

Bring Wavelet AbortNotFoundIfMissing/AbortBadRequestOnError, switch OpenFlare handlers to them, and pin the golden upgrade test to v3.5.4 via git archive.
This commit is contained in:
ryan
2026-08-30 18:03:04 +08:00
18 changed files with 177 additions and 79 deletions
@@ -39,7 +39,7 @@ func GetAccessLogOverviewHandler(c *gin.Context) {
Hours: readQueryInt(c, "hours"),
BucketMinutes: readQueryInt(c, "bucket_minutes"),
})
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
c.JSON(http.StatusOK, response.OK(result))
@@ -70,11 +70,11 @@ func GetAccessLogOverviewHandler(c *gin.Context) {
// @Router /api/v1/d/access-logs [get]
func GetAccessLogsHandler(c *gin.Context) {
query, err := readAccessLogQuery(c)
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
logs, err := ListAccessLogs(c.Request.Context(), query)
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
c.JSON(http.StatusOK, response.OK(logs))
@@ -103,12 +103,12 @@ func GetAccessLogsHandler(c *gin.Context) {
// @Router /api/v1/d/access-logs/folds [get]
func GetFoldedAccessLogsHandler(c *gin.Context) {
query, err := readAccessLogQuery(c)
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
query.FoldMinutes = readQueryInt(c, "fold_minutes")
logs, err := ListFoldedAccessLogs(c.Request.Context(), query)
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
c.JSON(http.StatusOK, response.OK(logs))
@@ -149,7 +149,7 @@ func GetFoldedAccessLogIPsHandler(c *gin.Context) {
SortBy: c.Query("sort_by"),
SortOrder: c.Query("sort_order"),
})
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
c.JSON(http.StatusOK, response.OK(result))
@@ -190,7 +190,7 @@ func GetAccessLogIPSummariesHandler(c *gin.Context) {
SortBy: c.Query("sort_by"),
SortOrder: c.Query("sort_order"),
})
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
c.JSON(http.StatusOK, response.OK(result))
@@ -221,7 +221,7 @@ func GetAccessLogIPTrendHandler(c *gin.Context) {
Hours: readQueryInt(c, "hours"),
BucketMinutes: readQueryInt(c, "bucket_minutes"),
})
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
c.JSON(http.StatusOK, response.OK(result))
@@ -250,7 +250,7 @@ func GetAccessLogIPAnalysisHandler(c *gin.Context) {
Host: c.Query("host"),
Hours: readQueryInt(c, "hours"),
})
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
c.JSON(http.StatusOK, response.OK(result))
@@ -276,7 +276,7 @@ func CleanupAccessLogsHandler(c *gin.Context) {
return
}
result, err := CleanupAccessLogs(c.Request.Context(), input)
if apiutil.AbortBadRequestOnError(c, err) {
if response.AbortBadRequestOnError(c, err) {
return
}
c.JSON(http.StatusOK, response.OK(result))