A scope narrows the whole search to one folder. NOT scope: searched
inside the folder instead of outside it, and OR scope: was treated as
AND. Both are a 400 now.
The service parsed the query once for validation and every engine parsed the
expanded string again per space. Now the service parses once and the engines
compile an AST. The query template is parsed at startup and expanded by
substituting nodes, the indexer's up-to-date check is built as nodes as well.
A page size below -1 from a direct gRPC caller ran into a slice out of range. A bad request an engine answers is the fault of the request, it was logged as an error once per space.
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.
Replicas keep their own statistics and may score a document differently, so consecutive pages of one search could come in a different order from an unchanged index. The user id is the preference of the search request now.
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.
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.
A search scoped to a folder (scope:<id>) restricts the engine query to the path of that folder. The path filter matches the folder itself as well as everything below it, so the folder is a match of its own search whenever it fits the query.
Until now the service dropped it after the engine had answered, by comparing names: a match was removed when "/" + its name equalled the path of the scope. That had three effects:
- The total and the aggregation buckets still counted the folder, so they were one higher than the list of matches.
- It only worked for a scope directly below the space root. With a scope of /a/b the path is never "/" + "b", so the folder b stayed in the results of a search inside b.
- With a scope of /a every match named "a" was removed, also a file or folder of that name further down, which is a legitimate match.
The id of the scope folder is known from the Stat that resolves the scope. It now goes into the engine query as NOT id:"<id>", the same way the default query template already excludes the personal space root, and the name comparison is gone. Matches, total and buckets agree, on every depth, for the WebDAV report and for the graph search.
Example, searching "urlaub" inside /Urlaub, which holds urlaub-2024.jpg and a sub folder Urlaub: before, 1 match (the jpg) and a total of 3. Now, 2 matches (the sub folder and the jpg) and a total of 2.
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.
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.
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.
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.
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.
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.
convert.copyFacet rebuilt every facet by hand on the way into the index; mapping.ToProto is the generic counterpart of the FromProto the graph endpoint uses, so both directions share one bridge.
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.
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.
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
frontend, sharing and storage-users pass the audit settings and the service version to the reva audit emitters. `best_effort` is the only mode for now, any other value stops the service. The frontend keeps the events endpoint the archiver needs for its records.
The proxy builds the audit request context: client address (PROXY_CLIENT_IP_HEADER behind trusted proxies), user agent, auth method, session and OIDC client. A value a client sent in X-Audit-Context is dropped.
A login is recorded once per OIDC session and client, not per access token. Public link access is recorded with the client address, failed attempts every time.
The audit service reads the JetStream stream `audit` and writes every record as one line of JSON to stdout and, if configured, to an OTLP endpoint, with the emitting service in the resource. A record is acknowledged only when all outputs have it, so an output outage keeps the records in the stream, in order and without duplicates. The old audit log stays available with AUDIT_LEGACY_ENABLED.
Adds the OpenTelemetry log packages for the OTLP output.
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.