Commit Graph

419 Commits

Author SHA1 Message Date
Ralf Haferkamp
1ace257064 graph/groups: Allow unprivileged users to search for groups 2023-12-07 10:21:45 +01:00
Ralf Haferkamp
6fab0ad05a graph/users: Fix http status codes for unprivileged requests
Neither 'BadRequest' (as expected in the unit test) nor 'Unauthorized' (as expected
in the API tests) seem correct here. We're no returning 'Forbidden' when an unprivileged
users issues a GetUsers request that it is not allowed to perform.
2023-12-07 10:21:45 +01:00
Ralf Haferkamp
4cb6d99e88 graph/users: Make minimum search term length configurable 2023-12-07 10:21:45 +01:00
Ralf Haferkamp
20870380b1 graph/users: Return 'userType' for request from unprivileged users 2023-12-07 10:21:45 +01:00
Ralf Haferkamp
d0289694e4 graph/users: Add unittests for unprivileged user search 2023-12-07 10:21:45 +01:00
Ralf Haferkamp
795989e0aa graph/users: Use a full substring filter of user search
Previously we only did a prefix match.
2023-12-07 10:21:45 +01:00
Juan Pablo Villafáñez
6226598057 test: fix unit tests 2023-12-07 10:21:45 +01:00
Juan Pablo Villafáñez
d86352dccd feat: list users as regular user 2023-12-07 10:21:45 +01:00
Dominik Schmidt
76753635fd feat(location): add driveItems test 2023-12-06 15:13:09 +01:00
Dominik Schmidt
d9d1e96c82 fix: tests without initialized arbitrary metadata 2023-12-06 15:13:09 +01:00
Dominik Schmidt
4c27b365fa feat(graph): add location facet to driveItems 2023-12-06 15:13:09 +01:00
Michael Barz
1f9c6d44b4 feat: improve expiration date handling 2023-12-06 12:16:14 +01:00
Michael Barz
0b7162204a feat: handle more status codes 2023-12-06 12:16:14 +01:00
Michael Barz
1fd3032f02 style: cleanup code style 2023-12-06 12:16:14 +01:00
Florian Schade
34f3ab66c1 feature: add beta drive listing endpoints to the graph api (#7861)
* feature: add beta drive listing endpoints to the graph api and hydrate them to contain the new grantedtoV2 property and use unified roles instead of the cs3 roles

* enhancement: make use of owner conditions for drive listing

* enhancement: provide GetDrivesV1Beta1 and GetAllDrivesV1Beta1 graph endpoint tests
2023-12-06 10:01:38 +01:00
Artur Neumann
fcd13cf9b8 return only single permission on link creation 2023-12-05 11:15:49 +05:45
Artur Neumann
3f476680a3 return 200 and not 201 when creating sharing link 2023-12-04 17:41:05 +05:45
Christian Richter
fb514c2ff1 allow whitespaces in contains & startsWith Filter
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-12-01 11:28:40 +01:00
Jörn Friedrich Dreyer
d6cb6eeaa3 allow creating an upload session via graph (#7712)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-11-30 17:29:15 +01:00
Ralf Haferkamp
afb127090d graph sharing: delete link permission
Allow to delete link permissions (i.e. Public Shares)
2023-11-30 13:39:26 +01:00
Ralf Haferkamp
9d3523e310 graph/errocode: Rework FromCS3Status
The handling of 'error' has been moved from FromStat() to FromCS3Status().
It's generally useful for other users of FromCS3Status()
2023-11-30 13:39:26 +01:00
Ralf Haferkamp
faf0e242cd graph/errorcode: Map a few more CS3 status codes 2023-11-30 13:39:26 +01:00
Christian Richter
63973d2b26 make user filter contains and startsWith case insensitive
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-30 12:08:13 +01:00
Artur Neumann
eed474bec8 Merge pull request #7851 from owncloud/return200invite
return 200 on successful invite
2023-11-30 14:42:56 +05:45
Artur Neumann
5ceeb5119b return 200 on successfull invite 2023-11-30 10:10:07 +05:45
Ralf Haferkamp
cd704661f2 graph unit test: Use mocked identity backend in utils_test
This avoids running into the WaitForCA waitloop that is running in
with the default (LDAP) identity backend when starting up in a clean
environment.
2023-11-29 17:07:05 +01:00
Florian Schade
ad06a192d8 enhancement: add graph beta listPermissions endpoint (#7753)
* enhancement: add graph beta listPermissions endpoint

besides the new api endpoint it includes several utilities to simplify the graph api development.

* resolve drive and item id from the request path
* generic pointer and value utilities
* space root detection

* update GetDriveAndItemIDParam signature to return a error

* move errorcode package

* enhancement: add generic error code handling

* fix: rebase
2023-11-28 17:06:04 +01:00
Michael Barz
eb6ec1311a chore: update libregraph api again 2023-11-28 14:56:12 +01:00
Michael Barz
ce705bc6c8 style: refactor test code 2023-11-28 14:56:12 +01:00
Michael Barz
2ca74a0e9a fix: incorporate code review 2023-11-28 14:56:12 +01:00
Michael Barz
061bde54b5 test: adapt test expectation 2023-11-28 14:56:12 +01:00
Michael Barz
2991e4a19b fix: fix error code handling 2023-11-28 14:56:12 +01:00
Michael Barz
53f2fd396f test: add more integration tests for create link 2023-11-28 14:56:12 +01:00
Michael Barz
d723ce51f2 test: add unit tests for linktype pkg 2023-11-28 14:56:12 +01:00
Michael Barz
5f70d8a303 test: add integration tests for create link handler 2023-11-28 14:56:12 +01:00
Michael Barz
c035fc80a9 feat(api): add new sharing NG create link feature 2023-11-28 14:56:12 +01:00
Michael Barz
02c6e8f4b8 feat: add new linktpe pkg 2023-11-28 14:56:12 +01:00
Michael Barz
2668ca664a feat: add new error code type 2023-11-28 14:56:12 +01:00
Ralf Haferkamp
4a94388a25 graph: Add delete permission endpoint
Allows the owner to remove permissions of a driveItem (i.e. to delete a
share). For now this does not work for "link" permission (i.e. public
shares)
2023-11-27 16:52:15 +01:00
Florian Schade
170021a38e chore: go version bump to 1.21 2023-11-23 14:52:01 +01:00
Florian Schade
40d356c56b enhancement: make use of unifiedrole from the graph invitation endpoint, applying multiple roles works and result in a merged cs3 permission set (#7751) 2023-11-23 14:18:03 +01:00
Ralf Haferkamp
6ac5ac534d Update wrapper and mocks for go-ldap 3.4.6 2023-11-22 15:12:39 +01:00
Christian Richter
06a66e8aa0 add user filter startsWith and contains
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-20 20:10:39 +01:00
Florian Schade
ad57d59738 enhancement: add graph invite endpoint (#7687) 2023-11-17 16:36:54 +01:00
Ralf Haferkamp
9303cdece7 graph: Set roles/actions in sharedByMe response (#7703)
* unifiedrole: Add CS3ResourcePermissionsToLibregraphActions

Add function to convert CS3ResourcePermsissions to libregraph actions

* unifiedrole: Fix strings for the UnifiedRoleConditionSelf

The "Self/Owner/Grantee" string are not part the the constraint value

* graph: Move getRoleDefinitionList to unifiedrole module

rename it to GetBuiltinRoleDefinitionList and make it public

* graph: turn libregraph resource actions into string constants

* graph/sharedbyme: Set the correct roles (or actions) on permissions

Try to map CS3 resource permissions on a share to one of the default libregraph
UnifiedRoleDefinitions. If a match if found return the roleid in 'permissions.roles'
attribute of the response. If no match if found convert the
ResourcePermissions in to `libre.graph.permissions.actions` and return
those in the response.
2023-11-17 15:41:24 +01:00
Ralf Haferkamp
50f63bf436 bump reva to latest edge (#7727)
* bump reva to latest edge

To get https://github.com/cs3org/reva/pull/4336

* graph: Import unified role related code from reva

The UnifiedRole related types are pretty specific to the graph service.
Maintaining them as part of reva makes things more complex that required.

* chore: add failing cases to the expected failures

---------

Co-authored-by: Florian Schade <f.schade@icloud.com>
2023-11-17 09:18:45 +01:00
Roman Perekhod
a6b75bc9f6 fix libre-graph status codes (#7705)
* fix libre-graph status codes

* owncloud-test-middleware bumped

---------

Co-authored-by: Roman Perekhod <rperekhod@owncloud.com>
2023-11-15 17:45:23 +01:00
Christian Richter
fde6a4b67a [Experiment] Remove language object from GetUser
Co-authored-by: Florian Schade <fschade@owncloud.com>

Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 13:36:35 +01:00
Christian Richter
15699f02b8 Incorporate requested changes
Co-authored-by: Julian Koberg <jkoberg@owncloud.com>
Co-authored-by: Ralf Haferkamp <rhaferkamp@owncloud.com>
Co-authored-by: Michael Barz <mbarz@owncloud.com>
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 13:22:51 +01:00
Christian Richter
5e02658873 Fix wrong variable
Signed-off-by: Christian Richter <crichter@owncloud.com>
Co-authored-by: Julian Koberg <jkoberg@owncloud.com>
Co-authored-by: Ralf Haferkamp <rhaferkamp@owncloud.com>
2023-11-15 11:23:24 +01:00