Skip to content

fix(security): wire Blaqkenny issues #798 #799 #801 #805 into runtime… - #1067

Closed
Blaqkenny wants to merge 2 commits into
rinafcode:mainfrom
Blaqkenny:fix/security-blaqkenny-runtime-wiring
Closed

fix(security): wire Blaqkenny issues #798 #799 #801 #805 into runtime…#1067
Blaqkenny wants to merge 2 commits into
rinafcode:mainfrom
Blaqkenny:fix/security-blaqkenny-runtime-wiring

Conversation

@Blaqkenny

Copy link
Copy Markdown
Contributor

… call paths

Adds the missing runtime call sites for the four Blaqkenny-assigned security fixes that already shipped their services in PR #957.

Tests: new auth.controller.spec.ts asserts the order of ThreatDetectionService calls in the login flow and that the new endpoints delegate to AuthTokensService. New auto-moderation.service.spec.ts asserts the new moderateContent / classifyContentSafety wrappers correctly invoke ContentSafetyService.

Closes #798,
Closes #799,
Closes #801,
Closes #805.

…fcode#801 rinafcode#805 into runtime call paths

Adds the missing runtime call sites for the four Blaqkenny-assigned security fixes that already shipped their services in PR rinafcode#957.

- Issue rinafcode#798: ThreatDetectionService.analyzeRequest / recordFailure / reset wired into POST /auth/login (per-IP brute-force protection).
- Issue rinafcode#801: forgot-password / reset-password / verify-email endpoints delegate to AuthTokensService; SHA-256-hashed tokens persisted end-to-end (no plaintext reset/verification tokens reach the User row).
- Issue rinafcode#805: ContentSafetyService.scoreContent exposed via AutoModerationService.classifyContentSafety and combined in moderateContent (max of HF + content-safety) so a homoglyph bypass cannot pass either model.

Tests: new auth.controller.spec.ts asserts the order of ThreatDetectionService calls in the login flow and that the new endpoints delegate to AuthTokensService. New auto-moderation.service.spec.ts asserts the new moderateContent / classifyContentSafety wrappers correctly invoke ContentSafetyService.

Closes rinafcode#798, rinafcode#799, rinafcode#801, rinafcode#805.
)

CI lint job failed with 7 errors on PR rinafcode#1067; this commit resolves them:

- Consolidate two '@nestjs/common' import blocks in auth.controller.ts into one (alphabetically sorted). Fixes no-duplicate-imports.
- Combine two '../../test/utils/mock-factories' import lines in auth.controller.spec.ts into one. Fixes no-duplicate-imports.
- prettier auto-format via 'pnpm exec eslint --fix' resolves:
  - multi-line decorator import in auth.controller.ts
  - .fn() placement in mock chains in auth.controller.spec.ts
  - inline 'InvalidTokenException, ResourceNotFoundException' in auth.service.ts

Resolves the CI 'validate / Run lint' failure. Net: 7 errors → 0 errors. The 1 remaining warning (unused isRS256Configured import in auth.service.ts) was pre-existing on main and does not fail CI.
@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Great work done so far!
Kindly resolve conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants