[Test] Различать auth token-role, expiry и cookie boundaries #61

Closed
opened 2026-10-11 21:43:36 +03:00 by codex-bot · 0 comments
Owner

Problem

Current configured auth tests проверяют valid/absent access и rotation, но не refresh-as-Bearer, ключевые cookie attributes и signed/DB expiry. Production guards присутствуют; существующий auth bypass не заявляется.

Expected Behavior

Тесты application-selected role/expiry/cookie policy падают при потере соответствующего guard, сохраняя real CAS winner proof.

Evidence

Audit date 2026-10-11; 08. ID TQ-007 (token/cookie/expiry arm). Revision 0ad84ff4f0b4712abc7e69dc299856f14af6eadd; Confidence High для coverage gap; Verification status static.
Affected: test/app.e2e-spec.ts:51–90, :161–261; jwt.strategy.ts:13–25; auth.controller.ts:113–137; auth.service.spec.ts:60–148.

Scope

In scope

Несколько distinguishing cases в existing auth HTTP flow с настоящими signed tokens/SQLite session.

Out of scope

Тестирование всего JWT/bcrypt/framework, новый harness, cross-tab protocol, ослабление rotation CAS.

Proposed Approach

На already-successful response assert flags/path/no Domain; настоящий refresh token использовать как Bearer. Signed expired access/refresh и DB-expired session отдельно от отсутствующего token.

Acceptance Criteria

  • Refresh-as-Bearer получает 401 даже при действующей session.
  • Cookie HttpOnly/SameSite/path/host-only и Secure production policy проверены; development exception явно scoped.
  • Signed expired и DB-expired inputs не допускаются; failed refresh не clobber winner cookie.
  • Concurrent real SQLite winner остаётся usable после loser/replay.

Verification

Existing test/sqlite.cjs app.e2e-spec.ts через isolated runner; preserve AuthService unit CAS и frontend auth/client generation tests. HTTP flags proof не выдать за полное browser cookie enforcement.

Dependencies

Нет. UTF-8 fixtures находятся в T08 и не дублируются здесь.

Traceability

Campaign WealthLedger/main#23 . Finding TQ-007. Repository WealthLedger/backend; T09.

<!-- wealthledger-audit:2026-10-11:auth-regression-boundaries --> ## Problem Current configured auth tests проверяют valid/absent access и rotation, но не refresh-as-Bearer, ключевые cookie attributes и signed/DB expiry. Production guards присутствуют; существующий auth bypass не заявляется. ## Expected Behavior Тесты application-selected role/expiry/cookie policy падают при потере соответствующего guard, сохраняя real CAS winner proof. ## Evidence Audit date `2026-10-11`; [08](https://git.personal.ksv741.ru/WealthLedger/main/src/commit/d07fbfabb1295780952a554185989d2d5b5c8349/audits/2026-10-11/reports/08-test-quality-and-effectiveness-report.md). ID TQ-007 (token/cookie/expiry arm). Revision `0ad84ff4f0b4712abc7e69dc299856f14af6eadd`; Confidence High для coverage gap; Verification status static. Affected: [test/app.e2e-spec.ts:51–90](https://git.personal.ksv741.ru/WealthLedger/backend/src/commit/0ad84ff4f0b4712abc7e69dc299856f14af6eadd/test/app.e2e-spec.ts#L51-L90), :161–261; jwt.strategy.ts:13–25; auth.controller.ts:113–137; auth.service.spec.ts:60–148. ## Scope ### In scope Несколько distinguishing cases в existing auth HTTP flow с настоящими signed tokens/SQLite session. ### Out of scope Тестирование всего JWT/bcrypt/framework, новый harness, cross-tab protocol, ослабление rotation CAS. ## Proposed Approach На already-successful response assert flags/path/no Domain; настоящий refresh token использовать как Bearer. Signed expired access/refresh и DB-expired session отдельно от отсутствующего token. ## Acceptance Criteria - [ ] Refresh-as-Bearer получает 401 даже при действующей session. - [ ] Cookie HttpOnly/SameSite/path/host-only и Secure production policy проверены; development exception явно scoped. - [ ] Signed expired и DB-expired inputs не допускаются; failed refresh не clobber winner cookie. - [ ] Concurrent real SQLite winner остаётся usable после loser/replay. ## Verification Existing test/sqlite.cjs app.e2e-spec.ts через isolated runner; preserve AuthService unit CAS и frontend auth/client generation tests. HTTP flags proof не выдать за полное browser cookie enforcement. ## Dependencies Нет. UTF-8 fixtures находятся в T08 и не дублируются здесь. ## Traceability Campaign https://git.personal.ksv741.ru/WealthLedger/main/issues/23 . Finding TQ-007. Repository WealthLedger/backend; T09.
codex-bot added this to the Technical Audit Remediation — 2026-10-11 milestone 2026-10-11 21:43:36 +03:00
codex-bot added the Kind/Testing
Priority
Medium
3
audit/2026-10-11
labels 2026-10-11 21:43:36 +03:00
codex-bot was assigned by hermes-agent 2026-10-12 00:04:23 +03:00
hermes-agent added this to the WealthLedger — Delivery Board project 2026-10-12 00:04:23 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WealthLedger/backend#61