feat(share): add paginated share-review source API - #64116
Draft
AndyScherzinger wants to merge 1 commit into
Draft
feat(share): add paginated share-review source API#64116AndyScherzinger wants to merge 1 commit into
AndyScherzinger wants to merge 1 commit into
Conversation
AndyScherzinger
force-pushed
the
feat/share-review-paginated-source
branch
from
September 8, 2026 12:23
c88ebd2 to
15f9605
Compare
Add IPaginatedShareReviewSource, extending IShareReviewSource with page-wise listing (queryShares), counts (countShares, countSharesByType), a keyed getShare() lookup and a localized getDisplayName(), so review apps stay usable on instances with very many shares. The query contract (ShareReviewQuery/ShareReviewCounts/ShareReviewPage) fixes sortable, searchable and filterable fields identically for every source. Ship the optional IShareReviewSourceRemediation and IShareReviewSourceSnapshot capability interfaces and extend ShareReviewAccessCheckEvent with an action, acting user and scope, all additively — the 34.0.2 API is released and stays untouched. Assisted-by: Claude Code:claude-opus-5 Assisted-by: Claude Code:claude-fable-5-1 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger
force-pushed
the
feat/share-review-paginated-source
branch
from
September 8, 2026 16:55
15f9605 to
6e1ddfd
Compare
Member
Author
|
/backport to stable35 |
4 tasks
Member
Author
|
Docs for this API: nextcloud/documentation#15592 (draft, kept in sync with this PR until both are merged). |
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.
To put the LoC in context:
lib/public(the API itself)testsSummary
Extends the share-review API added in #61543 so that a review app can page through a source's shares instead of asking for all of them.
IShareReviewSource::getShares()returns everything at once, which stops being usable on instances with many shares; the review UI had to guard itself with a row limit.Everything here is additive — the 34.0.2 interface, entry and event are unchanged, and a source that implements only the old interface keeps working.
New in
OCP\Share\ShareReview:IPaginatedShareReviewSource(extendsIShareReviewSource):queryShares()for one page,countShares()andcountSharesByType()andcountSharesByInitiator()for counts without rows,getShare()for a keyed lookup (replacing "list everything to find one share"),getDisplayName()for a localized tab label —getName()stays the stable, non-translated source id, and its docblock now says so.ShareReviewQuery/ShareReviewCounts/ShareReviewPage: the query contract — pagination, a whitelisted sort field, one substring search, and filters for share type, password, expiration range, modification range, scoped identity substrings, exact initiator/recipient/token id lists and opaque permission ids. The contract is fixed and identical for every source, so a review app can offer the same table controls on every tab. Sources evaluate it in SQL; the docblocks state the rules a source must honour (secondary sort on the primary key, NULLs last, LIKE escaping, exact token matching, empty list matches nothing).ShareReviewActionContext: carries the acting user and the scope (operator or self) from the review app into the owning app, which forwards both into the access-check event verbatim. Needed for a personal self-audit view and for background jobs acting on behalf of a user.IShareReviewSourceRemediationandIShareReviewSourceSnapshot: optional capabilities, discovered viainstanceof, for remediating a share (password, expiration) instead of revoking it, and for serializing a share before deletion so a review app can offer a recycle bin. No source is forced to grow beyondIShareReviewSource.ShareReviewAccessCheckEvent: gains an action (delete/remediate/restore), the acting user and the scope, all optional, with the default reproducing the 34.0.2 behaviour. The docblock documents who dispatches each action, what a listener must verify per scope, and how a listener written against 34.0.2 behaves.The API is deliberately complete for the features planned on top of it (remediation, recycle bin, dashboard aggregates, personal self-audit view, rules engine), because an interface cannot gain methods after its first release without breaking implementations.
Implementations exist and are tested against this branch, and their pull requests follow once this is merged: Files (in the share-review app), Forms, Deck and Tables.
Docs for the v2 contract: nextcloud/documentation#15592 (draft, kept in sync with this PR until both are merged).
TODO
stable35once this lands, with@sinceretagged to the release it ships inChecklist
3. to review, feature component)stable32)AI (if applicable)