Checkpoint: Ajout du secours de stockage réservé aux PDF de paie chiffrés : lorsque Forge est indisponible en recette, les octets AES-256-GCM sont stockés dans un volume hôte Docker persistant, jamais dans l'image ni la base. Import, réindexation et consultation passent par cette même abstraction, avec test de round-trip sans Forge. Compose transmet la clé AES et monte le volume dédié. Validation complète : 56 tests, TypeScript, build et format YAML.
All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 2m9s
All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 2m9s
This commit is contained in:
@@ -6,7 +6,7 @@ import { createSalaireLiasse, getSalaireLiasseById, getSalaireLiasseByPeriod, re
|
||||
import { decryptPayrollPdf, encryptPayrollPdf } from "./payrollCrypto";
|
||||
import { extractPayrollBulletins, type PayrollExtractionResult } from "./payrollParser";
|
||||
import { extractPayrollPdfText } from "./payrollPdfText";
|
||||
import { storageGetBuffer, storagePut } from "./storage";
|
||||
import { payrollStorageGetBuffer, payrollStoragePut } from "./storage";
|
||||
|
||||
const MAX_PDF_BYTES = 25 * 1024 * 1024;
|
||||
const upload = multer({
|
||||
@@ -82,7 +82,7 @@ export function registerSalairesHttpRoutes(app: Express) {
|
||||
|
||||
try {
|
||||
const encrypted = encryptPayrollPdf(file.buffer);
|
||||
const archive = await storagePut(
|
||||
const archive = await payrollStoragePut(
|
||||
`salaires/${annee}/${String(mois).padStart(2, "0")}/liasse.pdf.enc`,
|
||||
encrypted.ciphertext,
|
||||
"application/octet-stream",
|
||||
@@ -128,7 +128,7 @@ export function registerSalairesHttpRoutes(app: Express) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const ciphertext = await storageGetBuffer(liasse.stockageKey);
|
||||
const ciphertext = await payrollStorageGetBuffer(liasse.stockageKey);
|
||||
const pdf = decryptPayrollPdf({ ciphertext, ivBase64: liasse.ivBase64, authTagBase64: liasse.authTagBase64 });
|
||||
if (!isPdf(pdf)) throw new Error("Invalid decrypted PDF signature");
|
||||
const extraction = extractPayrollBulletins(await extractPayrollPdfText(pdf));
|
||||
@@ -160,7 +160,7 @@ export function registerSalairesHttpRoutes(app: Express) {
|
||||
}
|
||||
|
||||
try {
|
||||
const ciphertext = await storageGetBuffer(liasse.stockageKey);
|
||||
const ciphertext = await payrollStorageGetBuffer(liasse.stockageKey);
|
||||
const pdf = decryptPayrollPdf({
|
||||
ciphertext,
|
||||
ivBase64: liasse.ivBase64,
|
||||
|
||||
Reference in New Issue
Block a user