25 Commits

Author SHA1 Message Date
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
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
Jörn Friedrich Dreyer
747b2879d7 proxy
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-16 17:31:51 +01:00
André Duffeck
8c8cdd9310 Adapt protobuf naming 2025-01-15 11:04:32 +01:00
Jörn Friedrich Dreyer
b07b5a1149 use plain pkg module
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 16:42:19 +01:00
Ralf Haferkamp
01cde87af0 Adjust mockery configs for new name 2025-01-13 15:05:38 +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
Roman Perekhod
3a060331f7 fixed an idp guest role default assignment 2024-11-07 17:57:01 +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
Jörn Friedrich Dreyer
23e59b5ded Parse role claims (#7713)
* extract and test role claim parsing

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

* add failing test

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

* read segmented roles claim as array and string

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

* reuse more code by extracting WalkSegments

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

* add TestSplitWithEscaping

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

* docs and error for unhandled case

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

* add claims test

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

* add missing ReadStringClaim docs

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

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-12-04 12:18:52 +01:00
Ralf Haferkamp
684f5c07e5 Use service user for role assignment and autoprovisioning
This gets us a rid of the need to configure the reva jwt secret in the
proxy. Also we no longer need to fake an internal admin user for
autoprovsioning user and/or assigning the roles to users from oidc
claims.
2023-09-07 20:54:14 +02:00
jkoberg
1bf28dac43 change assign roles logic
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-06-26 09:20:34 +02:00
jkoberg
1d0a7acc65 do not return an error when detecting too many roles
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-06-22 17:45:01 +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
Phil Davis
f19830e919 Reword 'allows to' sentences 2023-05-18 09:46:25 +05:45
Ralf Haferkamp
6059747491 proxy: Rework oidc role mapper to allow multiple matching roles
If multiple claims values have a valid matching for ocis roles, we'll pick
the ocis role that appears first in the mapping configuration.
2023-04-19 08:56:47 +02:00
Jörn Friedrich Dreyer
7f8e54b1c2 fix link 2023-03-20 15:12:09 +01:00
Ralf Haferkamp
1287bbc10d proxy: Cache the role Mapping for some time
Avoid torturing the settings service with "ListRoles" request for
every incoming request to the proxy.
The role Mapping is refreshed if cached data is older than 5 minutes.
2023-03-20 15:12:09 +01:00
Ralf Haferkamp
a448c75c75 Extract role assignments from claims
Add a UserRoleAssigner implementation that extract role names from the
users' claims and creates role assignments in the settings service based
on a configured mapping of claim values to ocis role names.

Closes: #5669
2023-03-20 15:12:09 +01:00
Ralf Haferkamp
d57d52b33d proxy: Add an interface for user role assignment
This moves the lookup and the creation of the users' role assignemt out
of the user backend into its own interface. This makes the user backend
a bit simpler and allows to provide different implemenation for the user
role assignment more easily.
2023-03-20 15:12:09 +01:00