Commit Graph

204 Commits

Author SHA1 Message Date
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
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
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
Jörn Friedrich Dreyer
b8bdd4573a introduce otlp tracing (#5132)
* introduce otel tracing

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

* use new trace provider initialization

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

* work

* bump reva

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

* remove commented code

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

* add vendor changes

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

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2023-05-26 22:21:03 +02:00
Martin
9f2500eba1 Merge pull request #6379 from rhafer/issue/6194
proxy: Return an error when autoprovision a user fails
2023-05-24 18:50:15 +02:00
Ralf Haferkamp
3dc0fff1f4 proxy: Return an error when autoprovision a user fails
Fixes: #6194
2023-05-24 17:17:15 +02:00
Ralf Haferkamp
54adf267c0 Fix oidc username claim name
It's 'preferred_username' not 'preferred_user'.
2023-05-24 17:12:38 +02:00
Michael Barz
e4aaf79614 Merge pull request #6355 from owncloud/fix-cors-headers
fix preflight requests
2023-05-24 09:40:01 +02:00
Ralf Haferkamp
52951b42b0 idp/proxy: Match users by ID instead of name by default
Reconfigure the oidc clients for lico, so that lico adds the "lg.uuid" to
tokens and userinfo by default. That claim will contain the userid. So
we can now use the userid for matching users when using the default
idm/idp configuration. This fixes further problems so that users being
recreated with the same name are correctly treated as differnt users.

Fixes: #904
2023-05-23 09:48:47 +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
f19830e919 Reword 'allows to' sentences 2023-05-18 09:46:25 +05:45
Michael Barz
43ed7392be add missing response body to blocked requests 2023-05-11 16:31:19 +02:00
mmattel
1d73b0e025 update proxy_tls description 2023-05-02 20:41:15 +02:00
Ralf Haferkamp
b7990875c1 oidc: Remove "aud" claim validation of logout tokens (#6156)
The "aud" claim of the logout token is supposed to contain the client-id
of the client for which the token was issued. Our current implementation of
validating that claim is somewhat broken. We only allow to configure a single
value for the allowed client id. But we have different client-ids
accessing oCIS.

This completely removes the current validation of the `aud` claim until
we come up with a working solution. As we currently require a session id
to be present in the logout token the risk not validating the `aud`
claim is pretty low.

Related: #6149
2023-04-27 10:34:09 +02:00
Andre Duffeck
be569b7c59 [full-ci] More cache cleanup (#6134)
* Make env var names consistent with the others

* Remove unused OCS cache

* Use the same cache database for shared caches

* Bump reva
2023-04-25 15:46:59 +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
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
Christian Richter
a6ced1f99f Simplifiy Unmarshall function for stringAsBool struct
Co-authored-by: Julian Koberg <jkoberg@owncloud.com>
Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-04-20 11:45:13 +02:00