Skip to content

Auth timing/enumeration hardening, admin ledger pagination, helmet, auth docs - #2046

Merged
yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
RennyThompson:feature/rennythompson-auth-and-admin
Oct 17, 2026
Merged

yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
RennyThompson:feature/rennythompson-auth-and-admin

Conversation

@RennyThompson

Copy link
Copy Markdown
Contributor

Summary

Closes #1964
Closes #1963
Closes #1962
Closes #1961

…olled headers (DistinctCodes#1964, DistinctCodes#1963, DistinctCodes#1962, DistinctCodes#1961)

auth: run a bcrypt comparison against a generated cost-12 dummy hash when the login email is unknown, so a miss costs the same as a known address with a wrong password and no longer leaks registration status by timing. Registration keeps its 409 by decision (an identical response needs an email-verification flow this codebase lacks yet); the rationale is documented in code and docs. (DistinctCodes#1964)

docs: add backend/src/auth/README.md covering token lifetime, cookie vs bearer, the SameSite=Strict CSRF stance, role semantics (RolesGuard any-of), websocket handshake auth and the admin bootstrap procedure, with a sequence diagram; link it from the root README. (DistinctCodes#1963)

credits: paginate GET /credits/admin/accounts with an opaque (createdAt, id) cursor and a hard 200-row cap, and replace the in-memory xlsx export with ExcelJS's streaming writer walking pages, capped at 100k rows. Limits documented in Swagger. (DistinctCodes#1962)

main: replace the hand-rolled security-headers block with explicitly configured helmet(), relaxing the CSP only for /api/docs, and disable x-powered-by. Adds helmet to dependencies. (DistinctCodes#1961)

Closes DistinctCodes#1964
Closes DistinctCodes#1963
Closes DistinctCodes#1962
Closes DistinctCodes#1961
@vercel

vercel Bot commented Oct 17, 2026

Copy link
Copy Markdown

@RennyThompson is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@RennyThompson 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! 🚀

Learn more about application limits

… hand-rolled headers, request-id handled by RequestContextMiddleware
@yusuftomilola
yusuftomilola merged commit a56ce89 into DistinctCodes:main Oct 17, 2026
1 of 7 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

2 participants