Commit Graph

239 Commits

Author SHA1 Message Date
Michael Barz
6356be8d51 Merge pull request #8952 from rhafer/issue/8635
Autoprovsioning fixes
2024-05-02 16:06:45 +02:00
Thomas Müller
a8cbc612cc chore: remove unused return value from BindSourcesToStructs (#9033) 2024-04-30 18:18:31 +02:00
Thomas Müller
4f7480d322 feat: drop github.com/a8m/envsubst in favor of gookit/config (#9028) 2024-04-30 18:05:58 +02:00
Ralf Haferkamp
54bb4b44b0 chore: Fix some linter complaints 2024-04-30 17:09:21 +02:00
Ralf Haferkamp
0da7eccd1d fix(autoprovision): make email optional
The mail address is not a required attrbute for our users. So we can auto-provision users without it.

Fixes: #6909
2024-04-30 17:09:21 +02:00
Ralf Haferkamp
741dce501b enhancement(autoprovision): Allow to configure which claims to use for auto-provisioning user accounts
When auto-provisioning user accounts we used a fixed mapping for claims
for the userinfo response to user attributes. This change introduces
configuration options to defined which claims should be user for the
username, display name and email address of the auto-provisioned
accounts.

This also removes the automatic fallback to use the 'mail' claim as the
username when the 'preferred_username' claim does not exist.

Fixes: #8635
2024-04-30 17:09:19 +02:00
Thomas Müller
bdbba929d0 feat: add CSP and other security related headers in the oCIS proxy service (#8777)
* feat: add CSP and other security related headers in the oCIS proxy service

* fix: consolidate security related headers - drop middleware.Secure

* fix: use github.com/DeepDiver1975/secure

* fix: acceptance tests

* feat: support env var replacements in csp.yaml
2024-04-26 09:10:35 +02:00
Jörn Friedrich Dreyer
f8f864e566 always initialize http handler
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-04-24 10:39:12 +02:00
Ralf Haferkamp
8d5a0c6dd8 fix(public-share-auth): allow to create new documents in public share folder
The public share authentication middleware only allowed to open existing documents
the /app/new route was missing.

Fixes #8691
2024-04-15 16:35:13 +02:00
Thomas Müller
07f0cd5574 fix: typos, naming clashes, error messages and deprecations 2024-04-03 15:34:36 +02:00
Christian Richter
5cc286b8ef incorporate requested changes
Signed-off-by: Christian Richter <crichter@owncloud.com>
2024-03-19 08:38:54 +01:00
Christian Richter
d31f5b9e15 remove obsolete comment
Signed-off-by: Christian Richter <crichter@owncloud.com>
2024-03-18 16:56:10 +01:00
Christian Richter
29549fade7 kill oidc well known middleware and move it to static route
Signed-off-by: Christian Richter <crichter@owncloud.com>
2024-03-18 16:56:10 +01:00
Christian Richter
1323a554bc move static routes to seperate package
Signed-off-by: Christian Richter <crichter@owncloud.com>
2024-03-18 16:56:10 +01:00
Phil Davis
49a2202bdf chore: set introductionVersion 5.0 in services/proxy 2024-03-06 17:50:21 +05:45
Phil Davis
9d2be66a85 chore: add introductionVersion pre5.0 to environment variable docs 2024-03-06 17:50:20 +05:45
Jörn Friedrich Dreyer
2dce3e997d Merge pull request #8546 from owncloud/verify-service-accounts-are-set
verify all system accounts are set
2024-02-29 17:29:08 +01:00
Jörn Friedrich Dreyer
972adafd29 verify all system accounts are set
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-02-29 15:51:37 +01:00
Michael Barz
643d4ccbfb fix: change default config for the role mapping 2024-02-28 12:04:57 +01:00
Jörn Friedrich Dreyer
26136f8f81 drop store service in favor of a micro store implementation (#8419)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-02-26 16:08:03 +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
Thomas Müller
b12cff1016 fix: properly check expiry and verify signature of signed urls (#8385)
fix: signed url expiry validation only checks for expiry and not for used before
2024-02-07 15:44:33 +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
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
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
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