Commit Graph

49 Commits

Author SHA1 Message Date
fschade
c0244fc977 enhancement(graph): resolve review feedback such as, use fmt for error wrapping, make use of store auth options, use a dedicated jetstream package 2025-10-08 16:45:16 +02:00
Christian Richter
2ca88e66da add mocks for natskv
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
2025-10-08 16:45:16 +02:00
06kellyjac
2a3a20693a build: Modify mockery config to work with v3
Maintaining the positioning of the files from v2 to reduce cognitive
load.
Indentation of yaml files now matches `.editorconfig`.
All mock files regenerated.
Added empty `{}` following convention from `mockery init` etc.
Removed directory specification where it would already match.
2025-06-19 16:25:39 +01:00
Ralf Haferkamp
fdab4dd174 graph: Add support for counting permissions
To just get the number of permissions set on a share use:
`/drives/id/root/permissions?$count=true&$top=0`

Related issue: #485
2025-06-03 14:50:52 +02:00
Ralf Haferkamp
bfb99927ad graph: Use existing helper to get $select values from request 2025-06-02 15:17:32 +02:00
Ralf Haferkamp
45be2ef0d8 graph: Add more $select options to ListPermissions endpoint
Needed for: #485
2025-05-26 10:54:11 +02:00
Ralf Haferkamp
2e4f611d5b graph: Use godata Parser to parse query paramters in ListPermissions
Also add initial $select support to ListSpaceRootPermissions()
2025-05-26 10:54:11 +02:00
Florian Schade
6b7c004d0b fix(tests): fix nil pointer errors caused by the introduction of cs3 metadata storage 2025-05-21 13:51:51 +02:00
Florian Schade
250400639a enhancement: refine the profile photo service and introduce httpDataProviders which allows reusing the endpoints 2025-05-20 16:09:12 +02:00
Ralf Haferkamp
3dc9c0cb9a Switch to opencloud-eu fork of libre-graph-api-go 2025-05-15 14:11:35 +02:00
Jörn Friedrich Dreyer
3c38a3e3ed fix mockery warnings
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-04-29 11:01:17 +02:00
Michael Barz
22fb783724 test: extract go bin 2025-03-13 14:04:14 +01:00
Ralf Haferkamp
2678d0bb89 Bump mockery to 2.53.0
Should fix build on go1.24. Also fix ci-go-generate step in multiarch
Dockerfile.

Closes: #289
2025-03-03 16:02:59 +01:00
André Duffeck
e8d35e1280 Use the opencloud reva from now on 2025-01-21 11:16:38 +01:00
André Duffeck
8c8cdd9310 Adapt protobuf naming 2025-01-15 11:04:32 +01:00
Jörn Friedrich Dreyer
8e028f17e9 change module name
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 09:58:18 +01:00
Jörn Friedrich Dreyer
a3c7bd3182 bump libre graph api
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-08-19 14:20:20 +02:00
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
Ralf Haferkamp
26b4927ed8 Address go-vet reported issues
mainly "copylocks: return copies lock value" related things
2024-07-11 16:59:25 +02:00
Ralf Haferkamp
ff6674f97b Fix fallout of reva bump
reva tries to avoid copying proto messages now. This changed some calls
to take pointers now (mainly e.g. FormatResourceId())
2024-07-11 15:21:56 +02:00
Jörn Friedrich Dreyer
ab338884c6 rudimentary OCM support in graph
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-06-24 12:07:21 +02:00
Ralf Haferkamp
96e59598d3 graph/users: small optimization for filter by role queries
When filtering by role assignment we now populate the
'appRoleAssignments' property of the returned users when the incoming
request contained and '$expand=appRoleAssignments'. This avoids having
to query the role assignments for all users in the result set a second
time.
The effect of this optimization depends a lot on the actual setup. In
single binary all-in-one installations it is rather small (this it saves
quite a few CPU cycles). In distributed setup it should be larger as it
reduces the number of network round trips to the settings service
significantly.
2024-06-06 09:22:52 +02:00
Jannik Stehle
779bf33fcc refactor: rename GetShares to GetSharesForResource
Rename this method to make more clear what it is about.
2024-05-14 10:30:42 +02:00
Florian Schade
4841240bff enhancement: add get share service method 2024-05-14 10:30:42 +02:00
Florian Schade
b8ed049487 Enhancement: Ability to Change Share Item Visibility in Graph API (#8750)
* Enhancement: Ability to Change Share Item Visibility in Graph API

Introduce the `PATCH /graph/v1beta1/drives/{driveID}/items/{itemID}` Graph API endpoint which allows updating individual Drive Items.

* fix: failing tests

* fix: consider siblings when updating shares

* fix: reduce sharing service provider interface
2024-04-22 17:24:45 +02:00
Ralf Haferkamp
62dc3f4858 feat(graph): add more /<driveid>/root/ endpoints
This add support for the following graph routes:

POST /drives/{driveID}/root/createLink
DELETE /drives/{driveID}/root/permissions/{permissionID}
PATCH /drives/{driveID}/root/permissions/{permissionID}
and
POST /drives/{driveID}/root/permissions/{permissionID}/setPassword

This should significantly improve handling of permissions on spaces
as there is no need to figure to the drive's root itemid anymore.

Partial Fix: #8351
2024-04-04 16:17:59 +02:00
Ralf Haferkamp
2d643219e3 refactor(graph): move CreateLink and SetPublicLinkPassword to the permissions service 2024-04-04 16:17:59 +02:00
Ralf Haferkamp
8124024caf refactor(graph): move UpdatePermission to the permissions service 2024-04-04 16:17:59 +02:00
Ralf Haferkamp
09dac71781 refactor(graph): move DeletePermission deletion to the permissions service 2024-04-04 16:17:59 +02:00
Ralf Haferkamp
57b70a08ee feat(graph): add GET /drive/<id>/root/permissions suppport
Partial Fix: #8351
2024-04-04 16:17:59 +02:00
Ralf Haferkamp
2a5b406963 refactor(graph): move "ListPermissions" to drive item permissions service 2024-04-04 16:17:59 +02:00
Ralf Haferkamp
18d46c1416 feat(graph): add POST /drive/<id>/root/invite suppport
Partial Fix: #8351
2024-04-04 16:17:59 +02:00
Ralf Haferkamp
c6d28caa31 refactor(graph): move "Invite" to new drive item permissions service
This introduces the new DriveItemPermissionsService and DriveItemPermissionsApi to
allow for better separation of the business logic and the API handling.

As a starting point the Invite method was moved to the new service. More to follow.
2024-04-04 16:17:59 +02:00
Florian Schade
35817f24f2 test: add more tests for the DrivesDriveItemService implementation 2024-02-28 17:29:04 +01:00
Florian Schade
7384297728 enhancement: add DrivesDriveItemApi DeleteDriveItem tests 2024-02-28 17:29:04 +01:00
Ralf Haferkamp
3d3f8949f5 Bump mockery to 2.40.2
to address issues when building with go1.22:
https://github.com/vektra/mockery/pull/753
2024-02-09 11:48:45 +01:00
Ralf Haferkamp
07860ef8e7 Fix some fallout of recent mockery changes (#8341)
* Fix mockery setup for graph service

Add missing interfaces to .mockery.yaml. Use existing mocks from protogen
where possible. Remove remaining //go:generate call.

* Add mockery config for settings service

* Add mockery config for proxy service
2024-02-01 21:09:01 +01:00
Jörn Friedrich Dreyer
fad94d2038 bump mockery, add test stub for oidc_auth.go, align mock generation (#8321)
* bump mockery, add test stub for oidc_auth.go

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* use .mockery.yaml for all mocks

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* drop legacy go:generate mockery

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* align mock placement

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-02-01 10:07:44 +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
3e203fe751 add mocks for valueservice
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-11-15 11:23:24 +01:00
Daniël Franke
d2d0461375 Convert IDP service to service trace provider.
This converts the IDP service to use the service trace provider.
2023-07-20 13:36:08 +02:00
jkoberg
442c53f796 add gdpr export endpoint
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-29 16:02:42 +02:00
Jörn Friedrich Dreyer
92923f6801 Add http endpoint to list permissions (#5571)
* Add http endpoint to list permissions

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* extract handler registration

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* use generated protobuf

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* update permissions mock in graph service

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* add unit test

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* return correct userid

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* assert error message type in tests

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-02-15 14:24:19 +01:00
Jörn Friedrich Dreyer
3637149eeb fix gateway client mock
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2022-12-21 15:38:14 +01:00
Andre Duffeck
0dc6eaf466 Graph test coverage (#5136)
* Add unit tests for users.go

* Do not choke on broken spaces

* Generate mocks for the RoleService

* Increase test coverage

* Increase test coverage
2022-11-29 10:22:40 +01:00
Michael Barz
d1ff976aad improve the code style 2022-11-17 16:27:13 +01:00
Willy Kloucek
d74b879d4f update tooling (#5038)
* update tooling

* update nodejs version
2022-11-11 15:01:45 +01:00
Ralf Haferkamp
fa36a73c54 Add missing new methods to fulfill ldap.Client interface 2022-08-02 15:34:59 +02:00
Christian Richter
78064e6bab rename folder extensions -> services
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-06-27 14:05:36 +02:00