Feat/security audit infinite scroll csp#334
Open
Emeka-12 wants to merge 5 commits intorinafcode:mainfrom
Open
Conversation
… with virtual scroll
…nfinite-scroll-csp # Conflicts: # package-lock.json # src/app/api/admin/feature-flags/[id]/route.ts
|
@Emeka-12 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! 🚀 |
Contributor
|
Kindly resolve conflict |
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.
PR: Security Headers, Audit Trail, Infinite Scroll & Content Security Policy
Closes #252 — Security Headers
src/middleware/security.tswithbuildSecurityHeaders/applySecurityHeadersutilitiessrc/middleware.ts:X-Frame-Options: DENY,X-Content-Type-Options: nosniff,Referrer-Policy,Permissions-Policy,HSTS(HTTPS only),Report-To,NELnext.config.tsPOST /api/security/reportingendpoint accepts NEL / Report-To violation reportsCommit:
feat(security): add baseline security headers and reporting endpointCloses #256 — Audit Trail Logging
src/lib/audit/— typedAuditLogEntryschema, in-memory store (capped at 5,000 entries), full-text + filtered query helpersrc/middleware/audit.ts—logAuditMutation()helper records actor, IP, path, method, status, and metadataGET /api/admin/audit— searchable, paginated query endpointsrc/pages/admin/audit.tsx— admin viewer with summary cards and filterable tableCommit:
feat(audit): add audit trail logging middleware, store, API, and admin viewerCloses #257 — Infinite Scroll Implementation
src/hooks/useInfiniteScroll.ts—IntersectionObserver-based hook with loading state, error capture, and manualloadMorefallbacksrc/components/InfiniteList.tsx— generic<InfiniteList<T>>combiningreact-windowFixedSizeList+react-virtualized-auto-sizerwith the hook; includes loading spinner, "Load more" button, and error/retry UIhasNextPageis falseCommit:
feat(ui): implement useInfiniteScroll hook and InfiniteList component with virtual scrollCloses #259 — Content Security Policy
src/middleware/csp.ts— per-request nonce viacrypto.getRandomValues, strict policy:default-src 'self', nonce-gatedscript-src/style-src,object-src 'none',frame-ancestors 'none',report-uri /api/security/reporting,upgrade-insecure-requestssrc/middleware.ts— both apply on every responseX-Nonceresponse header set for server components to readunsafe-inlinein strict mode,frame-ancestors none,report-uripresent,object-src noneCloses #256