Commit Graph
1273 Commits
Author SHA1 Message Date
Dominik Schmidt 2e8fc06b50 Merge pull request #4206 from opencloud-eu/feat/search-geohash-filter-token
feat(search): geohash cells as aggregation filter tokens
2026-12-03 16:19:45 +00:00
Andre Duffeck ecb9fbde41 Merge pull request #4154 from opencloud-eu/fix/tags-listing-aggregation
fix(graph): list tags through a terms aggregation
2026-12-03 16:18:26 +01:00
Dominik Schmidt c09c02e2fb feat(search): geohash cells as aggregation filter tokens 2026-12-03 16:11:19 +01:00
Dominik Schmidt 19e332f579 fix(graph): answer geohash cells without a filter token 2026-12-03 14:45:45 +01:00
Dominik Schmidt b928dc8342 feat(search): geohash aggregation
A geohash_grid aggregation over a geopoint field, requested with
@libre.graph.geohashDefinition {precision}. OpenSearch answers it with
geohash_grid on the geopoint field, bleve folds the doc values of the
geohash sibling field. size limits the buckets to the top cells by count.
2026-12-03 14:45:45 +01:00
Florian Schade f999523c49 Merge pull request #4137 from opencloud-eu/fix/mention-share-jail-id
fix(graph): resolve share jail ids in activity notifications
2026-12-03 11:30:21 +01:00
opencloudeu 3f1d8b01e7 [tx] updated from transifex 2026-12-02 23:16:37 +00:00
opencloudeu 10da3b6701 [tx] updated from transifex 2026-12-01 23:16:26 +00:00
Pascal Bleser 64a44e77ff chore(graph): log the resource and the tags in AssignTags (#4156)
UnassignTags logs with a sublogger that carries the request ID, the
resource ID and the tags of the request, AssignTags still used the
plain service logger. Use the same sublogger in AssignTags, so that the
log lines of both handlers can be found by the same fields.

Also drop the error from the "no permissionset on file" line: err is
always nil there.

Assisted-by: Claude Code:claude-opus-5-5
2026-12-01 12:59:32 +01:00
Dominik Schmidt 97c4288be8 Merge pull request #3211 from opencloud-eu/feat/graph-search-query
feat(search): graph search query endpoint with aggregations
2026-11-27 16:47:18 +01:00
Dominik Schmidt 507ee69b24 fix(graph): list tags through a terms aggregation
The tag listing searched for every tagged resource with an unlimited page and collected the tags from the matches. OpenSearch answers an unlimited page with the first 1000 matches of a space, so tags that only resources beyond those carry were missing from the list. Bleve returned every match with all stored fields to read one of them.

The listing now asks for a terms aggregation on the tags, ordered by key, without matches. The search counts every tagged resource on both engines and cuts the list at the 100 listed tags after merging the spaces, in the same byte order as before. AGG-47 pins that a tag is found whichever match carries it.
2026-11-27 16:01:35 +01:00
Dominik Schmidt 4062029e90 fix(search): leave the result window to the engine
The search held both engines to the first 10000 matches, the default index.max_result_window of OpenSearch. Bleve has no such limit, so a WebDAV report with a limit above 10000 that bleve answered before got a 400.

The window is no longer checked by the service. Bleve answers every page again. OpenSearch refuses a page beyond its window itself, the backend turns that into a bad request instead of an internal error, so a window raised on the index takes effect without a change here. The graph endpoint no longer caps from and size or moreResultsAvailable at 10000.
2026-11-27 15:52:53 +01:00
Dominik Schmidt 6431df692f fix(graph): give a share root among the search hits no parent path
The share root is the root of the mountpoint drive. Described as a child of / there, driveId, path and name led to a folder of the same name inside the share.
2026-11-27 15:52:25 +01:00
Dominik Schmidt aa771d4ec8 fix(graph): look up the user drive by id when the user is unknown
Since #3243 GetUserDrive resolves the {user-id} segment through the
identity backend, so a user that was deleted in an external LDAP or AD
turned into a "not found" error although the personal space still exists.
When the identity backend does not know the user, the given segment is
used for the storage lookup as before.
2026-11-27 15:52:18 +01:00
Dominik Schmidt c40173a5c4 fix(graph): place the parent of a search hit in a share in the mountpoint drive
The path of such a hit is relative to the mountpoint, the driveId pointed to the drive of the owner.
2026-11-27 15:52:04 +01:00
Dominik Schmidt cfe3b17038 fix(search): limit the shape of aggregation requests
At most 16 aggregations and 3 bucket levels per request and 5 requests per query. The bleve collector stops at the bucket limit instead of checking after the walk, and the limit also holds for the result merged across spaces.
2026-11-27 15:51:55 +01:00
Dominik Schmidt f228110fdf feat(search): add aggregation filter tokens
Server-issued aggregationFilterToken on buckets, consumed verbatim via searchRequest.aggregationFilters. The graph layer decodes a filter into its buckets (a term, a range, or an or(...) of them), the proto carries them as AggregationFilter, and the engines match them natively: a key as the exact value of the field, a range from-inclusive and to-exclusive, so a drilldown returns exactly the matches the bucket counted. Filters are validated like aggregations, in both layers. Range tokens use the MS Graph spelling (range(min, 1980), range(2010, max, to="le")). AGG-22 to AGG-33, 36, 38 and 45 in the parity suite.
2026-11-27 15:51:45 +01:00
Dominik Schmidt 1c15b904d7 feat(search): add nested aggregations
Sub-aggregations on both engines: bleve folds child buckets below their parent through the same collector, OpenSearch nests them natively, so a request stays one search per space. The proto gains sub_aggregations on the option and on the bucket; merge, finalize, validation and the bucket limit walk every level, results are positional at every level, a metric has no buckets to nest in. AGG-10 to AGG-15, 20, 35, 40 and 44 in the parity suite, AGG-14 as a known OpenSearch divergence.
2026-11-27 15:51:35 +01:00
Dominik Schmidt 48867e07f1 feat(search): add metric aggregations
sum/min/max/avg over a numeric field: bleve folds the accumulators from doc values, OpenSearch reads them from a stats aggregation, the service layer reduces them to the value of the kind after the cross-space merge. The proto gains MetricDefinition, MetricKind and Metric, which travels as accumulators (sum, count, min, max) so the merge works whatever the kind; value is set after the merge and absent for a metric without a single value. A metric is only valid on a numeric field, and only one of bucketDefinition and metricDefinition at a time. AGG-06, 18 and 21 in the parity suite.
2026-11-27 15:51:25 +01:00
Dominik Schmidt b4ef68114b feat(search): add range aggregations
Numeric and date ranges on both engines: bleve folds them from doc values, OpenSearch uses range and date_range aggregations. The proto gains BucketRange and bucketDefinition.ranges, the aggregation package the range parser (bounds are numbers or RFC3339 dates, one kind per aggregation, anything else is rejected), the kind of an option and the validation of ranges against the field type. Every requested range is answered in request order, an empty one with a count of zero, with no space answering too; size does not cut ranges, keyAsNumber sorts them by their lower bound. Range keys read from..to. AGG-04, 05 and 07 to 09 in the parity suite.
2026-11-27 15:51:16 +01:00
Dominik Schmidt 2df07bfcdc feat(search): add terms aggregations
Term buckets on both engines: bleve folds them from doc values (its facets read numbers as prefix-coded terms), OpenSearch uses terms aggregations. A request gets every bucket, up to 65535 per space (the OpenSearch default for search.max_buckets, held on bleve as well); beyond that it is refused. The proto gains AggregationOption, BucketDefinition (sort, minimum count), AggregationResult and Bucket. The new aggregation package merges the per-space results by position, so several aggregations on one field stay apart, and shapes them per BucketDefinition (minimum count, sort, size). It also validates aggregations against the index mapping (a field the index knows and a client may name, of a type whose values are buckets; the mapping overrides mark the internal fields): the search service relies on it, the graph endpoint asks it first to save the round trip, next to its own checks against the spec, and with the field names of the request so an error reads like the request. A request names a field like the driveItem property, exactly so. A number is keyed as it is, a bool as true or false on both engines, an empty value is no bucket. Pinned in the parity suite as AGG-01 to 03, 17, 34, 37 and 39; the paging rows AGG-41 to 43 pin the first commit through the same matrix machinery, which also shortens long answer lists in the README.
2026-11-27 15:51:07 +01:00
Dominik Schmidt de8a518157 feat(graph): add POST /search/query
MS Graph style search endpoint: searchRequest with KQL queryString, from/size pagination (values outside the spec's bounds are rejected), entityTypes validated to driveItem, hits as driveItems with webUrl, parentReference, remoteItem for shares, the facets and @libre.graph.permissions.actions.allowedValues, which the search service now projects onto the Entity from the same permission set as the WebDAV report. Properties the endpoint does not evaluate yet (aggregations, aggregationFilters, sortProperties) answer 501 instead of being ignored, an unknown $expand answers 400, and a failing search service keeps its status. Hits reuse what the drive item listing has, which moves a little: the thumbnails helper is named for the drive item it fills (setDriveItemThumbnailsByID, it served shares only), the web URL of an id gets a helper (webURLForID), and the facets come out of the proto through one generic mapping.FromProto instead of a copy per facet.
2026-11-27 15:50:43 +01:00
Dominik Schmidt 3abf08b85f feat(search): offset paging with a stable order
The search service takes a `from` offset next to the page size and applies it after the cross-space merge; every space answers the full prefix up to from+size, since an offset cannot be distributed. Pages are stable: both engines and the merge break score ties by id, and OpenSearch counts every match (track_total_hits). No engine pages beyond the first 10000 matches, the OpenSearch result window, so a from and size reaching beyond it are rejected on both engines. `page_size` becomes optional on the wire: absent is the default of 200, 0 asks for no matches, -1 for all; WebDAV and the tags listing set it accordingly, and the WebDAV report's `<oc:offset>`, parsed since the report exists and never read, now pages the merged list. The gRPC wrapper passes the request through and keys its cache by the whole request.
2026-11-27 15:50:35 +01:00
Florian Schade d65aa3270c Merge pull request #4130 from dragonchaser/backport-wp3-793
fix(graph): keep shares visible in sharedWithMe when a resource cannot be statted
2026-11-27 13:40:01 +01:00
Jörn Friedrich Dreyer d6c15b2f5e Merge pull request #4141 from opencloud-eu/fix/audit-legacy-upgrade
[full-ci] fix: audit log follow-ups from the review
2026-11-27 12:20:18 +01:00
Andre Duffeck fd9bb83f78 Merge pull request #3243 from opencloud-eu/fix/graph-get-user-drive-id-or-name
feat(graph): accept user name or id in GetUserDrive
2026-11-27 11:27:19 +01:00
micbar fe15575227 fix(audit): report ignored file settings, audit members added by PATCH
Assisted-by: Claude Code:claude-opus-5-5
2026-11-27 11:20:58 +01:00
Alexander Ackermann 175d5681bc feat(graph): return the creator of a public link
Link permissions now carry their creator as invitation.invitedBy.user,
like user and group shares do.

Fixes #4148

Assisted-by: Claude Code:claude-opus-5-5
2026-11-27 08:24:20 +01:00
micbar 0a36e91f0c fix: audit log follow-ups from the review
Assisted-by: Claude Code:claude-opus-5-5
2026-11-26 17:26:25 +01:00
micbar 8d42270543 refactor(audit): build the audit emitter in one place 2026-11-26 16:52:55 +01:00
micbar c684897e3e feat(graph): audit user, group and role changes
Also records denied space creation and data exports of other users.
2026-11-26 16:52:55 +01:00
Jannik Stehle 737e0ec77d fix(graph): resolve share jail ids in activity notifications
Mentions sent for a file in the share jail were silently dropped, as the recipient can't resolve the sender's received share id.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-26 13:41:34 +01:00
David Walter 37e9c18989 fix(graph): keep shares visible in sharedWithMe when a resource cannot be statted (#12430) 2026-11-26 09:40:31 +01:00
Dominik Schmidt a541fac41d feat(graph): accept user name or id in GetUserDrive
GetUserDrive only resolved the personal drive when the {user-id} path
segment was the user's opaque id; a user name (which GetUser accepts)
returned 404. Resolve the segment through the identity backend first
(skipping the /me/drive self case), so both an id and a name work. Also
add GetUserDrive to the Service interface, consistent with the other
user handlers.
2026-11-25 23:23:36 +01:00
opencloudeu 627c375c03 [tx] updated from transifex 2026-11-20 23:17:33 +00:00
Jörn Friedrich Dreyer 2dc0668893 Merge pull request #4073 from dragonchaser/backport-wp3-778
fix(graph): keep the given expiration time of public links
2026-11-20 09:30:42 +01:00
Alex Ababii 1bf81a7ff1 fix(graph): upd guest share type for driveitems 2026-11-19 16:57:24 +01:00
Alex Ababii b93909a5c7 fix(graph): upd driveItem details to return guest type 2026-11-19 16:57:24 +01:00
Alex Ababii 10e231e13a fix(graph): tmp handle the share type guest on drive items info 2026-11-19 16:57:24 +01:00
Roman Perekhod 436fb35dbb Fix the expiration date response for links 2026-11-19 15:48:14 +01:00
opencloudeu c97aff7230 [tx] updated from transifex 2026-11-18 23:17:11 +00:00
Pascal Bleser e6c2215bab Merge pull request #3891 from pbleser-oc/fix/3889-get-tags-sorted-limit
fix(graph): list the tags in use sorted and cut at a fixed limit
2026-11-18 19:36:03 +01:00
Jörn Friedrich Dreyer c0a334f173 Merge pull request #4032 from opencloud-eu/feat/disable-new-shares
feat(sharing): allow disabling the creation of new shares
2026-11-18 13:33:38 +01:00
Pascal Bleser 7ed534d191 fix(graph): sort the listed tags in byte order
Byte order is the order in which search engines sort keyword values,
e.g. an OpenSearch terms aggregation ordered by key. With the same
order, the search can return just the first tags of every space, and
merging those lists still gives exactly the first tags overall. A
case-insensitive order would need an aggregation on a lowercased copy
of the field, with a mapping change, a reindex and the loss of the
original casing.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-18 11:28:47 +01:00
Pascal Bleser f45248336a fix(graph): list the tags in use sorted and cut at a fixed limit
GetTags collected the tags of all search results into a tags.Tags
object, which is meant for the tags of a single resource: it stops
accepting tags at 100 and puts new tags in front. So when more than 100
distinct tags were in use, the response held an arbitrary 100 of them,
and the order changed with the order of the search results.

Collect the distinct tags, sort them case-insensitively (ties in byte
order), and cut the list at the documented constant maxListedTags (100).
An empty list is still rendered as "value": [].

Fixes #3889

Assisted-by: Claude Code:claude-opus-5-5
2026-11-18 11:01:55 +01:00
Pascal Bleser 5b9e691484 Merge pull request #4017 from pbleser-oc/feat/tag-length-validation
feat(graph): limit the length of tags
2026-11-18 09:36:52 +01:00
Andre Duffeck edacb0e01f Merge pull request #4036 from opencloud-eu/feat/graph-expose-favorites
feat(graph): expose the favorite state on drives and sharedWithMe
2026-11-18 08:45:39 +01:00
Pascal Bleser a359ef7e85 feat(graph): limit the length of tags
Tags could be of any length. Assigning tags through the graph API now
rejects the whole request with 400 if one of the tags is longer than the
maximum, listing the tags that are too long. The length is counted in
characters, after the whitespace around each tag is removed. Tags that
already exist are not affected.

The maximum is 100 characters by default, and can be changed with
OC_MAX_TAG_LENGTH, or turned off with 0. The frontend service announces
it to clients as the graph.tags.max_tag_length capability, so that they
can check tags before sending them. Both services read the same
variable, without a service-specific alias, so that the announced limit
is always the one graph enforces.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-18 00:29:40 +01:00
opencloudeu f35dcd5718 [tx] updated from transifex 2026-11-17 23:17:37 +00:00
Sara Ahmadi 1668aa8b71 Merge pull request #4035 from asaah262/fix/4018-permissions-top-query-option
fix(graph): keep the permissions list query options with $top=0
2026-11-17 16:13:12 +01:00