Commit Graph

234 Commits

Author SHA1 Message Date
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
45d1936384 verify expiry of cached claims (#8310)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-01-31 14:58:18 +01:00
Michael Barz
60a67d7b0a Fix proxy debug env name 2024-01-19 10:29:33 +01:00
Michael Barz
158e27d31d docs: add dev docs 2023-12-21 15:32:41 +01:00
Michael Barz
14553dd6b1 feat: RED metrics 2023-12-20 14:53:16 +01:00
Andre Duffeck
2284fe388d Also log the traceid alongside the request id (#8023)
* Also log the traceid alongside the request id

* Add changelog
2023-12-20 09:32:57 +01:00
jkoberg
de4f9d78f4 allow authentication for stores
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-19 10:44:05 +01:00
kobergj
423c28b298 improve store readmes
Co-authored-by: Martin <github@diemattels.at>
2023-12-15 13:25:10 +01:00
Andre Duffeck
fd09d29b5c Merge pull request #7973 from aduffeck/ocm-access
[full-ci] Ocm access
2023-12-14 14:36:31 +01:00
André Duffeck
b17fa1d72b Make /remote.php/dav/ocm/ work as well 2023-12-14 09:30:41 +01:00
jkoberg
d62cb9d34b use inmemory cache by default
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-13 12:49:54 +01:00
jkoberg
ad87ac955a configure services individually
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-13 12:49:54 +01:00
jkoberg
bbc4f83f7d bump dependencies
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-12-13 12:49:53 +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
Florian Schade
ad06a192d8 enhancement: add graph beta listPermissions endpoint (#7753)
* enhancement: add graph beta listPermissions endpoint

besides the new api endpoint it includes several utilities to simplify the graph api development.

* resolve drive and item id from the request path
* generic pointer and value utilities
* space root detection

* update GetDriveAndItemIDParam signature to return a error

* move errorcode package

* enhancement: add generic error code handling

* fix: rebase
2023-11-28 17:06:04 +01:00
jkoberg
3890b4a4be add documentation for proxy routes
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-11-21 15:31:32 +01:00
jkoberg
69a2da889a allow configuring addtional proxy routes
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-11-17 09:20:10 +01:00
mmattel
5e74b50efb [docs-only] Fix envvars with a array slice ([]string) 2023-11-09 12:22:59 +01:00
Martin
89fb341738 Merge pull request #7690 from owncloud/fix_envvar_duration_descriptions
[docs-only] Fix envvars with a duration.
2023-11-09 09:28:36 +01:00
Florian Schade
643158b67b enhancement: add sharedWithMe graph beta endpoint (#7633) 2023-11-08 20:02:58 +01:00
mmattel
b13b880921 [docs-only] Fix envvars with a duration. 2023-11-08 18:32:39 +01:00
André Duffeck
668f917dba Add an ocm service exposing the ocm related http and grpc APIs 2023-10-24 10:29:29 +02:00
Ralf Haferkamp
dfeff633fa proxy: also set the "Www-Authenticate" header for graph request
There doesn't seem to be a good reason to treat the graph service differently here.
2023-10-16 10:31:39 +02:00
Ralf Haferkamp
951e1e5a09 proxy: Avoid duplicated Www-Authenticate headers
For endpoints in the "ProxyWwwAuthenticate" list we accidently set the Www-Authenticate
header twice.
2023-10-16 10:31:39 +02:00
Ralf Haferkamp
07a718dc8e proxy: User ReverseProxy.Rewrite instead of Director
With Go 1.20 the "Rewrite" hook for ReverseProxy was introduced to
supersede of the "Director" hook (see:
a55793835f)

The Rewrite hooks allows for better separation between the incoming and
outgoing request. In particular it makes it pretty easy to set the
correct X-Forwarded-* Headers on the outgoing request.
The need for using "Rewrite" came up when trying to embed
authelia. It uses the X-Forwarded-Host and X-Forwared-Proto headers to
e.g. compute the correct return values for the various endpoints in
.well-known/openid-configuration.
2023-10-16 10:31:39 +02:00
case0sh
ace3664f6a fix formatting 2023-10-06 10:29:08 +02:00
jkoberg
1f1aa50c54 hard exit when services fail
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-09-21 13:53:18 +02: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
Jörn Friedrich Dreyer
3bf5e5efa4 actually use skip user info config option (#7216)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-09-05 12:57:01 +02:00
jkoberg
1bfdc43054 reroute sse path to sse service
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-08-29 13:59:39 +02:00
Daniel Swärd
49fc22d532 Add missing tracing references to multiple services. (#7110) 2023-08-23 15:17:17 +02:00
Jörn Friedrich Dreyer
eb6c0a840a fix docs
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-08-23 14:37:16 +02:00
Jörn Friedrich Dreyer
91a77d1671 Update services/proxy/pkg/config/config.go
Co-authored-by: Martin <github@diemattels.at>
2023-08-23 13:56:48 +02:00
Jörn Friedrich Dreyer
5422586bfa allow skipping userinfo call
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-08-23 13:56:48 +02:00
Jörn Friedrich Dreyer
21f52a8523 properly register webdav methods with chi
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-07-31 17:38:15 +02:00
Florian Schade
90ba75e27e enhancement: Evaluate policy resource information on single file shares (#6888)
* enhancement: Evaluate policy resource information on single file shares

* enhancement: switch to resource name evaluation for example rego put rule
2023-07-31 12:12:56 +02:00
Daniel Swärd
ce4ad80ce2 Remove grpc.DefaultClient() reference from policies and use only one gprc client. 2023-07-28 12:21:02 +02:00
jkoberg
af2a4c2c97 check public link authorization first
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-07-26 15:02:38 +02:00
Michael Barz
dce3a62f13 add request id to all responses
Signed-off-by: Michael Barz <mbarz@owncloud.com>
2023-07-10 10:56:46 +02:00
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
jkoberg
1bf28dac43 change assign roles logic
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-06-26 09:20:34 +02:00
Daniël Franke
8f7521eff7 Move away from global tracers. (#6591)
* Move away from global tracers.

This PR moves away from global tracers and instead initialises
a tracer provider at Service setup and passes it where it needs to be.

* Change tracing provider to be set via options.

Also change name for GetServiceTraceProvider.

* Add changelog.
2023-06-23 14:20:26 +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
Jörn Friedrich Dreyer
f40b538d9d use otelhttp tracing middleware
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-06-08 17:42:02 +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
jkoberg
d347448ec0 remove duplicated sutureservice code
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-06-02 12:02:27 +02:00
Ralf Haferkamp
7a4bc71e65 Revert "idp/proxy: Match users by ID instead of name by default"
This reverts commit 52951b42b0.

The change broke authentication for at least the desktop client when
using the builtin idp. There seem to be issues in the IDP (lico) which
result in the implicit scoped not being added correctly in some case.
When that scope is missing the `lg.uuid` claim will not be present in
the userinfo and we can correctly match users by id.

This reverts back to the old behaviour of matching users by name. Which
also brings some aspects of https://github.com/owncloud/ocis/issues/904

Fixes #6415
2023-06-01 11:13:47 +02:00