Commit Graph
466 Commits
Author SHA1 Message Date
Ralf HaferkampandRalf Haferkamp da495fd306 graph/sharing: Fix role condition for space roots
When computing the allowed roles for a spaceroot use the correct conditions.
Spaceroots require '@Subject.objectId Any_of @Resource.owners'.

Note: Updating or deleting the permissions on a spaceroot via
'v1beta1/drives/{driveid}/items/{itemid}/permissions/{permissionid}' does still
not work.
2024-01-24 17:03:00 +01:00
Ralf HaferkampandRalf Haferkamp d9fc4af575 graph/sharing: Add check for role conditions
Use the condition from the unifiedrole to check if the requested role
is actually applicable to the selected resource.

Fixes: #8131
2024-01-24 17:03:00 +01:00
Ralf HaferkampandRalf Haferkamp f38f940d22 graph/sharing: Fix role conditions for Space specific sharing roles
Co-Owner and Manager are space specific roles. They need the UnifiedRoleConditionOwner.
2024-01-24 17:03:00 +01:00
Ralf HaferkampandRalf Haferkamp f3ed318d9d graph/drives: Fix status code for PATCH/DELETE on drives don't allow them
Return a 405 Status when UpdateSpace() or DeleteSpace() are not implemented
in the backend for a certain type of drive (e.g. the virtual mountpoint drives
created for shares).

Fixes: #7881
2024-01-22 14:04:38 +01:00
Ralf HaferkampandRalf Haferkamp 0e1b5dd989 graph/sharedWitMe: fix response for shares from project space
Resources on project space do not have a real owner assigned. A special
of the type USER_TYPE_SPACE_OWNER is returned as the owner. This type of
user can't be looked up via a GetUser request. So we skip that call for
this usertype.

This also fixes the behavior of 'sharedWithMe' for case when the owner
or creator of a share or shared resource can't be looked up in the 'users'
service. Previously cause the complete request to fail with an error message.
So a single share with an unresolvable owner caused 'sharedWithMe' to fail.
Now we log a warning but return all shares. Those where the owner or creator
couldn't be resolved will have the 'displayName' field of the user in the
'remoteItem.shared.owner' or 'remoteItem.shared.sharedBy' property left
empty.

Fixes: #8215
Fixes: #8027
2024-01-19 09:01:33 +01:00
jkoberg a4d71134f5 remove unused parameter
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2024-01-17 13:21:28 +01:00
jkoberg 386e37cbdc cleanup graph/.../driveitems.go
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2024-01-17 11:58:56 +01:00
Ralf HaferkampandRalf Haferkamp 3cc485a0fc graph/sharewithme: add unit test for 'remoteitem.permissions' property 2024-01-16 15:09:27 +01:00
Ralf HaferkampandRalf Haferkamp 2c161881ba graph/sharedWithMe: Fix 'parentReference' on 'driveItem'
The outer parentreference should refer to the drive containing the mountpoint.
In our case this is the storagespaceid of the virtual share jail.

Also 'CreatedBy' should be the same as on the wrapped remote item. Not the share creator.
2024-01-16 15:09:27 +01:00
Ralf HaferkampandRalf Haferkamp eab501f593 graph/sharedwithme: move flags from 'remoteItem' back into 'permissions' 2024-01-16 15:09:27 +01:00
Ralf HaferkampandRalf Haferkamp 5bfc943a0c graph/sharedWithMe: Renable and adjust unit test for recent changes 2024-01-16 15:09:27 +01:00
Ralf HaferkampandRalf Haferkamp b5af346384 bugfix: graph/sharedWithMe fix shared.Owner property
The value of driveItem.remoteItem.shared.Owner should match the owner property
of the received share not the owner property of the resourceInfo.
2024-01-16 15:09:27 +01:00
Ralf HaferkampandRalf Haferkamp 03e704c291 graph/sharedWithMe: Set the permission property only on the wrapped remoteItem
Sematically the outer driveItem shouldn't carryt the permission. It's the `remoteItem`
that reflects the grantee's permissions.
2024-01-16 15:09:27 +01:00
Ralf HaferkampandRalf Haferkamp dd61270e7d graph/sharedWithMe: separate method for converting CS3 share to libregraph
For readability and reduced complexity of the sharedWithMe method. It was getting
too large already.
2024-01-16 15:09:27 +01:00
Florian SchadeandRalf Haferkamp cfba9f29cc enhancement: make use uo remote item ui hidden and client synchronized 2024-01-16 15:09:27 +01:00
Florian SchadeandRalf Haferkamp b91bc535a8 enhancement: simplify sharedWithMe
- remove unnecessary stat for accepted items
- only display permission actions if the role cannot be resolved
- add permission user and group displayName
2024-01-16 15:09:27 +01:00
Florian SchadeandRalf Haferkamp 0b796443f2 enhancement: add ui hidden and client synced prop 2024-01-16 15:09:27 +01:00
Florian SchadeandRalf Haferkamp 8c6ba9c360 fix: shared with me listing 2024-01-16 15:09:27 +01:00
Florian SchadeandRalf Haferkamp cf5f1bcb8e fix: share jail usage for the listSharedWithMe endpoint 2024-01-16 15:09:27 +01:00
jkoberg 16106b0ac5 use id for events
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2024-01-11 14:48:42 +01:00
jkoberg 2a41ad4218 fix language patching
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2024-01-11 11:49:01 +01:00
Florian SchadeandRalf Haferkamp 465c9e3c20 fix: allow one invite at a time only and implement related validations and http status code handling 2024-01-09 17:17:02 +01:00
Ralf HaferkampandRalf Haferkamp dca0c653fb Removed deprecated envars scheduled for removal with 5.0.0
Fixes: #8025
2024-01-09 11:28:31 +01:00
Ralf HaferkampandRalf Haferkamp a1ed2ce2e5 graph/groups: Handle quoted search terms in GetGroups
Fixes: #7990
2023-12-21 13:57:26 +01:00
Ralf HaferkampandRalf Haferkamp 8489170715 graph/users: More test coverage for GetUsers search 2023-12-21 13:57:26 +01:00
Juan Pablo VillafáñezandRalf Haferkamp 1bcc559ed8 fix: adjust min search length if double quotes are used 2023-12-20 17:24:44 +01:00
Juan Pablo VillafáñezandRalf Haferkamp 34bb4f80ed fix: double quotes will be trimmed from the search token 2023-12-20 17:24:44 +01:00
jkoberg e1fad5c6e9 make nats-js-kv the default registry
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-19 12:13:28 +01:00
jkoberg de4f9d78f4 allow authentication for stores
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-19 10:44:05 +01:00
jkoberg 3e55223f2d allow authentication for events
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-19 10:44:05 +01:00
kobergjandGitHub 377a23ee7d Non-durable SSE streams (#7986)
* make sse streams non-durable

Signed-off-by: jkoberg <jkoberg@owncloud.com>

* bump reva

Signed-off-by: jkoberg <jkoberg@owncloud.com>

---------

Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-18 11:47:25 +01:00
Ralf HaferkampandMichael Barz 3eb78bb6cc graph: fix missing return after error in UpdateShare 2023-12-15 14:48:54 +01:00
Ralf HaferkampandMichael Barz 419619041b graph sharing: Avoid usage for deprecated CS3 Request attributes
The sharereference attribute in the CS3 UpdateShareRequest is deprecated.
Set the shareid via the Share.ID attribute.
2023-12-15 14:48:54 +01:00
423c28b298 improve store readmes
Co-authored-by: Martin <github@diemattels.at>
2023-12-15 13:25:10 +01:00
jkoberg d62cb9d34b use inmemory cache by default
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-13 12:49:54 +01:00
jkoberg ad87ac955a configure services individually
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-13 12:49:54 +01:00
jkoberg bbc4f83f7d bump dependencies
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-13 12:49:53 +01:00
Michael Barz 703a116e43 fix: missing return statement 2023-12-13 00:06:59 +01:00
Michael Barz 33feab88a7 test: add more tests 2023-12-11 22:20:29 +01:00
Michael Barz e7a7b3001d style: refactor error handling 2023-12-11 22:20:29 +01:00
Michael Barz 416b518873 fix: wrong error code for failed precondition 2023-12-11 22:20:29 +01:00
Michael Barz 3931578d4c test: fix existing tests 2023-12-11 22:20:29 +01:00
Michael Barz fe48dc148a feat: implement edit public link 2023-12-11 22:20:29 +01:00
Michael Barz 8aad8dd4d3 feat: add setPassword endpoint 2023-12-11 22:20:29 +01:00
Ralf Haferkamp 269ce605dd graph sharing: Implement UpdatePermissions
This is an initial implementation of PATCH support on drives/{driveid}/items/{itemid}/permissions/{id}.
It focusses on updating user shares for now. It's possible to update the
expirationDate, roles and/or libregraphResourceActions.
Updating the permissions of a space root or a public link share is currently
not implemeted.
2023-12-08 10:55:12 +01:00
Ralf Haferkamp dbf23a9738 graph sharing: Properly dereference errorcode.Error before returning
Otherwise errorcode.RenderError() will not render the correct HTTP Status
2023-12-08 10:55:12 +01:00
Ralf Haferkamp 7b40fdcbf7 graph sharing: Add help to convert CS3 share to libregraph.Permission 2023-12-08 10:55:12 +01:00
Ralf HaferkampandRalf Haferkamp 1ace257064 graph/groups: Allow unprivileged users to search for groups 2023-12-07 10:21:45 +01:00
Ralf HaferkampandRalf 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 HaferkampandRalf Haferkamp 4cb6d99e88 graph/users: Make minimum search term length configurable 2023-12-07 10:21:45 +01:00