Repository navigation
Conversation
Split the backend/security scope from NTARI-RAND#171. Restore complete Node and Jest test discovery, replace tracked dependency stubs with declared packages, migrate DynamoDB to the v3 document client, and repair routes using removed model APIs. Preserve promise interfaces and conditional error codes. Resolve dependency conflicts against current main and retain compatible patched transitive versions. Validation: clean npm ci; 37 Node tests and 46 Jest tests pass; npm audit reports zero vulnerabilities; git diff --check passes. Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
Mount the auth router before credential middleware and exercise the production server boundary. Cover unauthenticated registration and login, invalid credentials, token use, and protected-route rejection. Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
Contributor
Author
|
Pls hold back on this for now. |
This was referenced Nov 4, 2026
Merge current main, retaining the account, federation, and conversation security repairs. Keep server-level authentication regressions and cover restricted admin access, sanitized directory responses, and rejected browser credentials at federation endpoints. Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
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.
Unauthenticated registration and login currently return
403because the server mounts credential middleware before the auth router. Mount the auth router first and add production-server HTTP regression coverage; other routes still require credentials.The six new cases exercise registration followed by login and authenticated access, incorrect passwords, unknown email addresses, unauthenticated protected-route access, auth-router fallthrough, and invalid bearer tokens. Routes, middleware, bcrypt, and JWT handling remain real; DynamoDB persistence and unrelated background jobs use test doubles.
Dependency: stacked on #179 (
c4dda0f), which repairs the auth handlers' obsolete model APIs and restores real dependency/test discovery. Merge #179 first. The combined diff currently includes that PR; this PR's own changes are confined to commit189390e(backend/server.jsandbackend/__tests__/serverAuth.test.js). Update the branch against upstream after the prerequisite merges.Validation:
403; three protection cases pass.cd backend && npm testpasses 37 Node tests and 52 Jest tests, including all six new cases.git diff --checkpasses.Independent review: both reviewers judged the production-server coverage important and nonredundant; the test specialist rated it 8/10. No high-confidence defect in the two-file change was identified. They inspected source; the local red/green and suite runs above were performed separately.
Deployment limitation: existing bearer-authorized
/usersand/api/admin/usersresponses expose account contact fields, and/api/admin/usersplus/api/admin/keyslack role checks. Public signup lets new visitors obtain bearer tokens, making these existing authorization weaknesses relevant to rollout. Keep this PR draft pending authorization review; passing authentication tests does not establish safe access control. Browser onboarding/session behavior is outside this change.Qlty validation (0.653.0): used the existing quality-gates
.qlty/qlty.tomland ESLint configuration temporarily, since #179/main does not yet contain that configuration.qlty check backend/server.js backend/__tests__/serverAuth.test.js --no-fix --no-progress --no-upgrade-check --summary --print-errorspasses with no issues (ESLint, TruffleHog, TODO/FIXME checks). Matching baseline server check also passes. Fullqlty smells --all --include-tests --sarif --no-upgrade-checkscans of dependency commitc4dda0fand head189390eproduce identical complete SARIF result sets: eight pre-existing frontend complexity/return findings, zero new findings, zero findings in changed files, and no duplication findings. No suppressions, threshold changes, or quality configuration added to this PR.