Final production-readiness remediation: trust, routes, contact, KYC, and headers#144
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
11 Skipped Deployments
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Reviewer's GuideHardens production readiness messaging, disables insecure KYC document intake, makes contact submissions durable before email, converts intel/news to a clearly labelled preview, adds service-detail routes, strengthens security headers/CSP, expands sitemap, and marks Community Hub data as fictional/noindex. Sequence diagram for durable contact submission and notificationsequenceDiagram
actor User
participant ContactForm
participant ContactAPI as api_contact_POST
participant DB as db
participant Mail as sendMail
participant Audit as emitAuditLog
User->>ContactForm: Submit contact form
ContactForm->>ContactAPI: POST /api/contact {name,email,message,subject,website}
ContactAPI->>ContactAPI: rateLimit(ipAddress)
ContactAPI->>ContactAPI: zod schema.parse(body)
ContactAPI->>DB: supportBooking.create({ userId, name, email, subject, notes, status })
DB-->>ContactAPI: submission { id }
alt session exists
ContactAPI->>DB: supportTicket.create({ userId, subject, description, status, priority })
DB-->>ContactAPI: ticket { id }
else no session
Note over ContactAPI: ticketId remains null
end
ContactAPI->>Mail: sendMail({ to, replyTo, subject, text })
Mail-->>ContactAPI: { sent | reason | skipped }
ContactAPI->>DB: supportBooking.update({ id, notes })
ContactAPI->>Audit: emitAuditLog({ action: admin_action, resource: contact_message, resourceId: submission.id, metadata })
Audit-->>ContactAPI: ok
ContactAPI-->>ContactForm: 200 OK { ok: true, submissionId, ticketId }
ContactForm-->>User: Show success message
Sequence diagram for fail-closed KYC document intakesequenceDiagram
actor User
participant KYCUploadPage
participant KYCDocAPI as api_kyc_documents_POST
participant Auth as requireSession
User->>KYCUploadPage: Visit /kyc/upload
KYCUploadPage-->>User: Show fail-closed notice (no upload)
User->>KYCUploadPage: Tries to submit (client or scripted)
KYCUploadPage->>KYCDocAPI: POST /api/kyc/documents
KYCDocAPI->>Auth: requireSession()
Auth-->>KYCDocAPI: { ok: true, session }
KYCDocAPI-->>KYCUploadPage: 503 Service Unavailable\n{\n ok: false,\n code: SECURE_DOCUMENT_UPLOAD_NOT_ACTIVE,\n requirements: [\"private object storage\", ...]\n}
KYCUploadPage-->>User: Prevent upload / suggest contact
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The service metadata is now duplicated between the /services listing and the new /services/[slug] detail pages; consider centralizing these definitions so scopes, titles, and requirements don’t drift over time.
- The contact POST now persists enquiries via supportBooking and optionally supportTicket—double-check that your internal/admin tooling surfaces supportBooking records for follow-up, otherwise new public contacts may not be visible to operators.
- The tightened Content Security Policy and X-Frame-Options=DENY are a good hardening step, but it’s worth validating that all current third-party scripts (e.g., Vercel analytics/insights) still function correctly under the new directives, particularly connect-src and frame-src.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The service metadata is now duplicated between the /services listing and the new /services/[slug] detail pages; consider centralizing these definitions so scopes, titles, and requirements don’t drift over time.
- The contact POST now persists enquiries via supportBooking and optionally supportTicket—double-check that your internal/admin tooling surfaces supportBooking records for follow-up, otherwise new public contacts may not be visible to operators.
- The tightened Content Security Policy and X-Frame-Options=DENY are a good hardening step, but it’s worth validating that all current third-party scripts (e.g., Vercel analytics/insights) still function correctly under the new directives, particularly connect-src and frame-src.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
|
Deployment failed with the following error: Learn More: https://vercel.com/geraldhoeven-4141s-projects?upgradeToPro=build-rate-limit |
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.
Purpose
This pull request implements the highest-impact fixes from the final production-readiness review before public business launch.
Changes
/inteland/intel/newsfrom unverified live-feed presentation to clearly labelled preview/source-aggregation experiences.wwwmetadata base.noindex/nofollowuntil real records replace mock data./services/:sluglinks, removing current 404 conversion failures.Important operational effect
Identity and financial document upload remains intentionally unavailable after this change. It must not be re-enabled until a tested private object-storage pipeline is connected.
Verification required
Manual dependencies after merge
Summary by Sourcery
Align public-facing pages, intelligence routes, KYC flows, and service descriptions with a controlled production launch, disable misleading document intake, and harden headers and sitemap for production.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation: