Skip to content

[M2.2e4b2] Verify security workflows and preserve throttled retries - #74

Merged
samuelmbabhazi merged 2 commits into
mainfrom
feat/m2.2e4b2-security-browser
Nov 5, 2026
Merged

samuelmbabhazi merged 2 commits into
mainfrom
feat/m2.2e4b2-security-browser

Conversation

@samuelmbabhazi

@samuelmbabhazi samuelmbabhazi commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Task

[M2.2e4b2] Browser acceptance for account security, stacked on #73. No merge requested.

What changed and why

An uncertain token creation followed by HTTP 429 released the original idempotency key. A subsequent retry could create a second token. Preserve that key through rate limiting while enforcing Retry-After and the existing four-minute replay window. A failing unit regression reproduced the key change before the fix; a browser scenario now drops a real committed response, throttles the retry, and verifies one token and an actual server replay.

Extend the isolated Chromium suite with password reset and code reuse rejection; invalidation of other sessions and earlier API tokens; TOTP/recovery login; single-use/replaced recovery codes; token creation and revocation; private-display expiry; concurrent security-write prevention; and late-result suppression after leaving the route. Independent browser contexts verify session rotation against the real backend. Add automated accessibility checks for populated and error states, plus an injection-shaped token name.

The recovery-code grid previously used a viewport breakpoint that squeezed two columns into the narrower tablet content area. Size the columns from the available container width instead. Browser measurements now pass at 320, 390, 768, 1024 and 1440 pixels; sanitized local captures confirm the layout at mobile/tablet/desktop widths.

Validation

  • Six Chromium scenarios pass against HTTPS, real PostgreSQL and TLS SMTP.
  • API/web lint, typecheck and production builds pass; 103 API and 51 Angular unit tests pass.
  • Go tests, buf lint, formatting, diff checks and gitleaks commit hooks pass.
  • API integration: all 84 tests across 19 files pass on disposable PostgreSQL databases.

Security considerations

No backend authorization, throttling, audit or credential policy is weakened. Fault injection operates at the browser transport around actual committed requests; backend services remain real. Browser time advances only to verify temporary-display expiry, without changing server time. Assertions compare booleans/counts or hashes rather than printing private grants, and private fill failures remain opaque. Tests create no traces, HAR files or screenshots. No new dependency.

M2.2e4b is complete. Manual visual/accessibility inspection, independent finish review and design-system documentation remain in M2.2e4c; this PR does not claim full WCAG conformance or completion of M2.2 as a whole. CodeQL remains skipped by the repository workflow; enabled CI checks are reported below.

Checklist

  • M2.2e4b2 criteria covered and PLAN updated
  • Lint, TS tests, Go tests and buf lint pass locally
  • Regression tests exercise the retry bug and recovery-code overflow
  • No new shell invocation or secret exposure path
  • Existing audited command paths exercised without modification
  • Retry semantics and test coverage documented in SPEC/README

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.2e4b1-browser-fixture branch from 2e487b1 to b06200d Compare November 5, 2026 12:42
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.2e4b1-browser-fixture to main November 5, 2026 12:42
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.2e4b2-security-browser branch from 956a49d to 6c8bdfc Compare November 5, 2026 12:42
@samuelmbabhazi
samuelmbabhazi merged commit a4f83bc into main Nov 5, 2026
9 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.2e4b2-security-browser branch November 5, 2026 12:43
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
## Task

M2.2e4c — identity UI finish review and design-system documentation.
Stacked on #74; review this branch against
`feat/m2.2e4b2-security-browser`. Earlier identity PRs remain unmerged.

## What changed

The skip link previously resolved against the HTML base URL: activating
it from password recovery navigated to login and discarded the typed
email. It now focuses and scrolls the current main content without
navigating. Two browser scenarios protect this behavior, keyboard
validation/MFA controls, and token-table keyboard access after resizing.

Enabled inputs/selects use a separate 3.63:1 boundary against white. A
visible, accessible scrolling cue appears whenever the token table
exceeds its container, including the tablet layout; ResizeObserver
tracks both table and container changes and disconnects on teardown.
Structural dividers retain their lighter color.

The implemented interface is recorded in `apps/web/DESIGN.md` and its
design preview sidecar. README and PLAN close the identity UI acceptance
work on this stack; local review captures are ignored.

## Why

Keyboard navigation must preserve work, form controls must be visible,
and narrow screens must communicate hidden token actions. These changes
resolve the two material findings from the independent finish review and
the independently reproduced skip-link regression.

## How it was tested

- Both new Chromium scenarios failed before the fixes and pass
afterward; the full suite passes all 8 scenarios against the production
build, isolated PostgreSQL, HTTPS and local TLS SMTP.
- 103 API and 51 web unit tests pass; workspace lint/typechecks and
API/web builds pass. Go tests, buf lint and 84 PostgreSQL integration
tests passed in this session with unchanged backend/Go/protobuf sources.
- Seven final visual captures cover login/validation at 1440/390px and
account security at 1440/768/390px. The independent reviewer's final
disposition is **ship**, with both listed fixes **resolved**. This
verdict is scoped to the fixes, not a whole-product accessibility
certification.
- GitHub CI passed on `9d4a296`: TypeScript lint/tests/build, Go
lint/tests, generated-code checks, Chromium acceptance,
PostgreSQL/Docker integration, and all enabled security checks. CodeQL
was skipped by the existing workflow. Design documentation YAML/JSON,
token references and links validate; preview snippets were not
independently browser-tested.

## Security considerations

No API, authorization, cookie or persistence contract changes. Browser
fixtures use synthetic accounts and hide private fill arguments in
diagnostics. No credentials, screenshots, traces or HAR files are
committed. Capture-only recovery codes were replaced by an obvious fixed
placeholder before inspection. No new dependencies or shell invocation
in application code. No new domain mutations require audit events.

## Checklist

- [x] Acceptance criteria from `docs/PLAN.md` are met and the task is
ticked
- [x] Lint, TS tests, Go tests and `buf lint` pass
- [x] Tests added for keyboard navigation, validation and narrow
token-table access
- [x] No new shell invocation and no new secret exposure path
- [x] Audit events: no new domain state changes
- [x] Documentation updated; no API or architecture contract changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant