fix: harden auth and investment synchronization
Backend security / security (push) Successful in 8s
Backend verify / verify (push) Successful in 11m9s
Conventional commits / commits (pull_request) Successful in 28s
Backend security / security (pull_request) Successful in 7s
Backend verify / verify (pull_request) Successful in 10m38s

Resolve A01-A10 and C01-C07 from the backend audit.
Preserve auth failures, forced candle reconciliation and forecast freshness.
Validate MOEX responses and nested HTTP errors; remove unused legacy paths.

Verified: 209 unit tests, 262 SQLite e2e tests on Linux, OpenAPI and durability.
Record the remaining macOS native SQLite abort in the audit.
This commit is contained in:
2026-09-27 14:09:05 +03:00
parent 5d3835e796
commit 4796d9d3f0
55 changed files with 1954 additions and 569 deletions
@@ -10,7 +10,6 @@ import {
Req,
UseGuards,
ValidationPipe,
type ValidationError,
} from '@nestjs/common';
import {
ApiAcceptedResponse,
@@ -58,8 +57,8 @@ export class TbankSyncController {
transform: true,
whitelist: true,
forbidNonWhitelisted: true,
exceptionFactory: (message) =>
new BadRequestException({ message: descriptorErrors(message) }),
validationError: { target: false, value: false },
exceptionFactory: (message) => new BadRequestException({ message }),
}),
)
input: unknown,
@@ -75,13 +74,3 @@ export class TbankSyncController {
return this.sync.status(request.user.sub, id);
}
}
function descriptorErrors(
errors: ValidationError[],
prefix = '',
): ValidationError[] {
return errors.flatMap((error) => [
{ ...error, property: `${prefix}${error.property}` },
...descriptorErrors(error.children ?? [], `${prefix}${error.property}/`),
]);
}