Commit Graph
55 Commits
Author SHA1 Message Date
zerox80 06220c591f Merge branch 'main' into codex/oidc-session-logout
main moved the audit login records into a store of their own. Both sides
add an option to the OIDC authenticator, keep both.

Assisted-by: Claude Code:Claude Mythos 5.2
2026-11-30 10:31:05 +00:00
zerox80 ef56f57c50 docs(proxy): correct the retention of logout markers on nats-js-kv
The README said that an existing bucket of the markers keeps its retention
when PROXY_OIDC_MAX_ACCESS_TOKEN_LIFETIME is changed. The store updates the
bucket at every start, so the new value also applies to markers that already
exist. Say so, and that the lifetime should only be lowered once the tokens
with the longer lifetime have expired.

The section on the backchannel logout was placed in the middle of the notes
on the cache stores. It now follows them.

Assisted-by: Claude Code:Claude Mythos 5.2
2026-11-30 10:25:52 +00:00
zerox80 b945a94532 Merge branch 'main' into codex/oidc-session-logout
main brought the audit log and reva v3. Besides the textual conflicts, some
code of both sides no longer fits together and is adapted here:

- newOIDCAuthenticator and loadMiddlewares take the logout markers and the
  audit emitter.
- The backchannel logout handler still writes the marker first. The logout is
  audited once the user is resolved, whether or not the cached claims can be
  removed afterwards, because the marker has ended the session by then.
- userForClaimKey reads the cached TokenRecord instead of a plain claims map.
- isExpectedTokenTimeError stays, because the audit log uses it to leave out
  expired tokens. A token rejected by a logout marker is still audited as a
  failed login, isExpectedTokenError only keeps it out of the error log.
- The audit test of the handler gets logout markers, an iat in the logout
  token and the new format of the cached record.
- The middleware test of the command package passes no markers.
- The logout tests import the events of reva v3.

Assisted-by: Claude Code:Claude Mythos 5.2
2026-11-30 10:25:52 +00:00
Dominik Schmidt 25f536563a feat(proxy): accept lists and globs for the CSP config file locations 2026-11-27 15:09:18 +01:00
micbar 1edcc57d88 feat(proxy): audit logins, public link access and backchannel logouts
The proxy builds the audit request context: client address (PROXY_CLIENT_IP_HEADER behind trusted proxies), user agent, auth method, session and OIDC client. A value a client sent in X-Audit-Context is dropped.

A login is recorded once per OIDC session and client, not per access token. Public link access is recorded with the client address, failed attempts every time.
2026-11-26 16:52:55 +01:00
zerox80 7b183f2293 fix(proxy): reject tokens covered by a backchannel logout
Multiple access tokens can be valid for one session, for example after a
refresh. A logout only removed the cached claims of the token in the session
lookup, so older tokens stayed accepted. With PROXY_OIDC_SKIP_USER_INFO=true,
even the removed token was accepted again, because a still valid JWT was
verified anew.

Write a marker on every verified logout and check it on every authenticated
request, for cached and uncached tokens. This also covers tokens the proxy
has not seen before the logout.

If the marker store cannot be read, the cached claims are not used and the
userinfo endpoint decides about the token. With
PROXY_OIDC_SKIP_USER_INFO=true there is no such check, so the request is
rejected. A corrupt marker always rejects.

The cached record now keeps the verified subject, session and issue time,
because a userinfo response can overwrite them in the claims. The cache
database is renamed to start with a fresh cache.

Markers get their own database because nats-js-kv only supports one TTL per
bucket. They are kept for the new PROXY_OIDC_MAX_ACCESS_TOKEN_LIFETIME plus a
buffer. A JWT access token with a longer lifetime or without an expiration
can outlive its marker, so the proxy logs a warning for it.

Logout tokens without iat are now rejected, as the spec requires the claim.

Publishing the logout event and removing cached records are now best effort,
so a failed publish no longer prevents the logout.
2026-11-10 22:27:38 +01:00
André Duffeck 487313d06c Remove redis-sentinel from store descriptions
Redis isn't supported anymore. Also note that the posix driver needs
nats-js-kv for the id cache.
2026-11-10 12:26:09 +01:00
micbar b7bb4fbe8c fix: client address for clients in a private network and behind the proxy 2026-11-02 10:25:18 +01:00
micbar 4e7ebd4f8c fix: only trust forwarding headers from trusted reverse proxies
chi's ClientIPFrom* header middlewares trust the header from anyone who can
  reach us. Pick the middleware per request instead: headers are only read
  when the peer is a trusted proxy, everyone else gets their network address.

  - PROXY_TRUSTED_PROXIES, defaults to loopback and private ranges
  - PROXY_CLIENT_IP_HEADER, defaults to X-Forwarded-For, e.g. CF-Connecting-IP
  - drop the strategy setting and xff_trusted_hops
  - pass the client address to the services in X-Forwarded-For instead of
    X-Client-Ip, reva reads it e.g. for OCM
  - same check in collaboration, traefik routes to it directly
  - OC_TRUSTED_PROXIES and OC_CLIENT_IP_HEADER set both services
  - the other services only drop RealIP, none of them reads the address

  Taken from #3864 and https://github.com/opencloud-eu/opencloud/pull/3464#issuecomment-6494799883

# Conflicts:
#	services/proxy/README.md
2026-10-30 15:15:22 +01:00
Anja Barz 25791bbd19 fix(proxy): make metrics table MDX-compatible (#3680) 2026-10-12 09:00:25 +02:00
Pascal Bleser 36747cfbdc feat(proxy): add the service to the proxy metrics: re-add legacy metrics for compatibility
* re-add the metrics that were existing prior to this PR, to keep them
   for compatibility reasons with existing Grafana panels:
   - opencloud_proxy_requests_total
   - opencloud_proxy_errors_total
   - opencloud_proxy_duration_seconds

 * renamed new metric opencloud_proxy_request_total (that contains the
   service label) to opencloud_proxy_service_request_total

 * renamed new metric opencloud_proxy_duration_seconds (that contains
   the service label) to opencloud_proxy_service_duration_seconds
2026-09-18 09:52:33 +02:00
Pascal Bleser d768a9b0f9 feat(proxy): add the service to the proxy metrics
Improve the metrics for the proxy service.

 * extend the instrumenter middleware to add a label with the name of
   the service the request is being dispatched to

 * add a native Prometheus histogram that tracks the durations and also
   includes a label for the name of the service the request is being
   dispatched to, as well as a 'result' label ('success',
   'client-error', 'server-error') based on the HTTP status code of the
   response

 * add per-service gauge functions to count the number of in-flight
   requests

 * add a counter for routing failures, for when an inbound request
   cannot be mapped to a route

 * extend the route.RoutingInfo struct with a service attribute, and a
   Service() getter

 * remove the 'routing_failure_count' metric, as it is redundant
2026-09-18 09:52:33 +02:00
zerox80andRalf Haferkamp e6699f31f1 Update services/proxy/README.md
Co-authored-by: Ralf Haferkamp <ralf@h4kamp.de>
2026-09-16 10:15:56 +02:00
zerox80 0bcbb61339 docs(proxy): clarify IDP audience setup [docs-only] 2026-09-16 10:15:56 +02:00
zerox80 012d73c48e docs(proxy): document OIDC access token audience validation 2026-09-16 10:15:56 +02:00
Thomas Schweiger 50be30e5db fix: fix typo in proxy service documentation 2026-07-08 10:25:47 +02:00
Heiko Pohl 9502e00dc3 switch role_name from guest to user-light in proxy README.md 2026-06-09 11:41:52 +02:00
Jörn Friedrich Dreyer c99342318f merge ocdav into frontend
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-01-07 15:04:34 +01:00
Anja Barz f36cf7832b remove opencloud_full from the read.me and add opencloud-compose instead (#1474)
* remove opencloud_full from the read.me and add opencloud-compose instead

* remove wrong changes

* add eicar file which accendially was removed

* replace eicar.zip
2025-09-09 13:07:32 +02:00
Jörn Friedrich Dreyer 8ac250952f url fixes, more decisions
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-29 16:49:39 +01:00
Jörn Friedrich Dreyer 7be14bf8a4 drop infinite scale
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-21 15:09:07 +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
Ralf HaferkampandJörn Friedrich Dreyer 08547351b3 fix github url in services/proxy/README.md
Co-authored-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-16 09:45:46 +01:00
Ralf Haferkamp 213e9663a9 Rename go-micro services 2025-01-16 09:45:46 +01:00
Jörn Friedrich Dreyer a46fd132bd use OC_ env prefix
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 16:11:11 +01:00
Martin Mattel 1daf2ecd97 [docs-only] Add CSP to proxy readme 2024-11-22 16:56:47 +01:00
Martin Mattel 0f4bd3fc0b [docs-only] Text fix in proxy readme 2024-11-13 08:40:45 +01:00
Martin Mattel d664043562 fixes 2024-11-12 14:43:29 +01:00
Martin Mattel 9491abd1b9 rewrite and impacts 2024-11-12 12:39:42 +01:00
MartinandPhil Davis 379feec22e Update services/proxy/README.md
Co-authored-by: Phil Davis <phil@jankaritech.com>
2024-11-11 12:46:03 +01:00
Martin Mattel f3e86c0de8 [docs-only] Claim update process (proxy service readme) 2024-11-11 12:28:20 +01:00
jkoberg c80254c4f1 feat(ocis): remove ocm store
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2024-10-15 17:24:51 +02:00
Ralf Haferkamp 8c624ffa0a docs: Clarify wording in the autoprovisioning section
Fixes #9613
2024-08-06 08:25:36 +02:00
Ralf HaferkampandMartin 60741472ac Apply suggestions from proof reading
Co-authored-by: Martin <github@diemattels.at>
2024-07-08 09:32:23 +02:00
Ralf Haferkamp bda35131bd proxy: Document automatic user and group provisioning
Closes: #9193
2024-07-08 09:32:23 +02: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
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
kobergjandMartin 423c28b298 improve store readmes
Co-authored-by: Martin <github@diemattels.at>
2023-12-15 13:25:10 +01:00
jkoberg 3890b4a4be add documentation for proxy routes
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-11-21 15:31:32 +01:00
mmattel d5855a56d5 [docs-only] Fix typo in proxy readme yaml example 2023-05-11 09:44:14 +02:00
mmattel 589a0f5ce1 [docs-only] Fix caching envvar use 2023-05-10 11:37:05 +02:00
MartinandMichael Barz 4ad0638429 Update services/proxy/README.md
Co-authored-by: Michael Barz <mbarz@owncloud.com>
2023-05-02 21:06:25 +02:00
mmattel 1d73b0e025 update proxy_tls description 2023-05-02 20:41:15 +02:00
EParzefall e2686f90b9 spelling fixes 2023-04-24 13:55:10 +02:00
mmattel 84d2d8dae9 [docs-only] Fix texts and typos in README.md files 2023-04-23 10:02:27 +02:00
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
mmattel b2504035e0 fix readme service names 2023-04-12 18:40:41 +02:00
mmattel 255dd06c92 [docs-only] Fix readme.md for caches 2023-04-04 09:15:24 +02:00
Ralf Haferkamp 7e6b690ccf proxy: update README with notes about role assignment (#5878) 2023-03-20 21:03:41 +01:00