Commit Graph
2738 Commits
Author SHA1 Message Date
Dominik Schmidt 14374c6994 test(acceptance): list public links via the graph api 2026-11-26 10:24:48 +01:00
Viktor Scharf 21123271d3 tests: set the response only in When steps (#4121)
Helpers and Given/Then steps no longer store their response, so a Then
step can't pass on a response left over from an earlier step:
- favorite helpers, used by Given steps too, return the response
- the preview Given/Then steps and the space entry Then steps pass their
  response explicitly instead of storing it
- the rename by file id and set property steps are When steps
- the wopi, trashbin, colon path and revisions cleanup helpers return the
  response to their When steps
2026-11-26 08:47:07 +00:00
Viktor Scharf 32e72ca224 tests: check access of guests and sharees outside of the shared resource (#3771)
* tests: check access of guests and sharees outside of the shared resource

* tests: return responses from helpers and set them only in When steps
2026-11-25 11:28:23 +01:00
Sara Ahmadi 05933a6932 test(auth-app): cover custom labels of app tokens and document the label parameter
Assisted-by: Claude Code:claude-opus-5-5
2026-11-24 15:18:06 +01:00
Pascal Bleser 0b73e9ecf8 Merge pull request #3778 from pbleser-oc/feat/1419-clean-up-file-versions
feat: clean up old revisions according to a cleanup strategy
2026-11-24 12:15:43 +01:00
Pascal Bleser 5b9c898f07 test: log all headers of requests and responses in the acceptance tests (#4105)
HttpLogger assigned each header instead of appending it, so the request
log only showed the last header of each request and response, usually
Date. Format all headers, with all their values and the indentation of
the rest of the log. Mask Authorization and Cookie: the logs are public
in the CI.

Fixes #4104

Assisted-by: Claude Code:claude-opus-5-5
2026-11-24 08:46:32 +01:00
Pascal Bleser 5e8a88a05f feat: 1419: clean up revisions by the time they were created
Follows opencloud-eu/reva#895, which makes the revision cleanup go by
the time a revision was created, recorded by the server, instead of the
modification time of its content, which clients choose with X-OC-Mtime.
"auto" keeps the oldest revision of each slot (#3735).

- The storage-users README explains the new age of a revision.
- The acceptance scenario outline that checked the age as the time the
  content was written is replaced by two scenarios: versions whose
  content is dated 60 and 50 days ago are kept by "30d", and a version
  with content dated 10 years ahead doesn't push out the newest one
  under "1".

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser 1b0a81f39d feat: 1419: refuse to clean up revisions with a file metadata cache local to each process
The revisions cleanup command runs in a process of its own. With a file
metadata cache that each process keeps in its own memory ('memory', the
default, or 'ocmem'), the server doesn't learn about the revisions the
command deletes: a list of versions that is already open, e.g. in the
Versions panel, keeps showing them, and downloading or restoring one of
them fails. A new list is right, as the server lists them from disk.

The command now refuses to run with such a cache. The error says how to
share the cache (STORAGE_USERS_FILEMETADATA_CACHE_STORE=nats-js-kv, not
OC_CACHE_STORE, which sets the cache store of all services) and that
--allow-local-cache runs it anyway. A dry run deletes nothing and runs
with any cache.

The acceptance tests pass --allow-local-cache: their server runs with the
default cache, and they check the versions through the API, which lists
them from disk.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser 9c99eeae36 test: 1419: acceptance tests for the revision cleanup
A new cliCommands feature, cleanupFileVersions.feature, tests the
"storage-users revisions cleanup" command against a running server,
checking the remaining versions through the WebDAV versions API:

- keeping the newest version of every file in all spaces
- a dry run, which deletes nothing
- only a folder within the personal space (--space with --path)
- only a project space (--space)
- the JSON output (--json)
- no strategy while the configured one is disabled: exit code 1
- a timeout: exit code 2, nothing deleted
- a strategy without spaces after its commas ("auto,1"), as the CLI
  wrapper splits commands on spaces
- a folder by its path on disk (--fs-path), posix only
- the configured strategy (STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY),
  which cleans up a file whenever it gets a new version: without
  background workers, and with them, the default
- the configured strategy for uploads with TUS, as the web UI and the
  clients upload
- the age of a version, which is the time its content was written:
  uploads with an older modification time (X-OC-Mtime) make versions
  that "30d" deletes right away, while "1,30d" keeps the newest one
- restoring a version with the strategy "0": the content from before
  the restore is kept, so that the restore can be undone

A second feature, collaborativePosix/cleanupFileVersions.feature, tests
the versions that changes on the POSIX filesystem create, with
STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS: the configured strategy cleans
up a file whenever a change on disk creates a version, with and without
background workers, and the command deletes such versions. The
collaborativePosix suite doesn't run in the CI for now
(https://github.com/opencloud-eu/opencloud/issues/2036), so these
scenarios are ready for when it does again; they pass locally. The
suite gets the FilesVersionsContext, whose steps its existing version
scenarios already use.

New steps: in CliContext, running the command for all spaces, a space,
a path within a space, a path on the POSIX filesystem, or with flags
only; checking the exact exit code; and checking the objects of a JSON
output, which "the command output should contain" can't match as it
contains quotes. In FilesVersionsContext, a number of versions that is
checked until it matches, for the cleanup that runs in the background
after postprocessing. In WebDav, the Given form of an upload with
content and a modification time.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Sara Ahmadi 41112716fe fix: return 404 when creating an app token for an unknown user
Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 16:11:30 +01:00
Alex Ababii 3477784431 fix(test): upd test to reflect changes introduced by updated space admin role 2026-11-20 17:24:48 +01:00
Alex Ababii ee62e17fa3 feat(permissions): bump reva to related pr, upd acceptance tests affected by permissions change 2026-11-20 17:24:48 +01:00
Roman Perekhod 436fb35dbb Fix the expiration date response for links 2026-11-19 15:48:14 +01:00
Jörn Friedrich Dreyer a34dbf89fd test(ocm): adjust the ocm scenarios to the reva fixes
A federated editor share of a folder now carries the permissions of
the Editor role, so the graph API returns a role for it instead of a
list of permission actions. Changing the role of a federated share now
notifies the remote, so the remote user can write to the file after
the sharer upgraded the share to File Editor. Accepting an expired
invitation returns the actual reason, "token not valid", instead of
always claiming the token expired.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-19 13:16:11 +01:00
Jörn Friedrich Dreyer b9dc5cb609 fix(ci): let the openldap image import the test LDIF files (#4057)
The ldap-server step copied our LDIF files to a directory the bitnami
image never reads, so the image created its own default tree. Our
entrypoint override then polled until LDAP answered and imported the
files with ldapadd. That races with the image setup: it answers on a
temporary slapd that gets shut down when setup finishes. In
https://ci.opencloud.rocks/repos/3/pipeline/5531/21 10_base.ldif failed
with "Already exists" and 20_users.ldif was cut off by the slapd
shutdown, so there was no admin user and the multiTenancy server never
became ready.

We now point LDAP_CUSTOM_LDIF_DIR at the LDIF files. The image imports
them during setup, before slapd listens, and skips its default tree.
The override only creates the TLS certificate.

Assisted-by: Claude Code:claude-opus-5-5

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-18 16:48:13 +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
Jörn Friedrich Dreyer e38ca9600c test: align acceptance tests with the bumped reva
The reva bump pulls in three backports that change what the acceptance
tests see:

- moving now also requires the delete permission, so a sharee with the
  Uploader role gets a 403 when moving inside a share
- oc:permissions only contains NV when the user can move, so a file
  shared as File Editor now reports SW instead of SNVW
- shares listed in the share jail root report the share jail root as
  their parent id, so propfindShares.feature:149 passes now

The Uploader rows move from the "can move" outlines to the "cannot
move" outlines. This shifts one scenario in moveSpaces.feature by three
lines, the expected failures lists are updated accordingly.

related: https://github.com/opencloud-eu/reva/pull/1020
related: https://github.com/opencloud-eu/reva/pull/1023
related: https://github.com/opencloud-eu/reva/pull/1024

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-18 11:01:11 +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
Sara Ahmadi ccba4a5e49 fix(graph): keep the permissions list query options with $top=0
Assisted-by: Claude Code:claude-opus-5-5
2026-11-17 13:10:40 +01:00
Pascal Bleser bae276fde6 test(acceptance): fail on responses that are cut off after their headers
When the transfer of a response broke off after its headers, e.g.
because the server aborted it, sendRequestOnce caught the exception and
passed the incomplete response on as if it were complete. Tests then
failed later, and misleadingly, e.g. with a JsonException on the cut-off
body, or passed when they only checked the status code.

Re-throw Guzzle's ResponseTransferException, so that such a test fails
at the request, with the transfer error (e.g. cURL error 18).

Refs #4008

Assisted-by: Claude Code:claude-opus-5-5
2026-11-16 12:01:55 +01:00
Pascal Bleser 5853b9b598 fix(graph): return the drive id in remoteItem.parentReference.driveId
For received shares, remoteItem.parentReference.driveId held the id of
the root item of the drive (<storage>$<space>!<root>) instead of the id
of the drive (<storage>$<space>), unlike all other drive items. Clients
had to cut off the root part themselves to request /drives/{drive-id}.

Use the drive id for user and OCM shares, and expect it in the
acceptance tests of the shared with me listing.

Fixes #3997

Assisted-by: Claude Code:claude-opus-5-5
2026-11-16 09:33:47 +01:00
Viktor Scharf bb2db1de60 test(search): cover trailing NOT operator in invalid KQL patterns (#3982)
* test(search): cover trailing NOT operator in invalid KQL patterns

* skip downloadFile:321 for reva
2026-11-16 08:43:59 +01:00
Viktor Scharf 9c33410bbe test(guest-link): guest session does not override other credentials (#3877)
Requests that carry a guest session cookie together with other
credentials (bearer token, basic auth, public link, signed URL) must be
authenticated with those credentials, or rejected with 401 if they
are invalid, and never fall back to the guest.
2026-11-16 08:28:45 +01:00
Pascal Bleser 8fe28aaae1 Merge pull request #3993 from pbleser-oc/fix/graph-space-image-limit-name
fix(graph): name the space image size limit after space images
2026-11-13 22:52:15 +01:00
Jörn Friedrich Dreyer 0cef1028c1 Merge pull request #3950 from pbleser-oc/fix/graph-idempotent-tag-unassign
fix(graph): succeed when unassigning tags a resource doesn't have
2026-11-13 20:37:35 +01:00
Pascal Bleser 67e210a541 feat(graph): add the v1beta1 endpoints for a single drive
Under /graph/v1beta1, drives could only be listed. Getting, creating,
updating and deleting a single drive was only possible under v1.0,
which returns the permissions of a drive's root with the old role names
instead of the IDs of the unified roles.

Add GET, PATCH and DELETE on /graph/v1beta1/drives/{driveID}, and POST
on /graph/v1beta1/drives. They take the same requests as their v1.0
counterparts. GET, POST and PATCH return the drive in the v1beta1
format, like the v1beta1 list of drives does: with
$expand=root($expand=permissions), the permissions carry the unified
role IDs and grantedToV2. DELETE behaves the same in both versions.

The handlers for getting, creating and updating a drive now take the
API version as a parameter, and the v1.0 and v1beta1 routes call them
with their own version.

The acceptance test helpers for spaces can now use either version of
the Graph API.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 19:14:34 +01:00
Pascal Bleser ad140be6eb fix(graph): name the space image size limit after space images
The variable that sets a lower size limit for space images alone was
named after the service, GRAPH_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE,
which reads like a limit for thumbnails in general. Rename it to
OC_SPACE_IMAGE_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE, and the yaml key
from thumbnails.max_input_image_file_size to
thumbnails.space_image_max_input_image_file_size.

The shared names OC_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE and
THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE are unchanged. Neither renamed
setting has been released yet.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 19:01:53 +01:00
Jörn Friedrich Dreyer 55b5e7db73 Merge pull request #3944 from opencloud-eu/backport-wp2-batch-e
fix(graph): port share permission and link fixes
2026-11-13 18:50:37 +01:00
Jörn Friedrich Dreyer c88d94ea2b Merge pull request #3986 from pbleser-oc/fix/graph-space-image-size
fix(graph): refuse space images too large for a thumbnail
2026-11-13 18:28:35 +01:00
Jörn Friedrich Dreyer 8a56177b82 fix(graph): reject links on the shares space root
Creating a link on the root of the Shares drive was only caught later
by the permission check, and an internal link with the internal role
was not rejected at all. We now answer with a 400 "cannot create link
on shares space root" before even looking at the request body, just
like we do for the personal space root.

The acceptance scenarios now expect the new message for the Shares
drive, and the internal link scenario covers the Shares drive again.

ported from `owncloud/ocis#11543`

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-13 18:18:31 +01:00
Jörn Friedrich Dreyer 4bb1feef67 Merge pull request #3964 from opencloud-eu/backport-wp2-753
fix(graph): apply the role allowlist to permission updates
2026-11-13 18:13:41 +01:00
Jörn Friedrich Dreyer ede21a0ac6 Merge branch 'main' into workpagages
The only conflicts were the reva bump in go.mod, go.sum and vendor.
main moved to reva v2.52.2, workpagages already points to reva main
036856689, which contains v2.52.2, so we keep that and re-vendor.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-13 17:03:53 +01:00
Jörn Friedrich Dreyer a24d49a296 Merge pull request #3839 from opencloud-eu/port-upload-coordinator
feat: switch uploads to the reva upload coordinator
2026-11-13 16:57:58 +01:00
Michael Barz db7ffa7a40 Merge pull request #3899 from asaah262/feat/898-allow-setting-spaceid
feat(graph): allow client-supplied drive IDs when creating spaces
2026-11-13 16:27:29 +01:00
Pascal Bleser 51b92da2e5 fix(graph): refuse space images too large for a thumbnail
A space image is only ever shown as a thumbnail. When a file larger
than the thumbnail generator accepts was set as the image of a space,
the PATCH of the drive succeeded, but no thumbnail could be made of the
file, so the space showed no image and nobody got an error.

Before setting the image, graph now looks up the size of the file, and
refuses a file above the limit with 413 Request Entity Too Large,
without changing the space. The limit is the one of the thumbnail
generator: graph reads it under the same names as the webdav and
thumbnails services (OC_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE and the
older THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE, 50MB by default, empty for
unlimited), so one setting keeps the three in agreement.
GRAPH_THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE sets a lower limit for space
images alone.

The default of 50MB is now one constant, which the graph, webdav and
thumbnails services all use.

Only the file size is checked: the dimension limits of the generator
would need the whole image to be read. The space readme has no limit,
and an empty image id is passed on unchecked, as before.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-13 15:55:12 +01:00
Andre Duffeck f314b17fce Merge pull request #3925 from opencloud-eu/chore/drop-enable-vips
drop the enable_vips build flag
2026-11-13 12:38:28 +01:00
Jörn Friedrich Dreyer 0d969c3179 thumbnails: drop the enable_vips build flag
The thumbnails service now always resizes in pure Go. Deployments that
want more formats, webp output or an attention crop run a real imagor
and point WEBDAV_THUMBNAILS_GENERATOR_URL at it. The built-in service
stays as a minimal fallback that keeps working when imagor or libvips
have to be taken out, for example during a security issue.

Without cgo dependencies the docker images link statically again and no
longer need the vips packages. The vips parity run in CI goes away, the
regular test run already covers the pure Go build.

The preview fixtures of the acceptance tests were rendered by libvips,
so they are regenerated with the pure Go build. Text previews now lose
their left edge: the 640x480 text canvas is filled into a square box
and the pure Go build crops the centre, where libvips' attention crop
kept the left side with the text.

part of https://github.com/opencloud-eu/opencloud/issues/3912

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-12 15:41:35 +01:00
Jörn Friedrich Dreyer 143a35e63d test: expect 403 when the federated share does not permit the upload
The remote instance still sees the share with the role it was created
with, so the upload coordinator refuses the upload there instead of the
owner's instance failing it with 500.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-12 11:11:30 +01:00
Pascal Bleser c3c2a8b99c fix(graph): succeed when unassigning tags a resource doesn't have
Removing a tag that the resource doesn't have failed with 400 and a
message about assigning tags ("no new tags in createtagsrequest or
maximum reached"). The tags of the resource are then already as
requested, so it now succeeds instead, without writing the unchanged
tags back.

The TagsRemoved event is published in that case too, so that the search
index drops tags that it has but the resource doesn't, which could
otherwise only be removed by assigning them first.

A request without any tags is still rejected with 400, now before
looking up the resource.

The log entries of the request now carry the requested resource id and
the tags, and a failure to store the tags logs the status of the
storage. The log message for a failed TagsRemoved event no longer calls
it TagsAdded.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-12 10:24:20 +01:00
Jörn Friedrich Dreyer f1271ef2fe test: drop the blank line padding in updateShareInvitations
The padding kept the scenario line numbers stable but trips the
newline_before_scenario gherlint rule. The three scenarios are the last
ones in the file and nothing refers to their line numbers, so they can
just move up.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-11 15:05:18 +01:00
Jörn Friedrich Dreyer 04ac120dca fix(graph): apply the role allowlist to permission updates
Updating a permission or a space root permission did not check the
roles an administrator enabled with GRAPH_AVAILABLE_ROLES. An invite
with a disabled role was rejected, but the same role could be set by
updating an existing share. We now validate updates against the
allowlist, same as invites.

The three "without enabling it" scenarios now expect a 400. Their
removed lines are padded with blank lines so the line numbers of the
scenarios stay the same.

ported from `owncloud/ocis#12540`. The reva half
(`owncloud/reva#653`) is https://github.com/opencloud-eu/reva/pull/993

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-11 13:32:56 +01:00
Jörn Friedrich Dreyer 9c7ecc1755 Merge pull request #3946 from pbleser-oc/fix/graph-reject-empty-drive-name
fix(graph): reject empty and invisible drive names on update
2026-11-11 13:31:32 +01:00
Sara Ahmadi cb3a906cb6 Merge pull request #3928 from asaah262/feat/899-get-single-sharing-permission
feat(graph): add GET endpoints for single sharing permissions
2026-11-11 12:14:42 +01:00
Jörn Friedrich Dreyer a2c24749a6 Merge branch 'main' into workpagages 2026-11-11 11:54:21 +01:00
Sara Ahmadi 64a1ac8339 feat(graph): add GET endpoints for single sharing permissions
Assisted-by: Claude Code:claude-opus-5-5
2026-11-10 18:18:01 +01:00
Pascal Bleser 0e265282d2 fix(graph): reject empty and invisible drive names on update
Updating a drive with an empty name ("name": "") succeeded and silently
kept the old name, because the name was only validated when it was
non-empty. Validate it whenever the request contains it, so an empty
name is rejected with 400 like on create. A request without a name, or
with "name": null, still leaves the name unchanged.

Space names were trimmed with strings.TrimSpace, which only removes
Unicode whitespace. Invisible formatting characters such as the
zero-width space (U+200B), the word joiner (U+2060) or the byte order
mark (U+FEFF) aren't whitespace, so a name made only of them was
accepted on create and on update, and showed up as an empty name in
every client. Trim these characters from both ends of the name as
well. Inside a name they are still allowed, since some of them are
needed there, e.g. the zero-width joiner in emoji sequences.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-10 17:16:37 +01:00
Christian Richter 25534bb010 test(acceptance): add missing blank line before scenario in sharedByMe.feature 2026-11-10 14:38:07 +01:00
Roman Perekhod 1e9919f9ae fix: Fix space root handling in a graph sharedByMe
The drive item name was derived from the resource path. Space roots
have no path ("."), so e.g. the sharedByMe response reported "." as
the name of a shared project space. Use the name provided by the
storage provider and fall back to the base of the path if it is empty.

Adjust the sharedByMe acceptance scenario for link shares of a
project space accordingly: the space root item now carries the name of
the space.
2026-11-10 14:16:07 +01:00
Sara Ahmadi 5ea6b25e22 feat(graph): allow client-supplied drive IDs when creating spaces 2026-11-10 13:41:51 +01:00
Dominik Schmidt 44ef380168 fix(proxy): allow blob: in media-src for motion and live photo playback 2026-11-04 12:14:54 +01:00