Commit Graph

78 Commits

Author SHA1 Message Date
mmattel
6ad53971ef [docs-only] Increase readability for log level values in the description 2023-07-07 10:33:42 +02:00
mmattel
d7b447b791 [docs-only] Increase readability for tracing values in the description 2023-07-07 09:50:39 +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
Daniël Franke
96557a95ae Add tracing to settings service.
This adds tracing to the settings service. It uses the otelchi package
and passes the tracing provider to the grpc and http servers.
2023-06-27 12:31:19 +02:00
mmattel
758192bd6d [docs-only] Fix some envvar descriptions 2023-06-09 13:03:17 +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
Michael Barz
fc807299b6 change role name to user light 2023-06-06 14:58:45 +02:00
jkoberg
d347448ec0 remove duplicated sutureservice code
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-06-02 12:02:27 +02:00
jkoberg
b41b1ec4cb rename permssions
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-05-30 10:35:51 +02:00
Jörn Friedrich Dreyer
0edb2b9c5b fix preflight requests
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-22 16:28:51 +02:00
Phil Davis
4874da778c Reword 'allow to' sentences 2023-05-18 09:48:29 +05:45
Phil Davis
f19830e919 Reword 'allows to' sentences 2023-05-18 09:46:25 +05:45
jkoberg
03b31b9580 give spaceadmin delete-all-spaces
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-05-17 19:31:01 +02:00
Martin
98c6e3a7e0 Update services/settings/pkg/store/defaults/defaults.go
Co-authored-by: kobergj <jkoberg@owncloud.com>
2023-05-17 10:44:50 +02:00
mmattel
7fd9b30258 [docs-only] Fix settings typos 2023-05-17 10:35:40 +02:00
Michael Barz
d4e7034046 Merge pull request #6310 from owncloud/update-roles
update the default roles
2023-05-16 15:18:55 +02:00
Michael Barz
02fe615e1c update the default roles 2023-05-15 22:17:50 +02:00
mmattel
c3c82941be [docs-only] Update SETTINGS_STORE_TYPE envvar description 2023-05-15 17:40:00 +02:00
Ralf Haferkamp
df5edec36b settings: User go-micro/store for cachiing
The previous implementation was using an unlimited TTL which would cause
problems in scale out deployments where multiple instances of the settings
service are running.

Fixes: #5067
2023-05-12 14:49:19 +02:00
Ralf Haferkamp
18bb3dbaca settings: Instanciate only a single instance of the ServiceHandler/Store
Share the same instance between the HTTP and the GRPC service. This is
in preparation for moving the cache of the metadata storage backend to a
go-micro/store based implementation. By sharing the same service instance in
the HTTP and GRPC services we can avoid the usage of global variables for the
caches, which will make the move to the go-micro/store implementation simpler.
2023-05-12 14:49:19 +02:00
jkoberg
7d13ce519d better naming for setting and permission
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-04-27 10:35:22 +02:00
jkoberg
3bf24746e6 add new setting to disable emails
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-04-26 15:33:55 +02:00
Roman Perekhod
6cf09321c9 Determine the users preferred language to translate emails via Transifex. #6087 2023-04-21 16:30:48 +02:00
Dennis Sieben
e28603e633 - fixed typos 2023-03-27 08:54:51 +02:00
Ralf Haferkamp
f5cfa7e126 proxy: Move to mockery for generating mocks
To align with what we're using everywhere else.
2023-03-20 15:12:09 +01:00
jkoberg
cdddd16c0a add permission to change space quota
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-17 12:51:26 +01:00
Ralf Haferkamp
8b704085ce Allow ADMIN_USER_ID being empty (#5842)
For certain setups we don't need the ADMIN_USER_ID to be set. It is
mainly needed for bootstrapping the internal idm and the initial role
assignment.  If roles are assigned by other means (e.g. OIDC claims
in the future) we don't need it.

This makes the ADMIN_USER_ID optional, also if ADMIN_USER_ID is unset
we don't need to configure a password for the admin user. We will still
generated the admin_id and password when running 'ocis init', but it is
ok to run manual setups without those settings.
2023-03-15 16:15:18 +01:00
Ralf Haferkamp
46acc8f1ee Fix default assigments for demo and admin users
When using metadata backend the default role assignments for the demo users
where create independed of whether the demo users are were actually requested
to be created. This also fixes the name of the env var for enabling the demo
users. This was missed when moving from the accounts service to graph/idm for
user management.
2023-03-14 16:08:37 +01:00
Ralf Haferkamp
dbe40bd7c7 Avoid repeated default role assignments
When using the metadata storage (the current default) the default role
assignments were recreated at every start of the settings service. Leading to
duplicated role assignments

Fixes: #3432
2023-03-14 16:08:37 +01:00
David Christofas
924c2ca346 add missing comments 2023-03-06 19:01:16 +01:00
David Christofas
63fa35fa50 reduce duplication in configuration code 2023-03-06 16:52:44 +01:00
David Christofas
b8470d567d add new permission 'publiclink.create' and assign it to the 'Admin', 'SpaceAdmin' and 'User' roles 2023-03-01 11:53:39 +01:00
Michael Barz
7f6e52c39b load bundles from JSON 2023-02-21 21:25:33 +01:00
Willy Kloucek
5a500ea17e don't init bundles to nil 2023-02-20 12:50:24 +01:00
Willy Kloucek
a2422e8b9d fix settings service bunldes config merge problems 2023-02-20 08:10:22 +01:00
Michael Barz
794f6cd07c add constraints to permissions listing (#5594) 2023-02-17 13:45:47 +01:00
Michael Barz
eb2347e1db Merge pull request #5589 from owncloud/settings-roles
make the default settings bundles part of the config
2023-02-16 16:05:29 +01:00
Michael Barz
29501b2cfe make the default settings bundles part of the config 2023-02-16 13:24:31 +01: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
David Christofas
7c17ddb0b0 add a permission check to the logo upload 2023-02-13 13:48:39 +01:00
mmattel
bc6241a3dd Improve the description of the OCIS_ADMIN_USER_ID envvar 2023-02-09 12:50:01 +01:00
Benedikt Kulmann
8c033e1936 change: remove the settings ui
ownCloud Web recently transitioned to Vue3. The settings ui is still
written in Vue2. Since it's pretty much unused we won't take the efforts
of upgrading it to Vue3.
2023-02-03 10:27:05 +01:00
kobergj
b7a5e1c29e use correct permission (#5458)
Signed-off-by: jkoberg <jkoberg@owncloud.com>

Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-01-26 11:16:43 +01:00
jkoberg
b2067575a9 bump reva
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-01-25 15:39:41 +01:00
jkoberg
1a69388e14 add new permissions
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-01-25 15:25:54 +01:00
Jörn Friedrich Dreyer
32cc9beb0b walk and log chi routes, ocs cleanup (#5428)
* walk and log chi routes, ocs cleanup

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

* make linter happy

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

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-01-23 12:30:34 +01:00
Jörn Friedrich Dreyer
078698fdf4 graph: add appRoleAssignments and minimal application resource (#5318)
* bump libregraph-go lib

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

* add appRoleAssignment stubs

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

* add get application stub

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

* fetch appRoles for application from settings service

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

* initial list appRoleAssignments implementation

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

* initial create appRoleAssignment implementation, extract assignmentToAppRoleAssignment, configurable app id and displayname

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

* initial delete appRoleAssignment implementation, changed error handling and logging

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

* initial expand appRoleAssignment on users

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

* test user expand appRoleAssignment

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

* test appRoleAssignment

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

* fix education test by actually using the mocked roleManager

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

* test getapplication

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

* list assignments

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

* use common not exists error handling

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

* default to just 'ownCloud Infinite Scale' as application name

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

* fix store_test

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

* roll application uuid on init

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

* fix tests

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

* extract method

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

* Apply suggestions from code review

Co-authored-by: Michael Barz <mbarz@owncloud.com>

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: Michael Barz <mbarz@owncloud.com>
2023-01-12 16:09:34 +01:00
David Christofas
efe1fc52e0 fix nilerr bugs 2022-12-21 14:45:50 +01:00
Jörn Friedrich Dreyer
53d15d329e remove deprecated use of ioutil (#5205)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2022-12-08 14:44:53 +01:00
Ralf Haferkamp
07a78287a7 Allow initial self-assignemnt of UserRole
When using an external user management we need to allow users to self-assign
the default role. This adds an explicit check for that to the settings service.
This also means we no longer need to fiddle with the account id in the proxy
upon first login.

Fixes: #5045
2022-11-16 16:23:32 +01:00