Commit Graph

190 Commits

Author SHA1 Message Date
Ralf Haferkamp
3141f4f659 graph/education: Fix issues reported by sonarcloud
(cherry picked from commit 4465c9385d)
2023-09-27 15:49:15 +02:00
Ralf Haferkamp
9a9dba7ca7 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)

(cherry picked from commit a34d467285)
2023-09-27 15:45:36 +02:00
Daniël Franke
952ebe7d7d Pass context to event publishing.
To allow tracing propagation via events, we need to pass the context
to the `Publish` function of reva events. This adds the context
everywhere where events are published. If there was no context to pass,
we started a new one with `context.Background()`.
2023-08-11 12:01:19 +02:00
Daniel Swärd
6a5e21eff4 Replacing implicit grpc client initialization with explicit package local variables. 2023-07-31 12:57:59 +02:00
Daniël Franke
919404bafe Move graph service to service tracer.
This changes the graph service away from using global tracers,
which makes debugging tracing issues easier going forward.
2023-07-12 12:56:33 +02:00
Ralf Haferkamp
51bc49d5b5 graph: Add config knob to set a minimal grace period for schoolTermination
When setting a terminationDate on a School, it's possible to configure a grace
period now so that only terminationDate that are at least a certain time in the
future can be set.
We also now forbid to set a terminationDate in the past.
2023-07-12 08:48:19 +02:00
Ralf Haferkamp
0bc36f1cf5 graph: Turn PatchEducationSchool test into test table 2023-07-12 08:48:19 +02:00
Ralf Haferkamp
5304184bd6 graph: Add 'terminationDate' property to educationSchool
Schools can now have a terminationDate set. Schools can only be deleted if the
terminationDate is in the past. Schools without a terminationDate cannot be deleted.
2023-07-12 08:48:19 +02:00
Ralf Haferkamp
c9a9fddef1 Consitently switch to stretchr/testify
We were using stretchr/testify and test-go/testify inconsitently and
sometimes mixed in the same tests. This can cause very strange issue,
e.g when using things like mock.MatchedBy().

This moves all our code to stretchr/testify, which seems to be far
more active and maintained then test-go/testify.
2023-06-29 13:44:49 +02:00
jkoberg
ef68dce389 add more details for DELETE endpoints
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-06-22 14:06:21 +02:00
jkoberg
3fe5e2b011 add ids to graph access logs
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-06-22 11:04:00 +02:00
Christian Richter
9198dd9a67 Fix tests
Co-authored-by: Julian Koberg <jkoberg@owncloud.com>
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-06-16 11:56:03 +02:00
Christian Richter
dd862cdf06 Add event for role changes
Co-authored-by: Julian Koberg <jkoberg@owncloud.com>
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-06-16 10:52:37 +02:00
Christian Richter
c4f9f18a39 Show changes between old an new values in audit log
Co-authored-by: Julian Koberg <jkoberg@owncloud.com>
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-06-16 10:52:37 +02:00
Roman Perekhod
4f9a82ee99 Merge pull request #6469 from 2403905/issue-6414
Handle the bad request status for the CreateStorageSpace function
2023-06-14 16:47:11 +03:00
Michael Barz
0484a4dac5 add remote item metadata
Signed-off-by: Michael Barz <mbarz@owncloud.com>
2023-06-14 11:20:47 +02:00
Roman Perekhod
e73e760827 changlog added 2023-06-12 09:19:54 +02:00
Roman Perekhod
df5641f406 cleared up the errors rendering 2023-06-12 09:19:54 +02:00
Roman Perekhod
6b3c1327d0 fixed the ability to create a group with an empty name #5050 2023-06-12 09:19:54 +02:00
Florian Schade
4f26424db6 [full-ci] enhancement: use reva client pool selectors (#6452)
* enhancement: use reva client pool selectors

register mock service to registry and pass tests

* enhancement: bump reva

* Fix a couple of linter issues

---------

Co-authored-by: Ralf Haferkamp <rhaferkamp@owncloud.com>
2023-06-08 12:41:04 +02:00
Roman Perekhod
c0f06cc679 Handle the bad request status for the CreateStorageSpace function 2023-06-07 13:34:17 +02:00
Roman Perekhod
96f658c281 Merge pull request #6440 from 2403905/issue-6436
Fix the username validation when an admin update the user
2023-06-07 12:23:47 +03:00
Roman Perekhod
1ac49dfd64 Fix the username validation when an admin update the user 2023-06-06 17:15:38 +02:00
Michael Barz
4b512fa884 update reva to latest edge 2023-06-05 17:02:04 +02:00
Jörn Friedrich Dreyer
632b206675 trace proxie middlewares (#6313)
* trace proxie middlewares

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

* Update ocis-pkg/service/grpc/client.go

Co-authored-by: Christian Richter <1058116+dragonchaser@users.noreply.github.com>

* default tls is off

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

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: Christian Richter <1058116+dragonchaser@users.noreply.github.com>
2023-05-27 10:18:24 +02:00
Ralf Haferkamp
0726f1b143 graph/users: Sanitize some log levels
The "calling function XYZ" log messages should only appear at debug level.
Message indicating client errors when creating a user (e.g. invalid characters
in username or missing attributes) are logged at info level (instead of debug)
now.
2023-05-24 17:17:15 +02:00
Jörn Friedrich Dreyer
e0873dee38 fix typo (#6352)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-19 10:59:37 +02:00
Ralf Haferkamp
1d85593c7e graph: Adjust defaults for user, group and SpaceProperties caches
The old default ttl of 30 minutes for the caches seems way too long. It
could cause outdated information users or groups to be returned for
quite a while. Especially since the TTL was reset every time an entry was
fetched from the cache. This is disabled now as well.

Fixes: #6320
2023-05-17 16:16:24 +02:00
Christian Richter
8cf35ba18e remove quote from api response in share jails
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-05-15 17:01:58 +02:00
Roman Perekhod
554e109141 Merge pull request #6276 from 2403905/issue-6037
fix the wrong status code when appRoleAssignments is forbidden #6037
2023-05-12 17:03:04 +02:00
André Duffeck
e9d4e07a08 constify the "trashed" space state 2023-05-12 10:37:43 +02:00
Roman Perekhod
082e450677 fix the wrong status code when appRoleAssignments is forbidden #6037 #6035 2023-05-11 09:39:41 +02:00
Roman Perekhod
d69decdafe fix Graph delete request leaks existence of space #5031 2023-05-08 16:13:52 +02:00
Michael Barz
b354e79bb5 Merge pull request #6189 from owncloud/cache-special-drive-items
cache special drive items until space root changes
2023-05-03 18:16:28 +02:00
Jörn Friedrich Dreyer
4eaa90af54 address code smells
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-03 12:15:02 +02:00
Jörn Friedrich Dreyer
024e66ffd0 ignore errors when building the cache key hash
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-03 11:26:46 +02:00
Jörn Friedrich Dreyer
c7bbdd2eae add special nodes to cache key
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-03 11:09:55 +02:00
Ralf Haferkamp
77e773515d graph/users: gracefully handle PATCH requests with empty bodies
Return as success status code when the PATCH request comes with an empty
body. This is mainly to workaround issues like:
https://github.com/owncloud/web/issues/8946
2023-05-03 09:32:05 +02:00
Jörn Friedrich Dreyer
13369f8367 only stat if property is set
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-03 09:18:19 +02:00
Jörn Friedrich Dreyer
92533895c5 some fixes for the tests and noisy logs
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-03 00:21:57 +02:00
Jörn Friedrich Dreyer
40eba0909d fix mocks for stat based special resource handling
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-02 22:04:04 +02:00
Jörn Friedrich Dreyer
f2b86d8115 stat based on default paths
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-02 17:12:49 +02:00
Jörn Friedrich Dreyer
ca638ddc51 cache special drive items until space root changes
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-02 11:44:27 +02:00
Jörn Friedrich Dreyer
4bfda6183c Read quota from opaque (#6187)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-04-28 15:55:29 +02:00
André Duffeck
0eca2a08f6 Speed up me/drives by gathering space information in parallel 2023-04-28 10:53:24 +02:00
Jörn Friedrich Dreyer
3489de1c42 listing drives sould use the user filter (#6103)
* listing drives shsould use the user filter

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

* fix status code

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

* check correct error

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

* Adapt expected failures

* Bump reva

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: André Duffeck <andre.duffeck@firondu.de>
2023-04-28 10:06:40 +02:00
Andre Duffeck
77bb3d8bcd [full-ci] Refactor stores (#6019)
* Streamline the store implementation with and into reva

* Adapt to the cache/store refactoring in reva

* Streamline config options and their env vars

* Apply suggestions from code review

Co-authored-by: Martin <github@diemattels.at>

* Use the same database for all stores

* Bump reva

* Configure stat and filemetadata cache separately

* Fix default config

---------

Co-authored-by: Martin <github@diemattels.at>
2023-04-24 15:13:35 +02:00
jkoberg
8f5c255225 return badrequest when exporting gdpr for other user
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-04-24 12:17:05 +02:00
Prajwol Amatya
e0b6ca0e29 [tests-only][full-ci] api test to get personal drive information of other users (#6018)
* api test to get personal drive information of other users

* fix the broken personal drive listing

* removed scenario from expected failure after issue fixed

---------

Co-authored-by: Michael Barz <mbarz@owncloud.com>
2023-04-21 16:59:16 +05:45
Daniel Swärd
0d6500a225 graph: Add comment to fix and remove expected test failures
Fixes: #5083
2023-04-20 10:32:40 +02:00