Harden Unified Search results, navigation and thumbnails

Open
#9,068 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Active
Tech stack
php, typescript

Research direction

Start with formatResult() in lib/Search/FileSearchProvider.php, then read the thumbnail path in getThumbnailByFileId() in lib/Controller/FileController.php and the routes in src/router/router.ts. The issue asks for a documented result contract and per-role navigation, which needs a design decision before code. Done means the acceptance criteria hold, with tests for owner, signer, observer and unrelated-user cases.

Written by the indexing model from the issue text.

Description

backend enhancement php

Goal

Return lightweight, privacy-preserving Unified Search entries that navigate correctly for the authenticated participant.

Starting points

  • lib/Search/FileSearchProvider.php::formatResult()
  • lib/Controller/PageController.php
  • lib/Controller/FileController.php::getThumbnailByFileId()
  • src/router/router.ts

Requirements

  • Define the minimal result fields required by Nextcloud Unified Search.
  • Distinguish LibreSign document IDs, Nextcloud node IDs and UUIDs.
  • Avoid exposing the owner's internal filesystem path to unrelated participant accounts.
  • Build navigation URLs appropriate to document type, participant role and signing state.
  • Preserve existing document authorization at destination endpoints.
  • Reuse the existing mimeFallback capability for lightweight PDF search thumbnails.
  • Handle envelopes and documents without an accessible Nextcloud node.
  • Avoid returning sensitive information through result attributes or error messages.
  • Preserve existing full-preview behavior outside search.

Acceptance criteria

  • Authorized owners, signers and observers receive appropriate metadata.
  • Result URLs open the intended authorized workflow.
  • Unrelated users cannot obtain private metadata through search or thumbnail requests.
  • IDs and attributes follow a documented, unambiguous contract.
  • Search thumbnail requests avoid unnecessary PDF preview generation.
  • Missing files and unavailable thumbnails degrade safely.
  • Unit and integration tests cover positive and negative cases.
  • Existing validation and signing behavior remains unchanged.

Implementation guidance

Prefer small changes to the existing provider and controllers.

A dedicated search-result projection is acceptable if it reduces unnecessary entity hydration or filesystem access. Do not introduce a new presentation framework without evidence of need.

Use the authorization behavior established by the participant-visibility work.

Dominant language
PHP
Stars
844
Forks
176
Avg merge
14h 3m
Merged PRs (30d)
344

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LibreSign/libresign

All issues in LibreSign/libresign

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.