Repository navigation
feat(public): anonymous front page + discovery endpoint (wiki-v2 #26) - #1
Merged
Merged
Conversation
…scovery (#26) Signed-out visitors now land on a polished public front page instead of a login wall, can discover explicitly-public pages, and get a Log in / Sign up entry. Deny-by-default is preserved: anonymous reads still flow through the existing PDP-restriction-gated share path, and the new discovery endpoint lists only owner-opted (search_indexing), non-restricted, sharing-enabled shares. Server (fork-owned, zero upstream edits): - authz/public-discovery: @public POST /public/pages/list, tenant-scoped via @AuthWorkspace, restriction + isSharingAllowed filtered in SQL (exact pagination), minimal PII-free projection; mounted via AuthzModule. Offline SQL-security lock spec + leakage-vector coverage. Client (features/public + pages/public are fork-owned; 6 documented seams): - RootGate at "/" (signed-in -> /home unchanged; anon -> public landing), PublicShell, hero, discovery list, footer, request-access page, shared Log in / Sign up buttons. - Seams: App.tsx routes; api-client 401 interceptor narrowed for public routes; app-route helpers; top-menu + share-shell signed-out affordance; vite /auth dev proxy. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This was referenced Sep 2, 2026
PMQ9
added a commit
that referenced
this pull request
Sep 8, 2026
…ge, DTO validation, keyset hardening
All four round-justifying (non-blocking Level-3) findings from the 7-lens review, plus overlapping Level-2
robustness folded in while in the same files:
- [Testing L3 / DevOps L3] listByPage: give it opt-in {limit,before} keyset paging (consistent with the
members/ACL reads), and add service-attachment.pg.spec.ts — resolvePage + listByPage now execute on real
Postgres (a raw-sql column/table typo no longer ships green), and the paging keyset walks a shared-ms tie
with no skip / no duplicate.
- [Testing L3] Add dto-validation.spec.ts — the new class-validator DTOs (ContentSearchDto, ContentSortDto,
ContentCursorDto, ContentListDto incl. nested sort) now run through validate(), so dropping a constraint
(@Max/@IsUUID/@IsIn/@IsNotEmpty/@IsISO8601, …) reds a test.
- [Correctness L3] Add a real-Postgres walk for the generalized TIMESTAMP keyset (only title was walked) and
for value='' (null-title) as a mid-walk cursor bound.
- [Security F1 / Correctness #1 / Testing P2] A malformed keyset/cursor timestamp now 400s instead of
500-ing at the ::timestamptz cast: a shared isIsoInstant() guard (rejects Date.parse-lenient-but-PG-invalid
values like '2026') used by parseSubCollectionQuery and the content keyset builder.
- [Correctness #2] A text sort (title/name) now REQUIRES its cursor `value` (400) instead of silently
falling back to a timestamp `updatedAt` and paginating on the wrong boundary.
- [DevOps #3] Bump service-bridge.openapi.json version 1.1.1 → 1.2.0 (additive expansion).
Non-blocking Level ≤2 polish is deferred to a follow-up issue. Verified: nest build, 19 service-bridge suites
(179 tests), 3 real-Postgres pg specs (30 tests), eslint, import-boundary — all green.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
10 tasks done
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.
TL;DR
Fork-side code for wiki-v2 issue #26 (public front page + login/signup for visitors). Adds an anonymous public-content discovery endpoint and the public front-page UI, with zero new upstream edits beyond six documented client seams. The parent PR (cccvu/wiki-v2) bumps the submodule pointer to this branch and runs CI.
What changed
Server (fork-owned —
apps/server/src/authz/public-discovery/, mounted viaAuthzModule)@Public POST /api/public/pages/list— anonymous discovery of explicitly-public pages, tenant-scoped via@AuthWorkspace. One set-based SQL query lists a page iff: asharesrow exists +search_indexing = true(owner opt-in) + no restricted ancestor (recursivepage_accessclosure — the twin ofPagePermissionRepo.hasRestrictedAncestor) + sharing not disabled at workspace/space + not soft-deleted. Cursor pagination,perPageclamped ≤ 50, minimal PII-free projection, fail-closed on error.authz/leakage/vectors.spec.ts.Client (fork-owned —
apps/client/src/features/public/+pages/public/)RootGateat/reuses the shared["currentUser"]query: signed-in →<Navigate to="/home">(unchanged, cached); anonymous → the public landing.PublicShell(skip link + banner + main), hero, value cards, live discovery list (loading/empty/error), footer,PublicAuthButtons, and a request-access page (posts to the platform's gated registration via an isolated axios instance).isPublicRoutePath/loginHrefWithReturnhelpers.Documented upstream client seams (see wiki-v2
UPSTREAM_MODIFICATIONS.md§6–§11)App.tsx(index →RootGate, add/request-access);lib/api-client.ts(401 interceptor narrowed for public routes only — a pure narrowing, authed routes unchanged);lib/app-route.ts(helpers);components/layouts/global/top-menu.tsx+features/share/components/share-shell.tsx(signed-out Log in / Sign up);vite.config.ts(/authdev proxy).Why
Anonymous reads continue to flow through Docmost's existing, already-PDP-restriction-gated
@Publicshare path — the anonymously-viewable set changes by zero. The discovery endpoint is a read-only enumeration of pages that are already public and (viasearch_indexing) already search-engine-indexable. See wiki-v2 issue 26 for the full rationale (Level 1 vs Level 2).How this was tested
pnpm exec jest src/authz— 158 pass (incl. the new discovery + leakage specs).nest build— clean (override signatures intact).apps/client:tsc+vitest run(77) +vite build— all clean.make dev-build): anonymous/renders with no login bounce;POST /api/public/pages/listreturns 200 anonymously; a seededsearch_indexingshare appears, asearch_indexing=falseshare does not, and adding apage_accessrestriction removes it;/homestill bounces anonymous users to/login.Boundary
No undocumented upstream edits: all new code is fork-owned; the six modified upstream client files are documented seams. wiki-v2's
scripts/check-upstream-boundary.shpasses at 11 seams.🤖 Generated with Claude Code