Skip to content

feat(showcase): hardened public read-only API (dedicated endpoint, noise-filter, no generic-route relax) - #536

Merged
samxu01 merged 3 commits into
mainfrom
feat/showcase-backend
Jun 30, 2026
Merged

feat(showcase): hardened public read-only API (dedicated endpoint, noise-filter, no generic-route relax)#536
samxu01 merged 3 commits into
mainfrom
feat/showcase-backend

Conversation

@samxu01

@samxu01 samxu01 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

The launch front-door backend. SECURITY-CRITICAL: the only anonymous read path, hard-gated to pods with Pod.publicRead===true.

  • Dedicated GET /api/showcase/:podId + /:podId/messages (NOT a relaxation of /api/pods or /api/messages — those fail-open for anonymous via if(req.userId), so they stay auth-only). loadPublicPod loads the full pod and returns null unless publicRead===true; same 404 for missing+not-public (no oracle).
  • Whitelisted serializer: username/displayName/profilePicture/isBot (+ agent display identity). NEVER email/memory/persona/skills.
  • Noise-filter (isShowcaseWorthy): drops empty/system/NO_REPLY/heartbeat-housekeeping/runtime-failover/error messages — reuses the live AgentMessageService predicates. The "not full of errors and bs" guarantee at the serialization layer.
  • IP rate-limit first middleware; GET-only. Admin-only toggle (POST /api/admin/pods/:podId/showcase) rejects personal pod types. Pod.publicRead default false.
  • uploads.ts: IP rate-limit on the (pre-existing unauth) artifact GETs; signed-URL flip = follow-up.
  • Tests: anon 200 public / 404 private+missing / noise-filter / no-email / admin toggle / REGRESSION that generic pods+messages+memory still 401 anon.

Content is curated + vetted + adversarially security-reviewed before any pod is flipped public.

🤖 Generated with Claude Code

Adds a dedicated anonymous read surface for ONE admin-flagged pod and nothing
else. New /api/showcase/:podId (+/messages) self-gates on pod.publicRead===true,
returns a whitelisted shape (never email/memory/persona), and runs messages
through a noise-filter (isShowcaseWorthy) that drops empty/system/NO_REPLY/
heartbeat/error/failover turns. IP-rate-limited as the first middleware.

- Pod.publicRead field (Mongo-only, admin-set, default false)
- POST /api/admin/pods/:podId/showcase admin toggle (400s on personal pod types)
- IP rate-limit added to the unauth uploads GET routes (no auth change)
- service test: 200/404 no-oracle, noise-filter, no-email, admin gate, and a
  regression that generic pod/message/memory routes stay 401 for anon

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_019vuFLFHnmJKmMxosHSWA4P
Comment thread backend/routes/admin/pods.ts Fixed
Comment thread backend/routes/admin/pods.ts Fixed
Comment thread backend/routes/admin/pods.ts Fixed
… audit publish toggle (F6), operational warning (F3)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_019vuFLFHnmJKmMxosHSWA4P
…missing-rate-limiting)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_019vuFLFHnmJKmMxosHSWA4P
@samxu01
samxu01 merged commit 887ad08 into main Jun 30, 2026
10 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

Development

Successfully merging this pull request may close these issues.

2 participants