Commit Graph

255 Commits

Author SHA1 Message Date
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
Ralf Haferkamp
1ad31218ec graph: Allow using binary LDAP UUIDs as user ids
In Active Directories UUID attributes such as "objectGUID" use a binary
syntax (oposed to the standard UUID syntax defined in RFC4530). This
introduces a flag to enable support for binary UUIDs as the id for users
and groups (similar to what the "users" and "groups" services already
support)

Fixes: #5815
2023-05-03 09:32:05 +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
129489203b Cleanup and improve the caching config (#6148)
* Cleanup and improve the caching config

* bump reva

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

* disable stat cache

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

* Bump reva

* Linter fixes

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-04-27 12:35:30 +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
Ralf Haferkamp
70a80125c3 Fix backchannel logout
Use access token to lookup session id. The userinfo endpoint does
not return the session id. Also add some debug logging.

Co-authored-by: Christian Richter <crichter@owncloud.com>
Co-authored-by: Michael Barz <mbarz@owncloud.com>
2023-04-20 18:04:52 +02:00
Daniel Swärd
0d6500a225 graph: Add comment to fix and remove expected test failures
Fixes: #5083
2023-04-20 10:32:40 +02:00
Daniel Swärd
8d789ce24d graph: Try to fix problems with unescaping values. 2023-04-20 09:33:23 +02:00
Michael Barz
8b8859950f Merge pull request #6067 from owncloud/ainmosni/feature/search-keycloak-by-username
Search users by username instead of by email
2023-04-19 22:00:30 +02:00
mmattel
8ed34926ef [docs-only] Correct the removal version according semver to 4.0.0 2023-04-19 10:16:06 +02:00
Daniël Franke
30edab9f69 Search users by username instead of by email
As some setups don't have email addresses setup or reuse email
addresses, the keycloak search has to be done by username as that
is guaranteed to always be unique and defined.

This PR changes that.
2023-04-18 11:43:13 +02:00
Daniël Franke
2e8b741530 improve readme
Co-authored-by: Martin <github@diemattels.at>
2023-04-14 15:09:54 +02:00
Daniël Franke
d81065c1b6 Adds JSON tags to PII report.
This will make the JSON export look a bit prettier.
2023-04-14 15:09:54 +02:00
jkoberg
c9d0e876f7 use mail instead id to get user
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-04-14 15:09:54 +02:00
jkoberg
cf6b1eac25 add events to personalDataExport
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-04-14 15:09:54 +02:00
Daniël Franke
8e32b4f5da Integrate keycloak and events data into graph.
This PR adds the data from keycloak and events into the GDPR export of
the graph service.
2023-04-14 15:09:54 +02:00
Ralf Haferkamp
0495e42534 Apply suggestions from code review
Co-authored-by: Martin <github@diemattels.at>
2023-04-06 10:00:20 +02:00
Ralf Haferkamp
359bf13ce6 Apply suggestions from code review
Co-authored-by: Martin <github@diemattels.at>
2023-04-06 09:55:19 +02:00
Daniel Swärd
afbfd2d6b2 Deprecating and renaming many environment variables
Fixes #5767
Fixes #5905
Fixes #5532
2023-04-05 11:05:48 +02:00
kobergj
78ab7d6750 Merge pull request #6009 from 2403905/introduceGlobalVariables
Introduced global OCIS_EVENTS_ENDPOINT and OCIS_EVENTS_CLUSTER #5901
2023-04-05 10:20:48 +02:00
Ralf Haferkamp
120887abcc graph: new config option GRAPH_LDAP_GROUP_CREATE_BASE_DN
By setting GRAPH_LDAP_GROUP_CREATE_BASE_DN a distinct subtree can be
configured where new LDAP groups are created. That subtree needs to be
subordinate to GRAPH_LDAP_GROUP_BASE_DN. All groups outside for
GRAPH_LDAP_GROUP_CREATE_BASE_DN are considered read-only and only groups
below that DN can be updated and deleted.

This is introduced for a pretty specific usecase where most groups are managed
in an external source (e.g. a read-only replica of an LDAP tree). But we still
want to allow the local administrator to create groups in a writeable subtree
attached to that replica.
2023-04-04 15:56:57 +02:00
Roman Perekhod
fcfb2ab9fa Introduced global OCIS_EVENTS_ENDPOINT and OCIS_EVENTS_CLUSTER #5901 2023-04-04 15:43:03 +02:00
Prajwol Amatya
7baac4f050 [tests-only][full-ci] Api test for user trying to set own personal space quota (#5979)
* api test for user trying to set their own personal space quota

* removed duplicate scenarios for set quota

* updated expected scenario

* fix wrong status code

* updated expected failure scenario after wrong status code fix

---------

Co-authored-by: Michael Barz <mbarz@owncloud.com>
2023-04-04 12:41:34 +05:45
Michael Barz
ffe0e71337 add Purge and Restore Headers 2023-04-03 17:29:49 +02:00
Michael Barz
e313248cee add missing cors config 2023-04-03 17:29:49 +02:00
Daniel Swärd
620940ec3f graph: Add strict json decoding to return errors when receiving unknown parameters 2023-04-03 15:39:23 +02:00
kobergj
3a8b4043e6 Merge pull request #5950 from kobergj/GDPRExport
GDPR Export
2023-03-30 16:56:23 +02:00
jkoberg
e0b07dee70 use correct status code
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-30 14:57:41 +02:00
kobergj
db5c84816b fix typo in graph service
Co-authored-by: Daniël Franke <df@ponc.tech>
2023-03-30 14:17:56 +02:00
Michael Barz
987e13693a Merge pull request #5896 from owncloud/add-groups-by-name-or-id
allow adding group by name or id
2023-03-30 10:57:56 +02:00
jkoberg
e906c9f1ec emit event after finishing data extraction
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-30 10:06:32 +02:00
jkoberg
25d1347a76 create folders if they are not existing
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-30 09:49:56 +02:00
jkoberg
9f5b33f661 use reva gateway client and mocks
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-29 16:06:10 +02:00
jkoberg
ebd730c778 use location from request
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-29 16:02:43 +02:00
jkoberg
442c53f796 add gdpr export endpoint
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-29 16:02:42 +02:00
Daniel Swärd
ab07525602 graph: Allow updating of group name via PATCH request 2023-03-28 13:06:53 +02:00
Dennis Sieben
e28603e633 - fixed typos 2023-03-27 08:54:51 +02:00
Jörn Friedrich Dreyer
6bec87f582 Proxy accesstoken cache store (#5829)
* refactor middleware options

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

* use ocmemstore micro store implementaiton for token cache

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

* refactor ocis store options, support redis sentinel

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

* align cache configuration

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

* database and tabe are used to build prefixes for inmemory stores

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

* add global persistent store options to userlog config

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

* log cache errors but continue

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

* drup unnecessary type conversion

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

* Better description for the default userinfo ttl

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

* use global cache options for even more caches

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

* don't log userinfo cache misses

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

* default to stock memory store

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

* use correct mem store typo string

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

* split cache options, doc cleanup

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

* mint and write userinfo to cache async

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

* use hashed token as key

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

* go mod tidy

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

* update docs

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

* update cache store naming

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

* bring back depreceted ocis-pkg/store package for backwards compatability

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

* update changelog

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

* Apply suggestions from code review

Co-authored-by: kobergj <jkoberg@owncloud.com>

* revert ocis-pkg/cache to store rename

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

* add waiting for each step 50 milliseconds

* starlack check

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: kobergj <jkoberg@owncloud.com>
Co-authored-by: Viktor Scharf <scharf.vi@gmail.com>
2023-03-22 15:21:57 +01:00
Daniel Swärd
75870d49ac graph: Hide ldap error on group membership patch. 2023-03-22 11:34:14 +01:00
Jörn Friedrich Dreyer
6b1cea32c4 allow adding group by name or id
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-03-21 17:20:41 +01:00
Daniel Swärd
40ab22195d Merge pull request #5836 from owncloud/excds/bugfix/Fix_updating_accountEnabled_for_educationUser
graph: Fix so that accountEnabled updates work for educationUser.
2023-03-21 11:44:53 +01:00
Jörn Friedrich Dreyer
474c4b848d upgrade to go1.20 and auto set go mem limit (#5732)
* upgrade to go1.19 and set go mem limit

* create ocis-pkg memlimit package

* use std automemlimit import

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

* import automemlimit in every ocis service, drop ocis-pkg/memlimit package

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

* bump go to 1.20

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

* drop unused config options and env vars

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

* update all version numbers, add doc

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

* fix lint

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

* update bingo and mockery

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

* bump golangci-lint

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

* fix selector test

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

* Update changelog/unreleased/enhancement-memlimit.md

Co-authored-by: kobergj <juliankoberg@googlemail.com>

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: Willy Kloucek <wkloucek@owncloud.com>
Co-authored-by: kobergj <juliankoberg@googlemail.com>
2023-03-20 17:22:02 +01:00
jkoberg
a503ace11f don't check quota permission in graph
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-17 12:51:28 +01:00
Daniel Swärd
c765e904df Refactor user update methods to be a bit nicer. 2023-03-17 11:03:38 +01:00
Daniel Swärd
525638588d graph: Fix so that accountEnabled updates work for educationUser. 2023-03-17 10:16:39 +01:00
Ralf Haferkamp
81c0f21f78 graph: Allow to disable the default role assignment on user creation
Introduces a switch ('GRAPH_ASSIGN_DEFAULT_USER_ROLE') to allow to disable the assignment of the default role "User" to newly created users.
This will be used for setups where the role-assignments are populated either manually or during first login (e.g. from OIDC claims)
2023-03-15 15:42:57 +01:00