1
0
mirror of https://github.com/owncloud/ocis.git synced 2026-10-23 23:29:02 +03:00
Commit Graph

176 Commits

Author SHA1 Message Date
Matteo
9015eec558 fix(vault): [OCISDEV-1503] fix signed URL downloads in vault mode (#13097)
Save the MFA status after the user is resolved so signed-URL downloads
inherit it, and check its age on read. Build the signing-key URL with
the URL API so it works with the vault base URL.
2026-10-12 10:28:49 +02:00
Roman Perekhod
2e377bde67 fix: [OCISDEV-1476] fix AuthApp requests failing with a custom PROXY_… (#13078) (#13107)
* fix: [OCISDEV-1476] fix AuthApp requests failing with a custom PROXY_USER_OIDC_CLAIM

* fix: [OCISDEV-1476] map ErrAccountNotFound to 401 in verifyUser

AccountResolver.verifyUser only mapped ErrAccountDisabled to 401 before
falling through to a generic 500. The identity backend excludes disabled
accounts from by-username lookups and returns ErrAccountNotFound instead,
so a disabled user authenticating via AppAuth or basic auth got a 500
instead of a 401, caught by the acceptance test suite.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-09 13:37:34 +00:00
Paul Faure
1347e3607d fix(proxy): don't log an error when create-home finds no user (#13102)
Requests on unprotected routes can carry a reva token without a resolved
user: reva's internal downloads to the data gateway (/data) are sent with
the caller's token. create_home logged "no user in context" at error level
for each of them, so every download added an error line. Log at debug with
the path instead; the request is passed on unchanged, as before.

Fixes #13101


Claude-Session: https://claude.ai/code/session_01WpoeSoKYEdgQcWjEzTVKpT

Signed-off-by: Paul Faure <paul@faure.ca>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 13:50:55 +02:00
Michal Klos
dc33f20fee feat: [OCISDEV-1411] don't logout users on a transient IdP userinfo failure (#12999)
* test: [OCISDEV-1411] regression test for userinfo-timeout 401

* fix: [OCISDEV-1411] don't logout users on a transient IdP userinfo failure

* fix: [OCISDEV-1411] don't logout users on a transient IdP userinfo failure

* feat: review

* feat: review

* feat: review
2026-09-29 09:37:48 +02:00
Roman Perekhod
a19f8dac48 fix: [OCISDEV-1404] harden public link brute force protection (#12944)
The proxy public share authenticator set the brute force protection skip
marker on every authentication, including requests where the proxy is the
only authenticator. Failed password attempts on those requests were never
counted, so the rate limit for password protected public links was not
enforced.

The skip marker is now only set for requests that are re-authenticated
downstream, so failed attempts are reliably counted and the throttle is
applied consistently.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-15 11:23:23 +02:00
Juan Pablo Villafañez
597104629a fix: use specific gookit config instance instance of using global (#12769)
* fix: use specific gookit config instance instance of using global

Using the global instance was causing a panic when the service was
restarted. That panic won't happen now.

* chore: add changelog entry
2026-08-11 17:48:46 +02:00
Juan Pablo Villafañez
60eee82d0d fix: auth-app will create the user home if needed (#12457)
* fix: auth-app will create the user home if needed

* fix: adjust tests

* chore: add changelog entry

* fix: test coverage
2026-07-07 17:24:13 +02:00
David Walter
bfd0c8a4ea fix(proxy): re-verify access token when cached userinfo has expired (#12414)
getClaims rejected a request with jwt.ErrTokenExpired whenever the cached
userinfo entry's expiry had passed, instead of re-verifying the access token.
The cached "exp" is not always the real token expiry: for opaque access tokens
extractExpiration falls back to the configured cache TTL. A still-valid token
could therefore be rejected merely because its cache entry aged out, producing
spurious logouts (most visible under frequent PROPFIND requests).

getClaims now treats an expired cache entry as a cache miss and falls through to
VerifyAccessToken/UserInfo re-verification. A genuinely expired or invalid token
is still rejected by that re-verification, so authentication is not weakened.

The test's mock now returns a fresh claims map per call, mirroring the real
client, so the suite is race-clean (getClaims caches asynchronously).

Signed-off-by: David Walter <david.walter@kiteworks.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 11:25:50 +02:00
David Walter
9296546be3 fix(proxy): guard against empty signing key store in presigned URL auth (#12418)
signatureIsValid indexed signingKey[0] without checking the slice length. When
the signing-key store returns an empty result without an error — which the
"noop" store does, and OCIS_CACHE_STORE=noop also switches the presigned-URL
signing-key store to noop — every signed-URL download panicked with
"index out of range [0] with length 0" (recovered per request as a 502), so all
signed-URL downloads failed.

Guard the index access and return a real authentication error. The previous
empty-value branch also returned a nil error, which would have accepted an empty
signing key; it now returns an error so the request is rejected.

Signed-off-by: David Walter <david.walter@kiteworks.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 11:23:54 +02:00
Juan Pablo Villafañez
4945eb6833 Autoprop (#12386)
* feat: metadata autopropagation

* feat: autoprop support for MFA / vault mode

* fix: replace some http clients with reva ones

* chore: required lib update

* fix: adjust unit tests and generate new mocks

* fix: apply autopropagation to all regular graph routes

* chore: updated reva dependency

* fix: return the right decorator for the thumbnails

* fix: remove autopropagation headers in the proxy
2026-06-19 10:43:41 +02:00
kobergj
69d0650994 fix(proxy): [OCISDEV-845] skip space reconciliation on signed URL requests (#12286)
The space management middleware removed users from all project spaces
when processing signed URL requests because no OIDC claims are present
in that auth context. Return early when claims are nil to prevent the
oscillating add/remove cycle.

Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-22 09:45:07 +02:00
Roman Perekhod
d7a7cd9033 feat: [OCISDEV-720] fix public link (#12332) 2026-05-21 17:55:15 +02:00
Matteo
7d566c1ea2 feat: expose MFA session duration as configurable capability (#12335) 2026-05-21 15:32:26 +02:00
Roman Perekhod
39e3d33820 [full-ci] feat: ocisdev-533 graph (#12108)
* feat: Implemet the vault-storage

feat: Separate the storage-users and graph to handle

feat: move the space create cache

configurate the vault srorage Postprocessing

hide the assignment of the MountID to VaultStorageProviderID behind a flag to avoid the ID mismatch

configurate the proxy to create the vault home space

update the filter

Make the graph able to handle vault prefix. no extra service needed

apply the vault filter to sharedbyme and sharedwithme

added vault-storage docker

use squashed reva

fix the finishUpload event

restict webdav copy/move from the vault

feat: provide the mfa to webdav and grpc

feat: refactoring: provide the mfa to webdav and grpc

mfa collaboration

fix GetRootDriveChildren and more

fix: send the MFA header in HTTP clients from the collaboration service

provide the default storage user vault configuration

update create_home middleware

Update deployments/examples/ocis_full/vault-storage.yml

Co-authored-by: Martin <github@diemattels.at>

Update services/gateway/pkg/config/config.go

Co-authored-by: Martin <github@diemattels.at>

Update services/graph/pkg/config/config.go

Co-authored-by: Martin <github@diemattels.at>

Update services/graph/pkg/config/config.go

Co-authored-by: Martin <github@diemattels.at>

Update services/storage-users/pkg/config/config.go

Co-authored-by: Martin <github@diemattels.at>

Update services/proxy/pkg/config/config.go

Co-authored-by: Martin <github@diemattels.at>

Update services/storage-users/pkg/config/config.go

Co-authored-by: Martin <github@diemattels.at>

Update deployments/examples/ocis_full/vault-storage.yml

Co-authored-by: Martin <github@diemattels.at>

bump reva

deduplicate the requireMFA middeware on vault routes. fix AppendPlainToOpaque.

added the changlog and comments

* feat: add the vault mode search

* Update changelog/unreleased/enhancement-vault-storage.md

Co-authored-by: Martin <github@diemattels.at>

* update the readme. the reva vault storage provider configuration disabled by default

* feat: [OCISDEV-531] add vault capabilities to the OCS capabilities endpoint

* the port range allocated. the configuration updated.

---------

Co-authored-by: Martin <github@diemattels.at>
2026-05-15 16:53:05 +02:00
Michal Klos
234e665699 feat: [OCISDEV-670] add masterID for EK users (#12101)
* feat: add masterID for EK users

* Update deployments/examples/ocis_multi/README.md

Co-authored-by: Martin <github@diemattels.at>

* Update deployments/examples/ocis_multi/README.md

Co-authored-by: Martin <github@diemattels.at>

* review comments

---------

Co-authored-by: Martin <github@diemattels.at>
2026-05-06 16:15:32 +02:00
Roman Perekhod
57a09b14f1 feat: move the space create cache 2026-04-23 20:13:35 +02:00
Roman Perekhod
9ca2c016be Revert "fix(proxy): [OCISDEV-460] deduplicate CreateHome calls in middleware" 2026-03-18 10:58:53 +01:00
Paul Faure
224c0e6244 refactor(proxy): extract helpers to reduce ServeHTTP cognitive complexity
Extract homeKnown() and createHome() from ServeHTTP to bring
cognitive complexity under the SonarCloud limit of 15.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 11:20:18 -04:00
Paul Faure
e227983a9f feat(proxy): add PROXY_CREATEHOME_CACHE_DISABLED env var
Allow operators to disable the in-memory CreateHome cache via
PROXY_CREATEHOME_CACHE_DISABLED as a fallback if the cache causes
unexpected behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 10:50:36 -04:00
Paul Faure
a087a99da0 fix: address SonarCloud linter issues in CreateHome middleware
- Use canonical header casing "X-Access-Token" (canonicalheader)
- Return true instead of nil on success to avoid nilnil (nilnil)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 00:50:05 -04:00
Paul Faure
31ce8a68a7 fix(proxy): deduplicate CreateHome calls with singleflight and sync.Map
The CreateHome middleware fired a gRPC CreateHome request on every
authenticated HTTP request. On first login the browser sends ~11
parallel requests, each triggering a redundant call. Use singleflight
to collapse concurrent calls for the same user and sync.Map to cache
successful results so subsequent requests skip the gRPC call entirely.

Fixes: #12068

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:34:10 -04:00
Michal Klos
983dc5f7b5 fix: X-XSS-Protection header (#12092) 2026-03-10 09:15:35 +01:00
Juan Pablo Villafáñez
d3f328320a feat: propagate GRPC metadata across go-micro services
The server handlers for go-micro reuse the data from reva so the
propagation also works with reva services.
Both reva and go-micro services will propagate the data correctly.
2026-01-23 12:05:18 +01:00
Juan Pablo Villafáñez
2b344bffe6 feat: implement brute force protection for public shares 2026-01-23 12:05:18 +01:00
Michal Klos
1d0559866e fix: Strict-Transport-Security via proxy 2026-01-05 15:15:48 +01:00
Julian Koberg
ace084dc10 feat: clean up multi-instance-ocis
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2025-12-15 10:46:51 +01:00
Julian Koberg
b5a765124b feat: multi-instance-ocis
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2025-12-15 10:46:51 +01:00
Lukas Hirt
f0b2693cd3 feat(proxy): [OCISDEV-342] set referrer-policy to no-referrer
Change the Referrer-Policy from 'strict-origin-when-cross-origin'
to 'no-referrer' to enhance user privacy and security.

Previously, the origin was sent on cross-origin requests. This change
completely removes the Referrer header from all outgoing requests,
preventing any potential leakage of browsing information to third parties.
This is a more robust approach to protecting user privacy.
2025-10-27 09:38:36 +01:00
Julian Koberg
f9c095b36e Revert "fix: [OCISDEV-237] fix proxy"
This reverts commit 7ec667d4b1.
2025-10-01 15:20:16 +02:00
Lukas Hirt
c620c0c030 Merge pull request #11687 from owncloud/feat/drop-remote-php
[full-ci] feat: [OCISDEV-330] drop remote.php prefix
2025-09-25 09:36:49 +02:00
kobergj
2f1ab88b8b Merge pull request #11603 from owncloud/oidc_claims_checker
feat: add a way to check for specific OIDC claims
2025-09-24 13:43:53 +02:00
Lukas Hirt
1b83d986f9 feat: [OCISDEV-330] drop remote.php prefix
The `remote.php` prefix is now fully optional in WebDAV endpoints and is never returned in responses.
2025-09-24 11:25:27 +02:00
Julian Koberg
dda6104722 feat: document mfa package
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2025-09-18 16:23:14 +02:00
Julian Koberg
824a71dbe2 feat: clean up mfa middleware
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2025-09-17 15:56:04 +02:00
Lukas Hirt
dcd3dc6a77 fix: [OCISDEV-330] add OCS v2 capabilities endpoint to public paths
Following the same behavior as OCS v1, we added the OCS v2 capabilities
endpoint to the public paths.
2025-09-17 14:54:16 +02:00
Julian Koberg
eeeeba199b feat: move mfa checks to handlers
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2025-09-17 12:42:28 +02:00
Julian Koberg
5052c65526 feat: use middleware for mfa checks
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2025-09-17 12:42:28 +02:00
Juan Pablo Villafáñez
7b053e808a fix: adjust unit tests 2025-09-17 12:42:28 +02:00
Juan Pablo Villafáñez
c0e5c1678d feat: allow custom headers on authentication failures 2025-09-17 12:42:28 +02:00
Juan Pablo Villafáñez
ed95f21269 feat: add a way to check for specific OIDC claims
For now, only some hardcoded paths will check the claims (if there is a
checker configured). If the check fails for those paths, the
authentication will fail and it will return a 401 error
2025-09-17 12:42:28 +02:00
Roman Perekhod
1800cc85b1 Merge pull request #11628 from 2403905/issues/OCISDEV-278
feat: [OCISDEV-278] X-XSS-Protection header removed
2025-09-16 16:39:34 +02:00
Michal Klos
70dd34eb84 fix: [ocisdev-266] code scan #27 2025-09-04 15:14:19 +02:00
Roman Perekhod
7ec667d4b1 fix: [OCISDEV-237] fix proxy 2025-09-04 11:38:06 +02:00
Roman Perekhod
d9bf69014f feat: [OCISDEV-278] X-XSS-Protection header removed 2025-09-02 18:02:53 +02:00
Roman Perekhod
55fe5bd3ec feat: [OCISDEV-147] use the signing-key for a public link 2025-08-19 17:42:26 +02:00
Juan Pablo Villafañez
a46cd29cc9 Merge pull request #11573 from owncloud/otelhttp_for_tracing
Otelhttp for tracing
2025-08-07 13:48:02 +02:00
Michal Klos
112ed96f2b fix: hsts 2025-08-04 11:54:12 +02:00
Juan Pablo Villafáñez
01a9713b52 feat: use otelhttp for tracing, fix tracing in proxy
otelchi and other custom solutions have been replaced with otelhttp to
trace HTTP requests; new middleware is provided to be used across the
platform.

The proxy service will use a custom HTTP client to forward the headers
needed for telemetry automatically (also based on otelhttp)
2025-07-31 11:06:33 +02:00
Michal Klos
6e118bb6c5 fix: cookies, missing SameSite 2025-06-12 10:49:44 +02:00
Michal Klos
ae73db933b fix: cookie, missing secure flag 2025-06-10 10:24:58 +02:00