fix backend audit findings (auth, upload, sync, data, ocr, contract)
CI / lint-backend (push) Failing after 1m39s
CI / lint-mobile (push) Canceled after 11m8s
CI / test-backend (push) Canceled after 0s
CI / test-mobile (push) Canceled after 0s
CI / build-backend (push) Canceled after 0s
CI / docker (push) Canceled after 0s

This commit is contained in:
m
2026-09-21 19:59:52 +02:00
parent df7dc76405
commit a6b7f2002b
60 changed files with 3414 additions and 412 deletions
+10
View File
@@ -1,6 +1,7 @@
package repository
import (
"errors"
"testing"
"github.com/kazier/backend/dbtest"
@@ -71,3 +72,12 @@ func TestDevicesMarkUser(t *testing.T) {
t.Errorf("user_id mémorisé = %q, attendu %q", storedUser, userID)
}
}
func TestDevicesMarkUserUnknownDevice(t *testing.T) {
d := newTestDevices(t)
// Device jamais enregistré → ErrNotFound (pas de UPDATE silencieux à
// 0 ligne) : le login mappe ce cas en 401 au lieu d'émettre un token.
if err := d.MarkUser(NewID(), NewID()); !errors.Is(err, ErrNotFound) {
t.Errorf("MarkUser device inconnu: attendu ErrNotFound, got %v", err)
}
}