Commit Graph
174 Commits
Author SHA1 Message Date
Dominik Schmidt 359dd2f267 feat(graph): expose the sharer as the owner of a public link drive
The public share mountpoint carries no space owner, so GET /drives/{pub}
came back without one and the drop page had no name to show. The request
runs as the share creator (publicshares auth), so the context user is who
shared the link; fill drive.Owner from it, id and display name, the same
source webdav fills oc:owner-display-name from. Deliberate disclosure to the
anonymous visitor, matching webdav and MS Graph's sharedDriveItem.owner.
2026-09-08 11:21:02 +02:00
Dominik Schmidt b392f43662 feat(graph): tell password-required from wrong-password on public links
A public link stat that fails for the password came back as a generic 401
"Access token is empty", so a client could not tell "show the password
field" from "the password was wrong". The proxy now marks the two cases
(it holds the auth result) and the graph service renders them as distinct
odata codes, publicLinkPasswordRequired and publicLinkPasswordInvalid, the
way webdav distinguishes ERR_MISSING_BASIC_AUTH from ERR_INVALID_CREDENTIALS.

The distinction rides in the body, never a WWW-Authenticate: Basic header,
which would pop the browser's native auth dialog instead of the app's
password field. The shared header/token contract lives in pkg/middleware.
2026-09-08 11:21:02 +02:00
Dominik Schmidt 1e6d2ec168 test(acceptance): pin that writes through the public link surface are rejected
createLink, delete, rename and listing permissions on the beta routes all
fail even for an edit link, and the file survives; measured, no 500s.
2026-09-08 11:21:02 +02:00
Dominik Schmidt 6727cec526 test(acceptance): pin the closed surface around a public link
Drives collection, the owner's personal drive, real drive id addressing, a
foreign link's drive and share type disclosure all answer 401 or omit the
data.
2026-09-08 11:21:02 +02:00
Dominik Schmidt 5b260877dc test(acceptance): pin the upload session authorization on public links
An editable link grants an upload session, a view only link answers 404. The
returned endpoint is not reachable from outside: CreateUploadSession hands
out the internal data server url, for authenticated callers just the same,
so the byte transfer stays with the graph upload work.
2026-09-08 11:21:02 +02:00
Dominik Schmidt a9822a7e24 style: satisfy the gherkin and php linters 2026-09-08 11:21:02 +02:00
Dominik Schmidt f640858427 test(acceptance): pin the item anchored colon path in a public link 2026-09-08 11:21:02 +02:00
Dominik Schmidt d18c1a1edb fix(graph): advertise only what the public link grants
Navigating by id bypasses the publicstorageprovider, so the permission sets
are the owner's: a view-only link advertised delete and upload on items below
the root. Intersect with the link's permissions, the same reduction the
publicstorageprovider applies on its own responses; enforcement was always
intact through the token scope.
2026-09-08 11:21:02 +02:00
Dominik Schmidt aa03c6c742 test(acceptance): list public links via the graph api 2026-09-08 11:21:02 +02:00
Dominik Schmidt 11449b5943 docs(graph): frame colon paths as "encode segments" instead of a raw-colon edge case
Per review discussion: don't document accidental behavior. The contract is
simply "percent-encode each path segment, as MS Graph requires; encode ':'
as %3A" - OpenCloud allows ':' in names (OneDrive forbids it), so it's one
more character in the mandatory encode set, not a special case.

The parser is unchanged (split on ":/", decode once). This only rewrites the
docs (code comment, acceptance feature, PR description) to state the encode
contract, and drops the tests that relied on a raw, unencoded ':' in a file
name - keeping the "%3A" test that reflects the actual contract.
2026-07-01 17:44:31 +02:00
Dominik Schmidt b6a4a66aef refactor(graph): split colon paths on ":/" so colons in names work
Review feedback: split the anchor/path and path/suffix on the structural
delimiter ":/" instead of a bare ":". Since the path and suffix always
start with "/", ":/" is the real delimiter, and a ":" *inside* a file or
directory name (which OpenCloud allows but MS Graph/OneDrive forbid) is
kept as part of the path instead of being mistaken for a separator.

A ":" sitting at a segment boundary (e.g. a name ending in ":") stays
ambiguous and must be percent-encoded as "%3A": the split works on the
literal ":/", so "%3A" is never a delimiter and decodes back to ":". This
is now documented in the code and the acceptance feature.

Tests: colon inside a name (with and without a suffix), the Stat path
carrying the colon, and the "%3A" boundary escape.
2026-07-01 17:44:31 +02:00
Dominik Schmidt 3b42c6250d test(graph): acceptance tests for MS Graph colon-syntax path lookup
Cover the rewrite shapes the middleware handles end-to-end against a
real OpenCloud server: root-anchored, item-anchored, deep paths,
trailing colon, and the "/<path>:/<suffix>" sub-route form. Also
assert that NOT_FOUND and PERMISSION_DENIED both collapse to 404.

The /permissions sub-route is registered only at /v1beta1, and the
v1beta1 GetDriveItem handler is share-jail-only, so the v1beta1
mount of the middleware is exercised through the permissions
scenario, since there is no other v1beta1 endpoint that works for
regular personal-drive items.
2026-07-01 17:44:31 +02:00
Viktor Scharf 627f9a742e api-tests: search for favorites (#2487) 2026-03-18 11:10:09 +01:00
Viktor Scharf e161069317 favorites tests (#2474) 2026-03-16 14:49:17 +01:00
Viktor Scharf 9b62a97857 [full-ci] use graph api in the enforcePasswordPublicLink.feature (#2050)
* use graph api in the enforcePasswordPublicLink.feature

* delete from expected failures file
2025-12-18 14:05:52 +01:00
Viktor Scharf 25246782b2 [full-ci] Enhance getSpaceByName: check local cache before Graph API calls (#1574)
* Enhance getSpaceByName: check local cache before Graph API calls

* Update API endpoint for regular user drives
2025-09-30 13:08:21 +02:00
Viktor Scharf 723340dba6 [full-ci] getting personal space by userId instead of userName (#1553)
* getting personal space by userId instead of userName

* delete geting userId via api call

* add new created user id to user list

* fix after review
2025-09-26 10:51:41 +02:00
Alex 38169e60ae fix: show special roles at the end of the list (#806) 2025-05-10 11:23:01 +02:00
prashant-gurung899 24e9aacfdf run more local api tests in CI
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
2025-03-17 14:25:06 +05:45
Viktor Scharf 0db2145cef fix gherkin lint 2025-03-10 15:10:32 +01:00
Viktor Scharf 9db4693a9e rebranding tests 2025-01-16 17:39:02 +01:00
Jörn Friedrich Dreyer a46fd132bd use OC_ env prefix
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 16:11:11 +01:00
prashant-gurung899 11b5e8ccbc add test to check settings api response
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
2025-01-09 09:52:39 +05:45
Niraj Acharya c98841904d removing without skeleton files string from the user creation steps 2024-12-02 09:12:57 +05:45
Sabin b5d5afcd5c remove old dav path for public share 2024-11-19 14:54:02 +05:45
Prajwol Amatya f31f92a028 update expected failure file 2024-11-19 09:07:45 +05:45
Prajwol Amatya 33a99d6de3 extend webdav tests for old, new and spaces path 2024-11-19 09:07:45 +05:45
Niraj Acharya a780da88d1 running secure viewer role with ocis wrapper instead of running ocis with GRAPH_AVAILABLE_ROLES 2024-10-25 11:55:50 +05:45
Saw-jan f86d137f87 test: make remote.php configurable
test: build dav paths

test: fix paths

test: merge method args

test: add issue tags

test: add new expected failure file

test: merge expected-failure files before running tests
2024-10-21 16:57:58 +05:45
Michael Barz 2c9dab3e7c tests: adapt test expectations 2024-09-13 14:43:13 +02:00
prashant-gurung899 390114f7d6 add test to check activity after language translation
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
2024-08-21 14:43:47 +05:45
Salipa-Gurung 246c4223cd add test to check activities of a folder 2024-08-14 17:38:23 +05:45
Sawjan Gurung 459f1692a1 Merge pull request #9743 from owncloud/test-activities-api-rename
[tests-only] [full-ci] Test for resource(file|folder) rename activity
2024-08-14 09:54:07 +05:45
Jörn Friedrich Dreyer ad62bb1817 Merge pull request #9765 from owncloud/federated-user-roles
allow querying federated sharing roles
2024-08-13 16:49:48 +02:00
Jörn Friedrich Dreyer 99c6b6648e no need to introduce dedicated roles
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-08-13 16:10:19 +02:00
Salipa-Gurung 6fb5c228db added step for checking folder move activity 2024-08-13 17:18:40 +05:45
Salipa-Gurung dbb358b7fb added step for checking folder upload activity 2024-08-13 17:18:40 +05:45
Salipa-Gurung 317bb6cc2f refactor scenario for deletion activity 2024-08-13 17:18:39 +05:45
Salipa-Gurung 571625cb17 add test to check rename activity of file and folder 2024-08-13 17:18:32 +05:45
Salipa-Gurung 6c4c8bdffa refactor test steps 2024-08-13 13:13:58 +05:45
Salipa-Gurung 8f00e9cb60 add test to check move activity of file 2024-08-13 13:10:49 +05:45
Jörn Friedrich Dreyer 966b4e1422 allow querying federated sharing roles
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-08-12 11:29:39 +02:00
Salipa-Gurung a5f861f99e add issue tag 2024-08-12 13:04:26 +05:45
Salipa-Gurung b8665e257d add test for folder deletion activity 2024-08-12 13:04:25 +05:45
Salipa-Gurung e96bac1e25 add test for file deletion activity 2024-08-12 13:04:25 +05:45
Salipa-Gurung 2b5144a97d fix indentation 2024-08-12 13:04:24 +05:45
Saw-jan 878c5f4075 test: ensure share is available before performing actions
test: fix expected-failure lines
2024-07-26 15:19:33 +05:45
Salipa-Gurung 065c4fa027 add test coverage for activities api for a file 2024-07-25 14:51:18 +05:45
pradip 7b8b4faf05 test: add test coverage for roleMangement endpoints 2024-07-23 12:46:16 +05:45
Saw-jan dd8a3eb3d2 tests: add test cases for non-admin actions to admin resources 2024-07-18 17:43:16 +05:45