Skip to content

test: add CSRF origin and Referer coverage#318

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
vreabernardo:test/csrf-coverage-296
Jul 24, 2026
Merged

test: add CSRF origin and Referer coverage#318
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
vreabernardo:test/csrf-coverage-296

Conversation

@vreabernardo

Copy link
Copy Markdown
Contributor

Closes #296.

Adds direct coverage for CSRF expected-origin resolution and mutation header validation. The headerless POST case is pinned to the current fail-closed 403 behavior from #316.

Tests:

  • node --test test-dist/test/csrf.test.js: 12 passed, 0 failed.
  • node --experimental-test-coverage --test test-dist/test/csrf.test.js: lib/csrf.ts reached 100% line, branch, and function coverage.
  • npm test: this branch and upstream main both stop before execution on the same 3 existing TypeScript diagnostics in components/nav.tsx.
  • Emitted full suite: branch 467 passed / 1 failed; main 455 passed / 1 failed. Both have the same existing member-cache.test.js configuration failure.
  • npm run typecheck: branch and main both report the same 17 existing errors.
  • npm run lint: branch and main both report the same 8 existing react/no-unescaped-entities errors.
  • npm run check-types: passes on branch and main.
  • npm ci: cannot start because the upstream lockfile omits es-abstract@1.24.2; dependencies were installed with npm install --package-lock=false instead.

@vreabernardo

Copy link
Copy Markdown
Contributor Author

Withdrawing this contribution. Thanks for your time.

@Lakes41 Lakes41 reopened this Jul 24, 2026
@Lakes41
Lakes41 merged commit bc60639 into Adamantine-guild:main Jul 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit test coverage for CSRF origin/referer validation

2 participants