feat: add Kobo device sync support and fix device route protection

- Add Kobo sync handler with markup, bookmark, analytics, and initialization endpoints
- Add Kobo integration tests and Bruno API test collection
- Move device approve/reject routes from public to protected routes
- Enhance test infrastructure with DATABASE_URL support and helper functions
- Fix device GetDevice handler nil pointer handling
- Clean up test reports and session files
This commit is contained in:
2026-01-30 23:58:34 -05:00
parent b49ba7909f
commit a3aa9f67ac
11 changed files with 839 additions and 676 deletions
+6 -2
View File
@@ -273,8 +273,12 @@ func (h *DeviceHandler) ListDevices(c echo.Context) error {
}
func (h *DeviceHandler) GetDevice(c echo.Context) error {
userID := c.Get("user_id").(string)
userUUID, err := uuid.Parse(userID)
userID := c.Get("user_id")
if userID == nil {
return c.JSON(http.StatusUnauthorized, map[string]string{"error": "unauthorized"})
}
userUUID, err := uuid.Parse(userID.(string))
if err != nil {
return c.JSON(http.StatusBadRequest, map[string]string{"error": "invalid user ID"})
}