Commit Graph

432 Commits

Author SHA1 Message Date
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
Christian Richter 1e34e43c10 Add language to PostUser, allow admin to read user values
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Christian Richter 407238efa5 incorporate requested changes
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Christian Richter c5d3b74cd4 filter out unallowed fields in changes
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Florian Schade e2e1d1da44 fix(graph users test): provide proto list value example on how to set language
Co-authored-by: Florian Schade <fschade@owncloud.com>
Signed-of-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Christian Richter 3e203fe751 add mocks for valueservice
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Christian Richter aea129b658 remove obsolete fields from ldap
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Christian Richter 174097214f Persist preferred language for user
Signed-off-by: Christian Richter <crichter@owncloud.com>
Co-authored-by: Julian Koberg <jkoberg@owncloud.com>
Co-authored-by: Michael Barz <mbarz@owncloud.com>
2023-11-15 11:23:24 +01:00
Christian Richter a3f037a53e refactor to api changes
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Christian Richter 388e9f266a restore deleted changes
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Christian Richter d96031b7d3 add preffered language
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
jkoberg 3629babb7e use name instead id for map
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-11-13 11:00:05 +01:00
jkoberg 73f87a003c refactor settings/pkg/store/defaults
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-11-10 13:02:21 +01:00
mmattel 5e74b50efb [docs-only] Fix envvars with a array slice ([]string) 2023-11-09 12:22:59 +01:00
Martin 89fb341738 Merge pull request #7690 from owncloud/fix_envvar_duration_descriptions
[docs-only] Fix envvars with a duration.
2023-11-09 09:28:36 +01:00
Florian Schade 643158b67b enhancement: add sharedWithMe graph beta endpoint (#7633) 2023-11-08 20:02:58 +01:00
mmattel b13b880921 [docs-only] Fix envvars with a duration. 2023-11-08 18:32:39 +01:00
Ralf Haferkamp 94d2befc25 Make v1beta1/roleManagement/permissions/roleDefinitions/ beta
To align with the current spec.
2023-11-08 15:46:24 +01:00
Ralf Haferkamp e084e5a722 graph/sharebyme: Use cache for user and group lookups 2023-11-08 14:45:44 +01:00
Ralf Haferkamp c9df9f5f31 graph: Make user and group lookup cache re-usable
drives.go implemented a local user/group cache (ttl based) to speed up repeated
user and group lookups. This commit moves the implementation to the 'identity' module
to make it usable outside of drives.go.
2023-11-08 14:45:44 +01:00
Ralf Haferkamp f2599dfa76 graph: Make createGroupModelFromCS3() function public
This is useful outside the identity module so make it available
2023-11-08 14:45:44 +01:00
Ralf Haferkamp 65daa93c1e Fix url path for getsharedbyme
it's 'drive' not 'drives'
2023-11-08 09:31:45 +01:00
Ralf Haferkamp d2cff38ab4 graph/sharedbyme: Add user and group names to permissions 2023-11-06 09:35:27 +01:00
Ralf Haferkamp 580a4e0d92 graph/sharedbyme: populate the permissions property
Set the exipration date, grantedToV2 and link attributes on the
permissions.

The displayName for users and groups isn't expanded yet (only the "id" is set)
Also, the "roles" attribute cannot be populated yet.
2023-11-06 09:35:27 +01:00
Ralf Haferkamp 454ec52955 graph/sharedbyme: Use existing method to initialize driveitem properties
getDriveItem does a Stat() call on the resource and sets the
corresponding DriveItem properties.
2023-11-06 09:35:27 +01:00
Ralf Haferkamp b0538559c2 graph: Populate 'ParentRef' in driveitems 2023-11-06 09:35:27 +01:00
Ralf Haferkamp f18775b1cb graph: Initial implementation of /me/drives/sharedByMe endpoint
This adds a still incomplete implementation of the new /me/drives/sharedByMe
endpoint. For now it only sets the driveItem Id property. The 'permissions' relation
is not supported yet.

This endpoint is added to the /v1beta1 route, to indicate that it is
still imcomplete and might require changes.
2023-11-06 09:35:27 +01:00
Ralf Haferkamp 86b061421e Disable debug log during test 2023-11-06 09:35:27 +01:00
Dominik Schmidt db32fb46f9 Audio Metadata (#7490)
* Add audio facet to search protobuf message

* Add audio metadata to search index

* Return audio facet from search if available

* Store audio metadata in arbitrary metadata

* Add audio facet to driveItems listings

* Make tests coding style more consistent

* Fix tests

* Add changelog

* Make valueToString code more defensive

* Log status code as well
2023-11-06 08:56:46 +01:00
jkoberg 6e510be180 return 423 on tag create when file is locked
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-10-26 16:07:50 +02:00
Roman Perekhod d185b7145f implement sharing roles (#7524)
Co-authored-by: Roman Perekhod <rperekhod@owncloud.com>
2023-10-24 15:01:11 +02:00
Ralf Haferkamp 4465c9385d graph/education: Fix issues reported by sonarcloud 2023-09-27 15:39:00 +02:00
Ralf Haferkamp a34d467285 graph/education: slightly improve error handling and logging
- Use var for common errors
- Add the addition error message to the Error() output of errorcode.Error
- in PatchEducationSchool() use errorcode.RenderError() to turn the errorcode
  in to the right HTTP Status (instead of return 500 always)
2023-09-27 15:39:00 +02:00
Ralf Haferkamp 4f59de9c52 graph/education: Check school number for duplicates before adding a school 2023-09-27 15:39:00 +02:00
Ralf Haferkamp e2849bf19d graph/education: Add getSchoolByNumber helper
Sometimes we explicit need to lookup by number and not numberOrID
2023-09-27 15:39:00 +02:00
Ralf Haferkamp ce808eaa17 graph/education: Remove unreachable code
An LDAP Modify operation never returns LDAPResultEntryAlreadyExists errors.
That error can only happen for LDAPAdd or LDAPModifyDN.
2023-09-27 15:39:00 +02:00
Ralf Haferkamp 16debe6fa5 graph/education: Use helper for creating attribute list 2023-09-27 15:39:00 +02:00
Ralf Haferkamp 164edd16c0 graph/education: Don't leak LDAP errors into the graph error message 2023-09-27 15:39:00 +02:00