Skip to content

feat(file-manager): list file metadata by type and permissions - #124

Merged
PANiXiDA merged 16 commits into
developmentfrom
feature/file-metadata-list
Oct 29, 2026
Merged

PANiXiDA merged 16 commits into
developmentfrom
feature/file-metadata-list

Conversation

@PANiXiDA

@PANiXiDA PANiXiDA commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Add GET /api/v1/files to list stored metadata with pagination and sorting. The filter contains optional Type, Search and UserId. Return ID, name, type, upload status, content type and size without inspecting S3.

Keep permission rules in one private FileAccessPolicy.CanRead(type, userId) predicate. Both aggregate and filter checks delegate to it. ApplyReadRestrictions checks the filter and, only after a denial with no supplied owner, retries with the current user's ID. An explicitly supplied owner is never replaced. Type is never supplied automatically or rewritten.

Omitting Type requests both Personal and Avatar files, so CanRead requires permission for the entire selection. An own-only Personal caller with Avatar read permission can omit UserId; the policy supplies the current owner. A caller permitted to read only one file type must select that Type explicitly; otherwise the request returns 403. Personal read.all accepts an optional owner and takes precedence over read.own. Explicit foreign owners with only own permissions return 403. Owner criteria apply only to Personal rows.

Input validation remains in FilesFilterValidator and the query validator, using Core Application 5.4.2 domain-factory validation with paths such as Filter.Type and Filter.UserId. Invalid HTTP filters return 400, missing authentication/user account returns 401 and denied access returns 403.

The handler passes the policy's resulting filter to the read repository. The repository depends only on the read DbContext and uses a private ApplyFilter to build type, Personal owner and name predicates before counting or paging. Preserve Core's soft-delete filter and deterministic Name/ID sorting. Type/name whitespace is handled when applying SQL criteria. The repository performs no policy or permission checks.

Validation:

  • Full solution build passed with zero warnings/errors; formatting verification passed.
  • All 333 FileManager unit, 112 PostgreSQL integration and 83 functional tests passed.
  • All 532 architecture tests passed.
  • Tests verify shared aggregate/filter decisions, full-selection authorization without Type, explicit type access, own-owner retry, foreign owner rejection, all/own precedence, unchanged type/input filters, HTTP validation, SQL paging and existing downloads.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T12:50:13.032840Z 19046db Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@PANiXiDA

Copy link
Copy Markdown
Contributor Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 19046db8cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@panixida-sonarqube

Copy link
Copy Markdown

@PANiXiDA
PANiXiDA merged commit 1c33c6f into development Oct 29, 2026
39 checks passed
@PANiXiDA
PANiXiDA deleted the feature/file-metadata-list branch October 29, 2026 12:55
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.

1 participant