refactor(backend): J3 — remove 3 deprecated unused handlers
Cleanup of dead code marked // DEPRECATED in veza-backend-api/internal/handlers. Each symbol was verified to have zero callers across the codebase before deletion (go build ./... + go vet ./... + go test ./internal/... pass). Deleted: - UploadResponse type (upload.go) — callers use upload.StandardUploadResponse - BindJSON method on CommonHandler (common.go) — callers use BindAndValidateJSON - sendMessage method on *Client (playback_websocket_handler.go) — internal WS broadcast now goes through sendStandardizedMessage Kept as tech debt (still actively used, refactor out of J3 scope): - UploadRequest type (upload.go:23) — used by upload handler, refactor requires migrating to upload.StandardUploadRequest with multipart binding - BroadcastMessage type (playback_websocket_handler.go:53) — still the channel type for legacy playback broadcasts and referenced in tests Also in this day (already committed in parallel): - veza-backend-api/internal/api/handlers/two_factor_handlers.go deletion (had //go:build ignore, zero callers) — bundled into7fa314866by concurrent work on .github/workflows/*.yml seed-v2 investigation: - No Go source for seed-v2 found — it was only a compiled binary already purged in J1 (0e7097ed1). No code action needed. Refs: AUDIT_REPORT.md §8.1, §12 item 1-2
This commit is contained in:
parent
7fa314866e
commit
67f18892af
3 changed files with 0 additions and 48 deletions
|
|
@ -195,19 +195,6 @@ func BuildPaginationDataWithCursor(limit int, total int64, nextCursor, prevCurso
|
|||
}
|
||||
}
|
||||
|
||||
// BindJSON lie les données JSON de la requête à une structure
|
||||
// DEPRECATED: Utiliser BindAndValidateJSON à la place pour une gestion d'erreurs robuste
|
||||
func (h *CommonHandler) BindJSON(c *gin.Context, obj interface{}) error {
|
||||
if err := c.ShouldBindJSON(obj); err != nil {
|
||||
h.logger.Warn("Failed to bind JSON",
|
||||
zap.Error(err),
|
||||
zap.String("request_id", c.GetString("request_id")),
|
||||
)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// BindAndValidateJSON lie et valide les données JSON de la requête de manière robuste
|
||||
// P0: JSON Hardening - Garantit qu'aucune erreur de parsing/validation ne passe silencieusement
|
||||
//
|
||||
|
|
|
|||
|
|
@ -252,27 +252,6 @@ func (c *Client) writePump() {
|
|||
}
|
||||
}
|
||||
|
||||
// sendMessage envoie un message au client (legacy format)
|
||||
// DEPRECATED: Use sendStandardizedMessage instead
|
||||
func (c *Client) sendMessage(msg *BroadcastMessage) {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
data, err := json.Marshal(msg)
|
||||
if err != nil {
|
||||
c.handler.logger.Error("Failed to marshal message",
|
||||
zap.Error(err),
|
||||
zap.String("user_id", c.userID.String()))
|
||||
return
|
||||
}
|
||||
|
||||
select {
|
||||
case c.send <- data:
|
||||
default:
|
||||
close(c.send)
|
||||
}
|
||||
}
|
||||
|
||||
// sendStandardizedMessage envoie un message au client avec format standardisé
|
||||
// INT-014: Standardized WebSocket message format
|
||||
func (c *Client) sendStandardizedMessage(msg *wsmsg.WebSocketMessage) {
|
||||
|
|
|
|||
|
|
@ -29,20 +29,6 @@ type UploadRequest struct {
|
|||
Metadata string `form:"metadata"`
|
||||
}
|
||||
|
||||
// UploadResponse réponse pour upload
|
||||
// DEPRECATED: Use upload.StandardUploadResponse instead
|
||||
// INT-015: Kept for backward compatibility during migration
|
||||
type UploadResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
TrackID uuid.UUID `json:"track_id"`
|
||||
FileName string `json:"file_name"`
|
||||
FileSize int64 `json:"file_size"`
|
||||
FileType string `json:"file_type"`
|
||||
Checksum string `json:"checksum"`
|
||||
Status string `json:"status"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// UploadValidatorInterface définit les méthodes nécessaires pour UploadValidator
|
||||
type UploadValidatorInterface interface {
|
||||
ValidateFile(ctx context.Context, fileHeader *multipart.FileHeader, fileType string) (*services.ValidationResult, error)
|
||||
|
|
|
|||
Loading…
Reference in a new issue