test: add integration test for invalid JWT signature rejection - #200
Merged
chizzy192 merged 1 commit intoJul 30, 2026
Conversation
|
@Victorjonah-prog Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added an integration test that verifies GET /api/v1/auth/me rejects JWTs signed with an invalid secret key and returns 401 Unauthorized with the expected error body. This confirms the auth middleware correctly rejects forged JWT signatures.
Closes #169
Type of Change
🐛 Bug fix (non-breaking change which fixes an issue)
✨ New feature (non-breaking change which adds functionality)
💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
📝 Documentation update
🎨 UI/UX improvement
♻️ Code refactoring
✅ Test addition or update
🔧 Configuration change
Checklist
All GitHub Actions workflows are green on this PR (required for merge)
Commit messages follow Conventional Commits (feat:, fix:, chore:, etc.) — enforced by CI
No secrets, API keys, .env, or credentials committed (see CONTRIBUTING.md)
My code follows the code style of this project
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation
My changes generate no new warnings
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
Any dependent changes have been merged and published
Testing
How to Test
Checkout the branch feat/auth-jwt-invalid-signature-validation
Run the targeted integration test:
Confirm the test passes successfully.
Test Coverage
Unit tests added/updated
Integration tests added/updated
E2E tests added/updated (if applicable)
Manual testing completed
Screenshots (if applicable)
Additional Notes
The new test uses a forged JWT signed with "invalid-secret-key" and asserts that the auth middleware returns the expected 401 response and JSON error message.
For Reviewers
Code quality and readability
Test coverage
Security implications
Performance impact
Breaking changes