Skip to content

test : added vitest unit tests for requireJwtAuth middleware#1906

Open
tmdeveloper007 wants to merge 1 commit into
gopaljilab:mainfrom
tmdeveloper007:#1901
Open

test : added vitest unit tests for requireJwtAuth middleware#1906
tmdeveloper007 wants to merge 1 commit into
gopaljilab:mainfrom
tmdeveloper007:#1901

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1901.

Summary of What Has Been Done:
Added 6 vitest unit tests for the requireJwtAuth middleware. Tests cover missing Authorization header, non-Bearer schemes, malformed JWTs (no dots), invalid signature, alg=none rejection (SQL_INJECTION_ATTEMPT logging), and non-provider role blocking.

Changes Made:

  • server/middleware/jwtVerification.test.ts (new file)

Impact it Made:

  • Validates strict JWT authentication contract
  • Confirms alg=none bypass is detected and logged as security event
  • All 6 tests pass locally

Note: Please assign this PR to the tmdeveloper007 account.

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the gopaljilab's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the type:security Vulnerability fixes or security-related enhancements. label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:security Vulnerability fixes or security-related enhancements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add vitest unit tests for requireJwtAuth middleware

1 participant