Commit Graph

225 Commits

Author SHA1 Message Date
David Christofas
2b0d9aa9b0 improve quota handling in the graph API 2022-03-28 13:24:54 +02:00
Ralf Haferkamp
3c16713869 Fix error handling in GetUsers
A missing return statement caused GetUsers to return misleading results
when the identity backend returned an error.
2022-03-22 10:08:32 +01:00
Michael Barz
7a0e28a420 add drive alias to unit tests 2022-03-16 20:15:23 +01:00
Michael Barz
3a59c7ec4c add driveAlias to the graphAPI 2022-03-16 15:38:40 +01:00
Willy Kloucek
67b5458894 fix graph jwt secret from OCS_JWT_SECRET to GRAPH_JWT_SECRET 2022-03-15 15:58:02 +01:00
Willy Kloucek
9a4737d3ed exclude config items not inteded to be used from un/marshalling 2022-03-11 12:12:44 +01:00
Christian Richter
3a34e64dde Fix tests 2022-03-11 08:08:33 +01:00
Christian Richter
9734b000b3 Add defaultconfig to extensions 2022-03-10 14:12:26 +01:00
David Christofas
66f4198e12 include spaces etags in drives listing 2022-03-04 14:23:37 +01:00
Michael Barz
b15db1794a update reva to version 2.0.0 (#3258) 2022-03-03 19:56:04 +01:00
Ralf Haferkamp
06ca18b1fb graph: Assign new user the default user role
Similar to what the accounts service is doing, all new users get
the User role assigned now. Otherwise creating the user's personal space
upon login is not working.
2022-03-02 16:45:25 +01:00
Ralf Haferkamp
fe2501b083 graph: Add some validation for username and email
This copies the validation code from the accounts service, also fixing a
bug in the regex that allowed adding mail addresses with whitespace and
other problematic characters to the domain part of the mail address.

Partial fix for: #3247
2022-03-02 16:45:25 +01:00
Jörn Friedrich Dreyer
beaac40aa6 update reva to include decomposedfs nodes-per-space (#3228)
* update reva to include decomposedfs nodes-per-space

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

* check create space with own constraint

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

* update reva

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

* unexpected passed

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

* update reva

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

* remove unused variable

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

* revert reva commit id

Co-authored-by: Florian Schade <f.schade@icloud.com>
2022-03-02 08:47:53 +01:00
Michael Barz
c58fed9e22 fix ordering of names (#3218) 2022-02-22 20:45:44 +01:00
Ralf Haferkamp
e8e361d32f Add permission checks to users and groups Graph API
Only users with the account management permission should be able to
create, update or delete users. This also restricts access to the APIs
that allow listing all Groups/all Users.

Fixes #3177
2022-02-22 10:53:08 +01:00
Ralf Haferkamp
70a08774bd Fix linter issue (#3211)
Silence the warning about Insecure being true. `Insecure` is not our
default configuration, but need it to work in some cases.
2022-02-21 17:39:05 +01:00
Michael Barz
90a15a8628 add orderby name and lastModifiedDateTime (#3201)
* add orderby name and lastModifiedDateTime

* add unit test for sort

* fix orderby name

* add more tests

* exclude test files from duplication analyzer

* remove flaky test

* order by name if no date is set

* refactor

* add test for wrong parameter name
2022-02-21 15:59:35 +01:00
Michael Barz
3ff984ec80 fix unit test 2022-02-16 23:51:55 +01:00
Michael Barz
efe292738f Show not found error message 2022-02-16 23:39:51 +01:00
Michael Barz
8fd70fd350 change root item ID to match the format 2022-02-16 21:43:23 +01:00
Michael Barz
3167377fca use id wrap and unwrap from reva 2022-02-16 17:40:36 +01:00
Michael Barz
af0a5fac18 Create space with description (#3168)
* send description during create space

* add changelog

* update reva

* add to API test

* only use opaque if not nil

* use forked xattr to fix windows build

Signed-off-by: Michael Barz <mbarz@owncloud.com>
2022-02-15 14:18:27 +01:00
Michael Barz
b1d6be7e1b refactor to reduce complexity 2022-02-11 14:56:05 +01:00
Michael Barz
d3b87fa3a1 fix API tests 2022-02-11 14:56:05 +01:00
Michael Barz
57de630e33 fix unit tests 2022-02-11 14:56:05 +01:00
Michael Barz
abfefd9230 use opaque as space props transport 2022-02-11 14:56:05 +01:00
Michael Barz
fe0bd0d55c use arbitrary metadata 2022-02-11 14:56:05 +01:00
Ralf Haferkamp
8a57545c30 Add "insecure" flag to graph LDAP backend
To allow skipping TLS Certificate verification in development
environments.
2022-02-09 18:29:57 +01:00
David Christofas
cc1c448b23 Merge pull request #3095 from owncloud/drive-permissions
add permissions to the graph drives
2022-02-04 15:42:50 +01:00
David Christofas
5668a43e8e add permissions to the graph drives 2022-02-04 14:49:55 +01:00
kobergj
559abd97db Restoring spaces graph endpoint (#3094)
* restore drive & trashed information

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

* TEMP: use feature branch reva

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

* add changelog

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

* TEMP: update reva version

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

* go back to edge reva

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

* use latest edge

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

* back to feature reva

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

* bump reva again

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

* update expected failures

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

* next reva bump

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

* use edge reva

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

* next reva change

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

* use reva edge again (please go green)

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

* remove expected failure as it passes now

Signed-off-by: jkoberg <jkoberg@owncloud.com>
2022-02-04 13:45:37 +01:00
Ralf Haferkamp
04083a4fe0 Delete group memberships when deleting a user
Upon deleting a User from the LDAP backend, we also need to cleanup
the user's group memberships as LDAP itself doesn't make any promises
about referential integrity.

Fixes #3027
2022-02-02 10:24:05 +01:00
Ralf Haferkamp
d9aa33525a Add support for adding multiple members to a group at once
Adding multiple members at once is done via PATCH on
`groups/{group-oid}` with a body containing a list of refernces to the
members.
2022-02-01 11:45:14 +01:00
Ralf Haferkamp
166bda9ac6 Implement removing a group member
This implements DELETE request on the
graph/v1.0/groups/{groupid}/members/{memberID}/$ref
endpoint. Allowing to remove a single member from a group.
2022-02-01 10:18:54 +01:00
Ralf Haferkamp
eb3ace8629 Implement deleting a Group
This implements DELETE request on the graph/v1.0/groups/{groupid}
endpoint. Allowing to remove an entire group.
2022-02-01 10:17:48 +01:00
Ralf Haferkamp
c0d486f3a5 Implement adding a member to a Group
This implements POST request to the graph/v1.0/groups/{groupid}/members/$ref
endpoint. Allowing to add members to a group.
2022-02-01 10:17:46 +01:00
Ralf Haferkamp
2ffd2d51f4 Rework getLDAP*ByNameOrID helpers
We need to be able to search by ID only as well. So split the helpers
into getLDAP*ByID and getLDAP*ByNameOrID.
2022-02-01 10:16:11 +01:00
Ralf Haferkamp
6f14ef7843 Implement reading Group Members on Graph API
This implement the graph/v1.0/groups/{groupid}/members endpoint.
Starting with the LDAP backend.
2022-02-01 10:16:08 +01:00
Ralf Haferkamp
dd7ae9cb47 Implement CreateGroup support for Graph LDAP Backend
This add basic support to create Groups in LDAP via the GraphAPI.
Currently this is hardcoded to use the standard LDAP "groupOfNames"
objectClass.
2022-02-01 09:42:20 +01:00
Willy Kloucek
d1d242fe63 Merge pull request #2960 from owncloud/proto_refactor
Proto refactor
2022-02-01 09:13:52 +01:00
Juan Pablo Villafáñez
7d8e334537 Revert v1 to v0 2022-01-31 12:17:56 +01:00
Ralf Haferkamp
73ddf1bceb Adjust generated Types after recent fixes in openapi-generator for go 2022-01-31 10:34:14 +01:00
Juan Pablo Villafáñez
7557e4e0ea Migrate proto files for settings and adjusts paths 2022-01-31 09:35:39 +01:00
David Christofas
ba2ef44ea0 fix graph code smells 2022-01-28 12:41:55 +01:00
David Christofas
1cd8cbd890 Merge pull request #3001 from owncloud/cleanup-drivesgo
refactor ListStorageSpaces filter handling
2022-01-20 18:33:48 +01:00
David Christofas
d70fe6ac13 prevent purging of enabled spaces 2022-01-20 17:26:10 +01:00
David Christofas
b96ac54224 refactor ListStorageSpaces filter handling 2022-01-20 17:08:57 +01:00
David Christofas
0bfc1f08b7 implement graph endpoint to delete spaces 2022-01-20 11:34:15 +01:00
jkoberg
33cdaab6dc Merge branch 'master' into FixFlakySpacesYamlTest 2022-01-20 10:02:55 +01:00
jkoberg
a0aa8960ff fix flaky yaml tests
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2022-01-19 17:24:46 +01:00